This code is fixed in the class and located at Rails.root/config. The
Gem looks to that path and loads the YAML.
The question is: How allow the user to set what environment will be used
outside of Gem ?
--
Phillip Gawlowski
Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.
Well from the OP I take it he is running in Rails due to the reference
to Rails.root/config, and I think he's trying to emulate the kind of
thing used to differentiate on the RAILS_ENV environment value in
files like config/database.yml where the load produces a hash keyed on
the environment. So, assuming the gem always is used in a Rails
environment something like:
Rails.root returns a Pathname object, and Rails.env returns the value
of ENV['RAILS_ENV'] which was the old school way before The Rails
module got the env singleton method.
···
On Tue, Nov 9, 2010 at 12:20 PM, Phillip Gawlowski <cmdjackryan@googlemail.com> wrote:
On Tue, Nov 9, 2010 at 4:02 PM, Guilherme Mello <javaplayer@gmail.com> wrote:
Hi,
I'm creating a Gem and the code uses data from a YAML file: