This is a non-rails app, just a simple ruby script that uses rake etc. to automate some things.

My folder layout is this:

```
/scripts/Rakefile
/scripts/config/config.yml
/scripts/tasks/*.rake (various rake files with namespaces to organize them)
/scripts/lib/settings.rb

```

Now I want to create a Settings class that will load the config yaml file, and then expose properties/methods for the contents of the yaml file.

The yaml file has separate sections for development and production.

```
development:
    scripts_path: '/dev/mygit/app1/scripts/'
production:
    scripts_path: '/var/lib/app1/scripts/'

```

My rakefile so far looks like:

```
$LOAD_PATH.unshift File.expand_path('..', __FILE__)

#imports
require 'fileutils'
require 'rubygems'
require 'active_record'
require 'yaml'
require 'logger'

require 'ar/models'
require 'lib/app1'

env = ENV['ENV'] || 'development'
config = YAML::load(File.open('config/config.yml'))[env]

Dir.glob('tasks/*.rake').each { |r| import r }

```

I need help with the Settings.rb file, is this right?

```
module App1
  class Settings
    def initialize(config_path, env)
      config = YAML.load(File.open(config_path))
    end

    def scripts_path
    end

  end
end

```

How can I pass in the env, and then read the correct value from the config for each method like `scripts_path` etc?

Now suppose each \*.rake file needs to reference my Settings.rb file somehow (to get the config related information). How should I do this? Since my settings needs the path of the config.yml file, do I have to do this in each rake file?

**Update**
Sorry, this isn't a Rails app, just some ruby scripts.