Comments on: Flexible application configuration in Ruby on Rails https://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/ In my blog I'll try to describe about interesting technologies, my discovery in IT and some useful things about programming. Tue, 08 Sep 2015 00:34:39 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: YAML and custom config for Rails projects » Usable Web Apps https://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/comment-page-1/#comment-241747 Tue, 30 Sep 2008 16:17:40 +0000 http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/#comment-241747 […] HT: Dmitro Shteflyuk […]

]]>
By: wwwaku » Blog Archive » Rails Code Reviewまとめ1 https://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/comment-page-1/#comment-240926 Sat, 27 Sep 2008 02:19:47 +0000 http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/#comment-240926 […] http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/ http://blog.bleything.net/2006/06/27/dry-out-your-database-yml […]

]]>
By: Steve C https://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/comment-page-1/#comment-221611 Fri, 11 Jul 2008 23:48:14 +0000 http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/#comment-221611 If you are getting errors when using this in your test environment you forgot to add “test:” to your .yml file

The example in this article had production and dev, but for some reason omits test

]]>
By: Barrett https://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/comment-page-1/#comment-158919 Fri, 29 Feb 2008 04:32:02 +0000 http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/#comment-158919 It works for my Rails 2.0.2 project:

1
2
3
4
5
# app-specific config
require 'ostruct'
require 'yaml'
config = OpenStruct.new(YAML.load_file("#{RAILS_ROOT}/config/chef.yml"))
::AppConfig = OpenStruct.new(config.send(RAILS_ENV))

Test:

1
2
3
  def test_test_base
    assert_not_nil AppConfig.test_base
  end

Passes. When I change it to assert_nil it fails, and I see that it was actually set.

]]>
By: Alex https://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/comment-page-1/#comment-155682 Thu, 21 Feb 2008 20:36:39 +0000 http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/#comment-155682 This code does’t work in ‘test’ environment (Rails 2.0.2).

Problem with:

1
env_config = config.send(RAILS_ENV)

It’s strange that config.test() work, but confg.send('test') not.
I don’t know why. Can anyone explain this behaivor?

]]>
By: link[rel=’developer’] » Application Configuration https://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/comment-page-1/#comment-138112 Mon, 07 Jan 2008 17:55:12 +0000 http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/#comment-138112 […] plugin which does exactly that, using YAML. It’s based on the technique described by Dmytro Shtefluk and uses OpenStruct to parse the config file and supports RAILS_ENV specific settings.Borrowing […]

]]>
By: Karel Minařík https://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/comment-page-1/#comment-107070 Sun, 07 Oct 2007 22:40:25 +0000 http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/#comment-107070 Hi Dmitry,

I have expanded your idea into a plugin: http://agilewebdevelopment.com/plugins/application_configuration

I have been using your setup with great pleasure in couple of last projects.

Many thanks!

Karel

]]>
By: Eugene https://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/comment-page-1/#comment-78732 Thu, 26 Jul 2007 08:29:13 +0000 http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/#comment-78732 Many thanks for the great idea. I’ve decided to go further and now config file is parsed with ERB, one can have another file to override the values in the main file (when you place config.yml to svn and need specific values in your working copy) and config values can not be overwritten in the application (by mistake). Please check it out.

]]>
By: Seven rails tips | www.neeraj.name https://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/comment-page-1/#comment-39158 Wed, 25 Apr 2007 01:34:25 +0000 http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/#comment-39158 […] solutions have been posted for handling application level config file but this solution is by far the best. It’s simple, DRY and works. Try it. You will love […]

]]>
By: PartyZan https://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/comment-page-1/#comment-16457 Thu, 25 Jan 2007 09:31:54 +0000 http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/#comment-16457 Да не за что, мне уже помогло :)

]]>