alexb52 / grizzly-rb Goto Github PK
View Code? Open in Web Editor NEWThe Ruby library you will love to hate
License: MIT License
The Ruby library you will love to hate
License: MIT License
Currently Rubocop doesn't parse nested array appropriately.
Here are examples after the setup conversion.
They seem off and probable makes some ruby-specs fail resulting in skipping some of them.
# nested arrays
ary = [Grizzly::Collection[1, 2, 3]]
Grizzly::Collection[].flatten.should be_an_instance_of(Grizzly::Collection)
Grizzly::Collection[1, 2, 3].flatten.should be_an_instance_of(Grizzly::Collection)
Grizzly::Collection[1, [2], 3].flatten.should be_an_instance_of(Grizzly::Collection)
Grizzly::Collection[1, [2, 3], 4].flatten.should == [1, 2, 3, 4]
[Grizzly::Collection[1, 2, 3]].flatten.should be_an_instance_of(Grizzly::Collection)
# arrays with variables
[1, z, 6].flatten!.should == [1, 2, 3, 4, 5, 6]
We currently test the whole permutation spec in spec/skipped_tests/core/array/permutation_spec.rb
This is bad as it can become out of sync with the ruby-spec repository.
We need a way to only tests for the 2 specs and find a way to override the before block
before :each do
# TODO : Make sure we only need to test the two instance tests for permutation.
# The full spec is tested because @numbers needed in an update in the before block
# core/array/permutation_spec.rb:26
# core/array/permutation_spec.rb:35
@numbers = Grizzly::Group.new (1..3).to_a
@yielded = Grizzly::Group.new([])
end
Some methods seem not to cause any tests to fail. Make sure their definition is required, and if so add relevant tests.
Collection
Enumerable
Handle all the methods that return an new array instead of a subclass on both Enumerable and Array methods. Enumerators and Lazy Enumerators returned from Array interface are out of scope and will be dealt in seperate issues.
Some Enumerable fixtures aren't returning Grizzly::Collection
, which can create false positives.
Investigate Enumerable specs and see if they require updates through a customer RuboCop cop or replacement.
Example: Change include Enumerable
to include Grizzly::Enumerable
in the Enumerable fixture class
Benchmark the calls of the methods and add a performance section on the README
Currently, every single method is defined.
Some metaprogramming and appropriate aliasing can reduce the length of the classes and the enumerable module.
Ruby 3 changes the signature of some Array methods and we need to update these too.
Those methods specs fail and should be fixed at one point. It seems that there is an issue with those methods and their implementation preventing an override in Ruby
https://bugs.ruby-lang.org/issues/11808
Is this the real issue here?
Grizzly::Group should be able tp handle the lazy enumeration.
collection = Collection.new((1..1_000).to_a)
result = collection.lazy.select(&:odd?).first(5)
result.should be_an_instance_of(Collection)
This lazy enumerator should interface rules based on the method called with a block.
This issue is to create an Enumerator returning a subclass of array instead of a new array. To be implemented as part of the Grizzly::Group interface
Add more methods as we discover them
enumerator = Collection.new((1..1_000).to_a).select
result = enumerator.each(&:odd?)
result.should be_an_instance_of(Collection)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.