settler 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/lib/settler.rb +2 -1
- data/settler.gemspec +1 -2
- metadata +2 -3
- data/test/debug.log +0 -2925
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.3
|
data/lib/settler.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "yaml"
|
2
2
|
require "erb"
|
3
|
+
require "hash_extension"
|
3
4
|
|
4
5
|
# Settler loads and manages application wide settings and provides an interface for retrieving settings. The Settler
|
5
6
|
# object cannot be instantiated; all functionality is available on class level.
|
@@ -14,7 +15,7 @@ class Settler
|
|
14
15
|
raise "Source settler.yml not set. Please create one and set it by using Settler.source = <file>. When using Rails, please create a settler.yml file in the config directory." unless source
|
15
16
|
self.config = YAML.load(ERB.new(File.read(source)).result).to_hash
|
16
17
|
self.config = config[namespace] if namespace
|
17
|
-
self.config.each{ |key, attributes| Setting.without_default_scope { Setting.find_or_create_by_key(
|
18
|
+
self.config.each{ |key, attributes| Setting.without_default_scope { Setting.find_or_create_by_key(attributes.only(:alt, :value, :editable, :deletable).merge(:key => key)) } }
|
18
19
|
Setting.all.each{ |s| key = s.key; Settler.class.send(:define_method, key){ Setting.find_by_key(key) } }
|
19
20
|
end
|
20
21
|
|
data/settler.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{settler}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Reinier de Lange"]
|
@@ -32,7 +32,6 @@ Gem::Specification.new do |s|
|
|
32
32
|
"lib/settler.rb",
|
33
33
|
"settler.gemspec",
|
34
34
|
"test/database.yml",
|
35
|
-
"test/debug.log",
|
36
35
|
"test/helper.rb",
|
37
36
|
"test/schema.rb",
|
38
37
|
"test/settler.yml",
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 3
|
9
|
+
version: 1.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Reinier de Lange
|
@@ -43,7 +43,6 @@ files:
|
|
43
43
|
- lib/settler.rb
|
44
44
|
- settler.gemspec
|
45
45
|
- test/database.yml
|
46
|
-
- test/debug.log
|
47
46
|
- test/helper.rb
|
48
47
|
- test/schema.rb
|
49
48
|
- test/settler.yml
|