lukeredpath-simpleconfig 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,4 @@ $LOAD_PATH << File.join(File.dirname(__FILE__), *%w[.. lib])
2
2
 
3
3
  require 'rails_compatibility'
4
4
  require 'simple_config'
5
- require 'controller_mixin'
5
+ require 'simple_config/controller_mixin'
@@ -10,10 +10,9 @@ namespace :simple_config do
10
10
  mkdir('config/settings')
11
11
  mkdir("config/initializers") unless File.exist?("config/initializers")
12
12
 
13
- Dir["config/environments/*.rb"].each do |f|
14
- env = File.basename(f, ".rb")
15
- touch("config/settings/#{env}.rb")
16
- end
13
+ environments = Dir["config/environments/*.rb"].map { |f| File.basename(f, ".rb") }
14
+ environments << 'application'
15
+ environments.each { |env| touch("config/settings/#{env}.rb") }
17
16
 
18
17
  cp(File.join(File.dirname(__FILE__), *%w[.. templates configuration.rb]),
19
18
  "config/initializers/configuration.rb")
@@ -1,8 +1,18 @@
1
1
  SimpleConfig.for :application do
2
-
3
- # your app configuration here
4
2
 
5
- load File.join(RAILS_ROOT, 'config', "settings", "#{RAILS_ENV}.rb"), :if_exists? => true
6
- load File.join(RAILS_ROOT, 'config', "settings", "local.rb"), :if_exists? => true
3
+ # Set here your global configuration.
4
+ # All settings can be overwritten later per-environment.
5
+ load File.join(RAILS_ROOT, 'config', "settings", "application.rb"), :if_exists? => true
6
+
7
+ # Per Environment settings.
8
+ # At startup only the file matching current environment will be loaded.
9
+ # Settings stored here will overwrite settings with the same name stored in application.rb
10
+ load File.join(RAILS_ROOT, 'config', "settings", "#{RAILS_ENV}.rb"), :if_exists? => true
11
+
12
+ # Local settings. It is designed as a place for you to override variables
13
+ # specific to your own development environment.
14
+ # Make sure your version control system ignores this file otherwise
15
+ # you risk checking in a file that will override values in production
16
+ load File.join(RAILS_ROOT, 'config', "settings", "local.rb"), :if_exists? => true
7
17
 
8
18
  end
@@ -1,7 +1,7 @@
1
1
  require File.join(File.dirname(__FILE__), *%w[test_helper])
2
2
 
3
3
  require 'simple_config'
4
- require 'controller_mixin'
4
+ require 'simple_config/controller_mixin'
5
5
 
6
6
  class RailsController
7
7
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lukeredpath-simpleconfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Redpath
@@ -9,12 +9,12 @@ autorequire: simple_config
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-05 00:00:00 -08:00
12
+ date: 2009-02-05 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
16
  description: Simple Config is a plugin designed to make application-wide configuration settings (e.g. in a Rails app) easy to set and access in an object-oriented fashion.
17
- email: contact@lukeredpath.co.uk
17
+ email: luke@lukeredpath.co.uk
18
18
  executables: []
19
19
 
20
20
  extensions: []
@@ -23,7 +23,7 @@ extra_rdoc_files: []
23
23
 
24
24
  files:
25
25
  - lib/simple_config.rb
26
- - lib/controller_mixin.rb
26
+ - lib/simple_config/controller_mixin.rb
27
27
  - lib/simple_config/utilities.rb
28
28
  - lib/rails_compatibility.rb
29
29
  - rails/init.rb