[Rails] Re: Problems referencing code in bundled gems
On Friday, January 10, 2014 4:42:51 PM UTC, Ruby-Forum.com User wrote:
-- Hello,
I'm working on my first gem and I'm having a problem referencing
dependencies. In my gem, I need to reference code from some other
custom gems we've developed.
We'll call my Gem "test_company_models". In my test_company_models
gem, I need to include PricingExtensions from our test_company_libs Gem.
If you need PricingExtensions then you need to require the file that contains it. You could either do this only in the models that require it, or another pattern would be for your test_company_libs gem to have a test_company_libs.rb file which would require al the bits of that gem that are commonly used, so a person using the gem only has to do require 'test_company_libs' (and possibly not even that, since by default bundler would require that file for you)
Fred
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7d131ce7-768f-41d2-b901-1bdd0e064447%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home