app_constants 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby-version +1 -0
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/app_constants.gemspec +4 -3
- data/lib/app_constants.rb +10 -2
- data/test/app_constants_spec.rb +12 -0
- metadata +33 -12
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3-p327
|
data/README.rdoc
CHANGED
@@ -108,4 +108,4 @@ Notice how I used embedded ruby code in the second constant. It works just fine:
|
|
108
108
|
|
109
109
|
== Copyright
|
110
110
|
|
111
|
-
Copyright (c) 2010-
|
111
|
+
Copyright (c) 2010-2013 {Leonardo Borges}[http://www.leonardoborges.com], released under the MIT license
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.5
|
data/app_constants.gemspec
CHANGED
@@ -5,17 +5,18 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "app_constants"
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Leonardo Borges"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2013-10-18"
|
13
13
|
s.description = "A clean and simple way to manage your application's per-environment constants"
|
14
14
|
s.email = "leonardoborges.rj@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"README.rdoc"
|
17
17
|
]
|
18
18
|
s.files = [
|
19
|
+
".ruby-version",
|
19
20
|
"Gemfile",
|
20
21
|
"Gemfile.lock",
|
21
22
|
"MIT-LICENSE",
|
@@ -42,7 +43,7 @@ Gem::Specification.new do |s|
|
|
42
43
|
s.homepage = "http://github.com/leonardoborges/app_constants"
|
43
44
|
s.licenses = ["MIT"]
|
44
45
|
s.require_paths = ["lib"]
|
45
|
-
s.rubygems_version = "1.8.
|
46
|
+
s.rubygems_version = "1.8.23"
|
46
47
|
s.summary = "A clean and simple way to manage your application's per-environment constants"
|
47
48
|
s.test_files = [
|
48
49
|
"test/app_constants_spec.rb",
|
data/lib/app_constants.rb
CHANGED
@@ -5,11 +5,19 @@ class AppConstants
|
|
5
5
|
@@config_path = Object.const_defined?(:Rails) ? "#{Rails.root}/config/constants.yml" : nil
|
6
6
|
@@environment = Object.const_defined?(:Rails) ? Rails.env : 'test'
|
7
7
|
@@raise_error_on_missing = false # if true this will raise an error if method you seek isn't in constants_hash
|
8
|
-
|
8
|
+
|
9
|
+
def self.config_path
|
10
|
+
@@config_path
|
11
|
+
end
|
12
|
+
|
9
13
|
def self.config_path=(path)
|
10
14
|
@@config_path = path
|
11
15
|
end
|
12
|
-
|
16
|
+
|
17
|
+
def self.environment
|
18
|
+
@@environment
|
19
|
+
end
|
20
|
+
|
13
21
|
def self.environment=(environment)
|
14
22
|
@@environment = environment
|
15
23
|
end
|
data/test/app_constants_spec.rb
CHANGED
@@ -64,6 +64,18 @@ describe "AppConstants" do
|
|
64
64
|
AppConstants.delayed_jobs.timeouts.default.should == 300
|
65
65
|
AppConstants.very.deep.nesting.level == true
|
66
66
|
end
|
67
|
+
|
68
|
+
it "should allow for inspection of config_path" do
|
69
|
+
expected_path = "#{File.dirname(__FILE__)}/fixtures/constants.yml"
|
70
|
+
AppConstants.config_path = expected_path
|
71
|
+
AppConstants.config_path.should == expected_path
|
72
|
+
end
|
73
|
+
|
74
|
+
it "should allow for inspection of environment" do
|
75
|
+
expected_env = "some-environment-#{rand(999)}"
|
76
|
+
AppConstants.environment = expected_env
|
77
|
+
AppConstants.environment.should == expected_env
|
78
|
+
end
|
67
79
|
|
68
80
|
describe "#load!" do
|
69
81
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_constants
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-10-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rspec
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: jeweler
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: rspec
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,7 +69,12 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :development
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
58
78
|
description: A clean and simple way to manage your application's per-environment constants
|
59
79
|
email: leonardoborges.rj@gmail.com
|
60
80
|
executables: []
|
@@ -62,6 +82,7 @@ extensions: []
|
|
62
82
|
extra_rdoc_files:
|
63
83
|
- README.rdoc
|
64
84
|
files:
|
85
|
+
- .ruby-version
|
65
86
|
- Gemfile
|
66
87
|
- Gemfile.lock
|
67
88
|
- MIT-LICENSE
|
@@ -99,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
120
|
version: '0'
|
100
121
|
segments:
|
101
122
|
- 0
|
102
|
-
hash:
|
123
|
+
hash: 4131386638665762542
|
103
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
125
|
none: false
|
105
126
|
requirements:
|
@@ -108,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
129
|
version: '0'
|
109
130
|
requirements: []
|
110
131
|
rubyforge_project:
|
111
|
-
rubygems_version: 1.8.
|
132
|
+
rubygems_version: 1.8.23
|
112
133
|
signing_key:
|
113
134
|
specification_version: 3
|
114
135
|
summary: A clean and simple way to manage your application's per-environment constants
|