Re: making create "environmentally aware"
The create method is being called before anything I do in my test file though. Dave On Tue, Aug 24, 2010 at 11:27 AM, Magnus Holm wrote: > What about this: > > def App.create(env = (ENV['CAMPING_ENV'] || :development)) > end > > Then you can simply set ENV['CAMPING_ENV'] = "test" before loading any tests. > > // Magnus Holm > > > > On Tue, Aug 24, 2010 at 16:21, David Susco wrote: >> Ya, that's what I'm doing. Just wondering if there was another way to >> go about it. I modified your camping-test/base file to call 'create >> :test' and specified a test db adapter in my config file to get around >> the problem I e-mailed you about. >> >> Dave >> >> On Tue, Aug 24, 2010 at 9:44 AM, Magnus Holm wrote: >>> Why don't add this? >>> >>> def App.create(env = :development) >>> end >>> >>> And in production, you can call App.create(:production) yourself. >>> >>> // Magnus Holm >>> >>> >>> >>> On Tue, Aug 24, 2010 at 15:36, David Susco wrote: Not talking about having it recycle (I assume all Camping apps have a small carbon footprint). I'm talking about letting the create method know this is the dev/test/prod environment and have it load the appropriate database connection info etc. Any thoughts on this? Having create take an env arguments seems the simplest to me. -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list >>> ___ >>> Camping-list mailing list >>> Camping-list@rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >>> >> >> >> >> -- >> Dave >> ___ >> Camping-list mailing list >> Camping-list@rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > ___ > Camping-list mailing list > Camping-list@rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: making create "environmentally aware"
What about this: def App.create(env = (ENV['CAMPING_ENV'] || :development)) end Then you can simply set ENV['CAMPING_ENV'] = "test" before loading any tests. // Magnus Holm On Tue, Aug 24, 2010 at 16:21, David Susco wrote: > Ya, that's what I'm doing. Just wondering if there was another way to > go about it. I modified your camping-test/base file to call 'create > :test' and specified a test db adapter in my config file to get around > the problem I e-mailed you about. > > Dave > > On Tue, Aug 24, 2010 at 9:44 AM, Magnus Holm wrote: >> Why don't add this? >> >> def App.create(env = :development) >> end >> >> And in production, you can call App.create(:production) yourself. >> >> // Magnus Holm >> >> >> >> On Tue, Aug 24, 2010 at 15:36, David Susco wrote: >>> Not talking about having it recycle (I assume all Camping apps have a >>> small carbon footprint). >>> >>> I'm talking about letting the create method know this is the >>> dev/test/prod environment and have it load the appropriate database >>> connection info etc. >>> >>> Any thoughts on this? Having create take an env arguments seems the >>> simplest to me. >>> >>> -- >>> Dave >>> ___ >>> Camping-list mailing list >>> Camping-list@rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >>> >> ___ >> Camping-list mailing list >> Camping-list@rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > > > > -- > Dave > ___ > Camping-list mailing list > Camping-list@rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: making create "environmentally aware"
Ya, that's what I'm doing. Just wondering if there was another way to go about it. I modified your camping-test/base file to call 'create :test' and specified a test db adapter in my config file to get around the problem I e-mailed you about. Dave On Tue, Aug 24, 2010 at 9:44 AM, Magnus Holm wrote: > Why don't add this? > > def App.create(env = :development) > end > > And in production, you can call App.create(:production) yourself. > > // Magnus Holm > > > > On Tue, Aug 24, 2010 at 15:36, David Susco wrote: >> Not talking about having it recycle (I assume all Camping apps have a >> small carbon footprint). >> >> I'm talking about letting the create method know this is the >> dev/test/prod environment and have it load the appropriate database >> connection info etc. >> >> Any thoughts on this? Having create take an env arguments seems the >> simplest to me. >> >> -- >> Dave >> ___ >> Camping-list mailing list >> Camping-list@rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > ___ > Camping-list mailing list > Camping-list@rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: making create "environmentally aware"
Why don't add this? def App.create(env = :development) end And in production, you can call App.create(:production) yourself. // Magnus Holm On Tue, Aug 24, 2010 at 15:36, David Susco wrote: > Not talking about having it recycle (I assume all Camping apps have a > small carbon footprint). > > I'm talking about letting the create method know this is the > dev/test/prod environment and have it load the appropriate database > connection info etc. > > Any thoughts on this? Having create take an env arguments seems the > simplest to me. > > -- > Dave > ___ > Camping-list mailing list > Camping-list@rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
making create "environmentally aware"
Not talking about having it recycle (I assume all Camping apps have a small carbon footprint). I'm talking about letting the create method know this is the dev/test/prod environment and have it load the appropriate database connection info etc. Any thoughts on this? Having create take an env arguments seems the simplest to me. -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list