0

Currently I use klout gem in many times for all my projects. In the gem, there is:

Hash.send :include, Hashie::HashExtensions

hash extension include but I want to change it to:

Hash.send :include, Hashie::Extensions

How can I overwrite this line?

PS: I suggest you to check source code of the gem, especially klout.rb

ekremkaraca
  • 1,453
  • 2
  • 18
  • 37
Johnny Cash
  • 4,867
  • 5
  • 21
  • 37

1 Answers1

1

You can fork the klout github repository, push commits with changes to your fork, and then use it How to install gem from GitHub source?

For example, if you use bundler, you can write in Gemfile

gem 'klout', :git => 'git://github.com/tyrbo/klout.git', :branch => 'hashie_fix'

to use alredy existing klout fork with a fix

Community
  • 1
  • 1
netoctone
  • 231
  • 2
  • 5
  • What if other gems have klout dependency? Is there any solution for all gems that have klout gem dependency. – Johnny Cash Jun 18 '14 at 10:43
  • If you cannot contribute to klout gem itself, the only 'clean' option is to create your own version of it, and your own version of each gem that uses it (recursively). You can also try some 'dirty' solution like – netoctone Jun 18 '14 at 11:26
  • require 'hashie'; Hashie::HashExtensions = Hashie::Extensions; require 'klout'; – netoctone Jun 18 '14 at 11:33