Giter Site home page Giter Site logo

grizzly-rb's People

Contributors

alexb52 avatar

Watchers

 avatar

grizzly-rb's Issues

Conversion - Nested initialization

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]

Array#permutation can be out of sync

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

Double check unnecessary methods definitions

Some methods seem not to cause any tests to fail. Make sure their definition is required, and if so add relevant tests.

Collection

  • product

Enumerable

  • group_by
  • minmax_by
  • minmax
  • sort_by

Subgroup Methods (MVP)

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.

  • #&
  • #+
  • #-
  • #compact
  • #difference
  • #filter
  • #find_all
  • #first
  • #group_by
  • #last
  • #minmax
  • #minmax_by
  • #partition
  • #pop
  • #product
  • #reject
  • #reverse
  • #rotate
  • #select
  • #shift
  • #shuffle
  • #sort
  • #sort_by
  • #transpose
  • #union
  • #values_at
  • #zip

Double check Enumerable methods

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

Lazy Enumerators

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.

Enumerators

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)

Enumerable Interface

an_enumerator

  • #chunk
  • #chunk_while
  • #slice_after
  • #slice_before
  • #slice_when
  • #each_entry
  • #each_with_index
  • #chain

Array Interface

returns self and pass subgroups to block

  • #permutation
  • #combination
  • #repeated_combination
  • #repeated_permutation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.