mobomo / green_onion

UI testing/screenshot diffing tool
MIT License
165 stars 21 forks source link

rainbow require behavior changed #19

Open tdclemens opened 9 years ago

tdclemens commented 9 years ago

when i tried to create skins with green onion 0.1.4 i get an error:

NoMethodError: undefined method `color' for "http://localhost:12000/masterimage/OPS/html/section_0001.xhtml":String
/Users/tclemens/.rvm/gems/ruby-2.1.2/gems/green_onion-0.1.4/lib/green_onion.rb:58:in `skin_picker'
/Users/tclemens/.rvm/gems/ruby-2.1.2/gems/green_onion-0.1.4/lib/green_onion.rb:53:in `skin_visual_and_percentage'
/Users/tclemens/apps/bbf_to_ebook/Rakefile:98:in `create_skin'
/Users/tclemens/apps/bbf_to_ebook/Rakefile:124:in `block (4 levels) in <top (required)>'
/Users/tclemens/apps/bbf_to_ebook/Rakefile:122:in `each'
/Users/tclemens/apps/bbf_to_ebook/Rakefile:122:in `block (3 levels) in <top (required)>'
/Users/tclemens/apps/bbf_to_ebook/Rakefile:115:in `each'
/Users/tclemens/apps/bbf_to_ebook/Rakefile:115:in `block (2 levels) in <top (required)>'
/Users/tclemens/apps/bbf_to_ebook/Rakefile:111:in `block in <top (required)>'
/Users/tclemens/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
/Users/tclemens/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'

I looked into this and it looks like the rainbow require behavior was changed see: https://github.com/sickill/rainbow#string-mixin

In your gemspec no version is specified for rainbow, so my guess is that its grabbing 2.0 and expecting this new require behavior

jongrover commented 8 years ago

@tdclemens did you find a work around for this? Use older version of GreenOnion or require a different version of rainbow? Update: I got it working by changing version in Gemfile to gem 'rainbow', '1.99.2'

snsavage commented 8 years ago

The rainbow require needs to change to require 'rainbow/ext/string' instead of require 'rainbow'.