fittings 2.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fittings.gemspec +2 -2
- data/lib/setting.rb +2 -11
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8a83abcea162ee3bbe64e45d8ae9aaaba7b3c8bc7b880ec1b2425126b4560da
|
4
|
+
data.tar.gz: 201965f0dad612ff9deb52086ab356715ebd176bad9ebe7da56243f94907cfb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40230ecfe3a3ea8a2fa32c7976158ca36aaf03dad0c3b84f31a2c20e9df0dfa74ee184eaf5739ec58952783fae0ff26ec4e1c9cc0fbcbcf697948383dab02510
|
7
|
+
data.tar.gz: bc6ee4da0fc3ff0975eef30f4888ba52f1620129241abe7ddd05da6138afc34ef1b561e8729ed679631cf4715822827b09051400a0fbb47e49300bfd5d3083fb
|
data/fittings.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "fittings"
|
3
|
-
s.version = "
|
3
|
+
s.version = "3.0.1"
|
4
4
|
|
5
5
|
s.authors = ["Edwin Cruz", "Colin Shield"]
|
6
6
|
s.date = %q{2011-09-06}
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.require_paths = ["lib"]
|
22
22
|
|
23
23
|
s.required_ruby_version = ">= 2.4.0"
|
24
|
-
s.add_dependency
|
24
|
+
s.add_dependency("hashie", ">= 4.0")
|
25
25
|
s.add_development_dependency "rspec"
|
26
26
|
s.add_development_dependency "rake"
|
27
27
|
s.add_development_dependency "rdoc"
|
data/lib/setting.rb
CHANGED
@@ -8,12 +8,6 @@ class Setting
|
|
8
8
|
class FileError < RuntimeError; end
|
9
9
|
class AlreadyLoaded < RuntimeError; end
|
10
10
|
|
11
|
-
class SettingHash < Hash
|
12
|
-
include Hashie::Extensions::IndifferentAccess
|
13
|
-
include Hashie::Extensions::KeyConversion
|
14
|
-
include Hashie::Extensions::DeepMerge
|
15
|
-
end
|
16
|
-
|
17
11
|
include Singleton
|
18
12
|
|
19
13
|
attr_reader :available_settings
|
@@ -88,7 +82,7 @@ class Setting
|
|
88
82
|
#=================================================================
|
89
83
|
|
90
84
|
def initialize
|
91
|
-
@available_settings ||=
|
85
|
+
@available_settings ||= Hashie::Mash.quiet(:default).new
|
92
86
|
end
|
93
87
|
|
94
88
|
def has_key?(key)
|
@@ -106,9 +100,6 @@ class Setting
|
|
106
100
|
end
|
107
101
|
|
108
102
|
v = @available_settings[name]
|
109
|
-
if v.is_a?(Hash)
|
110
|
-
v = SettingHash[v]
|
111
|
-
end
|
112
103
|
if block_given?
|
113
104
|
v = yield(v, args)
|
114
105
|
end
|
@@ -155,7 +146,7 @@ class Setting
|
|
155
146
|
|
156
147
|
def load(params)
|
157
148
|
# reset settings hash
|
158
|
-
@available_settings =
|
149
|
+
@available_settings = Hashie::Mash.quiet(:default).new
|
159
150
|
@loaded = false
|
160
151
|
|
161
152
|
files = []
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fittings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edwin Cruz
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '0'
|
20
|
+
version: '4.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '0'
|
27
|
+
version: '4.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rspec
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.2.33
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Manage settings per environment
|