rails_settings 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -6,13 +6,16 @@ Simple settings for rails applications.
6
6
 
7
7
  gem 'app_settings'
8
8
 
9
- create settings-file `config/settings.yml`, for example:
9
+ create settings file <tt>config/settings.yml</tt>, for example:
10
10
 
11
+ # settings for all enviromnents
11
12
  global:
12
13
  host: superhost.com
13
14
  mail:
14
15
  to: danil@orionet.ru
15
16
  return_path: no-return@orionet.ru
17
+
18
+ # overwrite global settings for development
16
19
  development:
17
20
  host: localhost
18
21
 
@@ -26,8 +29,10 @@ create settings-file `config/settings.yml`, for example:
26
29
  # => 'localhost'
27
30
 
28
31
 
32
+ Yes, <tt>Settings</tt> is merged <tt>OpenStruct</tt>.
33
+
29
34
  == Contributing to rails_settings
30
-
35
+
31
36
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
32
37
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
33
38
  * Fork the project
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -6,9 +6,8 @@ module RailsSettings
6
6
  @settings
7
7
  end
8
8
 
9
- def self.load
9
+ def self.load_settings
10
10
  @raw_config = YAML.load(File.read("#{Rails.root}/config/settings.yml"))
11
- debugger
12
11
  @raw_settings = (@raw_config['global'] || {}).symbolize_keys.merge (@raw_config[Rails.env] || {}).symbolize_keys
13
12
  @settings = OpenStruct.new @raw_settings
14
13
 
@@ -16,4 +15,4 @@ module RailsSettings
16
15
  end
17
16
  end
18
17
 
19
- RailsSettings.load
18
+ require 'rails_settings/engine'
@@ -0,0 +1,7 @@
1
+ module RailsSettings
2
+ class Engine < Rails::Engine
3
+ initializer 'rails_settings.init', :before=>:load_environment_config do
4
+ RailsSettings.load_settings
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,60 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{rails_settings}
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Danil Pismenny"]
12
+ s.date = %q{2011-08-03}
13
+ s.description = %q{Simple settings for rails applications using config/settings.yml file}
14
+ s.email = %q{danil@orionet.ru}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ "Gemfile",
22
+ "Gemfile.lock",
23
+ "LICENSE.txt",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "lib/rails_settings.rb",
28
+ "lib/rails_settings/engine.rb",
29
+ "rails_settings.gemspec",
30
+ "test/helper.rb",
31
+ "test/test_rails_settings.rb"
32
+ ]
33
+ s.homepage = %q{http://github.com/dapi/rails_settings}
34
+ s.licenses = ["MIT"]
35
+ s.require_paths = ["lib"]
36
+ s.rubygems_version = %q{1.6.2}
37
+ s.summary = %q{Simple settings for rails applications}
38
+
39
+ if s.respond_to? :specification_version then
40
+ s.specification_version = 3
41
+
42
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
43
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
44
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
45
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
46
+ s.add_development_dependency(%q<rcov>, [">= 0"])
47
+ else
48
+ s.add_dependency(%q<shoulda>, [">= 0"])
49
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
50
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
51
+ s.add_dependency(%q<rcov>, [">= 0"])
52
+ end
53
+ else
54
+ s.add_dependency(%q<shoulda>, [">= 0"])
55
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
56
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
57
+ s.add_dependency(%q<rcov>, [">= 0"])
58
+ end
59
+ end
60
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: shoulda
17
- requirement: &2152611700 !ruby/object:Gem::Requirement
17
+ requirement: &2156670000 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *2152611700
25
+ version_requirements: *2156670000
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: bundler
28
- requirement: &2152610240 !ruby/object:Gem::Requirement
28
+ requirement: &2156668480 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.0.0
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2152610240
36
+ version_requirements: *2156668480
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: jeweler
39
- requirement: &2152609400 !ruby/object:Gem::Requirement
39
+ requirement: &2156666640 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.6.4
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2152609400
47
+ version_requirements: *2156666640
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rcov
50
- requirement: &2152608700 !ruby/object:Gem::Requirement
50
+ requirement: &2156665520 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *2152608700
58
+ version_requirements: *2156665520
59
59
  description: Simple settings for rails applications using config/settings.yml file
60
60
  email: danil@orionet.ru
61
61
  executables: []
@@ -72,6 +72,8 @@ files:
72
72
  - Rakefile
73
73
  - VERSION
74
74
  - lib/rails_settings.rb
75
+ - lib/rails_settings/engine.rb
76
+ - rails_settings.gemspec
75
77
  - test/helper.rb
76
78
  - test/test_rails_settings.rb
77
79
  has_rdoc: true
@@ -90,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
92
  version: '0'
91
93
  segments:
92
94
  - 0
93
- hash: -4324329922705490938
95
+ hash: 2389787294235466389
94
96
  required_rubygems_version: !ruby/object:Gem::Requirement
95
97
  none: false
96
98
  requirements: