English 中文(简体)
How to develop a gem in staging environment?
原标题:

I am trying to hack through a forked gem (buildr). As such I cloned it from github and began to butcher the code. The official gem is installed on my system (under /usr/lib/ruby.../gems/buildr...). There is an executable which I need to use in my dev process - buildr.

Now I want the buildr executable and the library to point to my forked repo and not the default gem installation. This would be for this gem only. As such, the changes I make against the forked repo is usable directly for testing and so forth.

I would guess I need to load my library prior to the system gem loading. Can somebody recommend the best way to do so?

问题回答

I did something similar for work when the Spreadsheet gem broke backward compatibility. I put the previous versions code in it s own module and just renamed the gem my-spreadsheet and installed that (I really wanted some of the features of the new gem but I also didn t want to rewrite all my previous code at that point).

If it s just a binary you want to override you could always do some PATH magic, setting the directory of your binary first and thus make sure you always override. But personally I d prefer making my own copy with a new name and installing that.

you could bump the version in the gemspec for your fork. Then when you install your version of the gem, it will use your (newer) version by default.

change buildr.gemspec

#...
  spec.version        =  1.3.4.dev 
#...

Then

$ gem build buildr.gemspec
$ sudo gem install buildr-1.3.4.dev.gem

and it should work.





相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签