We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cistern's collection.rb uses to_set on BLACKLISTED_ARRAY_METHODS which is an Array.
collection.rb
to_set
BLACKLISTED_ARRAY_METHODS
However, in Ruby 2.x (http://www.ruby-doc.org/core-2.0/Array.html, http://www.ruby-doc.org/core-2.1.1/Array.html), the to_set method has been removed.
Be able to use and run cistern in Ruby 2.x which is the default OSX version in Mavericks.
Exception is thrown when using the collections:
/Library/Ruby/Gems/2.0.0/gems/cistern-0.5.3/lib/cistern/collection.rb:9:in `<class:Collection>': undefined method `to_set' for #<Array:0x007f8f4a3220b8> (NoMethodError)
Instantiate a Collections object and invoke BLACKLISTED_ARRAY_METHODS
Due to my restricted knowledge of Ruby and how to best include scripts, I could only test the fix with what I've been given :)
In collections.rb I've done the following:
collections.rb
require 'set' class Cistern::Collection extend Cistern::Attributes::ClassMethods include Cistern::Attributes::InstanceMethods BLACKLISTED_ARRAY_METHODS = Set.new [ :compact!, :flatten!, :reject!, :reverse!, :rotate!, :map!, :shuffle!, :slice!, :sort!, :sort_by!, :delete_if, :keep_if, :pop, :shift, :delete_at, :compact ] # :nodoc
This appears to fix the issue. Should I make a pull-request with this?
The text was updated successfully, but these errors were encountered:
2.1.1 :001 > [].to_set NoMethodError: undefined method `to_set' for []:Array from (irb):1 from /Users/jlane/.rvm/rubies/ruby-2.1.1/bin/irb:11:in `<main>' 2.1.1 :002 > require 'set' true 2.1.1 :003 > [].to_set []
i believe that one of the test dependencies has the side effect of requiring set.
Sorry, something went wrong.
4d3cb5d
client module with deprecation warnings
ef8d11a
No branches or pull requests
Description
Cistern's
collection.rb
usesto_set
onBLACKLISTED_ARRAY_METHODS
which is an Array.However, in Ruby 2.x (http://www.ruby-doc.org/core-2.0/Array.html, http://www.ruby-doc.org/core-2.1.1/Array.html), the
to_set
method has been removed.Expected Behaviour
Be able to use and run cistern in Ruby 2.x which is the default OSX version in Mavericks.
Actual Behaviour
Exception is thrown when using the collections:
How to reproduce
Instantiate a Collections object and invoke BLACKLISTED_ARRAY_METHODS
Possible Fix
Due to my restricted knowledge of Ruby and how to best include scripts, I could only test the fix with what I've been given :)
In
collections.rb
I've done the following:This appears to fix the issue. Should I make a pull-request with this?
The text was updated successfully, but these errors were encountered: