settler 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWIzMzYxNTI2ZTE3NmNjOTlhZmZkZDEwMzU0Mzg4NjlmNDU1MTZkNg==
4
+ ODA5NmY2NDkxMGVjOWQ3Y2JiM2ZkZGI4Yzk5NWU5NWRjNGRiYTc2Yw==
5
5
  data.tar.gz: !binary |-
6
- ZmY5MGY5YTkzZjg4NDdmOWM5MjJlZWRkZTdkY2RlNmNiMDM3NDJhOA==
6
+ ZjZkNDYwMWMwOGFmNjg4MThiYmE5MDUwZThlYWNmNmQwMjgxYzI2Yw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MTM5YTU4NDE5N2ZlMThiY2MyODA5MGQ3M2UwNDliNDNlZWE1MDE1MGVhOGJj
10
- M2JlZDc1YTZkM2IzNGUyMTM3MzJiOGIzZDcxYzNlZWU2Y2FiY2MzN2ZhYTc5
11
- MzViNzZkMmVkMmRkYzUyNjJiNDUxZWRmZWQxNGUxY2RlNGU1M2Q=
9
+ Y2EwYTU1ZDAxYTgzYThiYzQyYWZlZTNmNzFhZDZlYjFlZDkzYjRhZDc1MmJm
10
+ Nzg5ZmU5NDUwOGEwOGE3MTJmMDQzNmQ4ZjgwNjIwMGI3MTY2MTQ5YTVhZTgy
11
+ ZWRjY2JjM2FhYzE0NzM3M2VlZTI5ZmIwNjE0NGQzMmIyNDhjNzY=
12
12
  data.tar.gz: !binary |-
13
- Mjc3NDA4MWZhMTBmMzAwNmQzODhlMjExYzkxMzQ4ZjU1ZmMwNjdhYTkxZjVi
14
- ZTA0NThiMDM2NzZkNGM2Mzg4NzNlODA3MjY2YzgzZDJlYzU2ZTg4Y2EwYThk
15
- OWU4YzU4OGJlZWIzZDIxY2RjYjVhY2VkMjhiYzAzOGU2NjU1ZGU=
13
+ MGYwMzE4MTk1ZjhlNjIxYzU4NGU4MmU1NDJkZDc4MjBlYzY4YTA5ZjIxYmVk
14
+ MzFkNDA1OGRkZTllY2RjYWE1ZDVmZGNlMjcxOTIyMzY5MTVmYzcwNzY4MGQ1
15
+ NjRiNWVkZTMxOTk2YzY2YzI0MzExMGFkN2E0NmZlZTNjYTY0NTU=
@@ -4,7 +4,7 @@ rvm:
4
4
  - 2.0.0
5
5
 
6
6
  gemfile:
7
- - gemfiles/3.0.gemfile
7
+ - gemfiles/3.1.gemfile
8
8
  - gemfiles/3.2.gemfile
9
9
  - gemfiles/4.0.gemfile
10
10
 
data/Appraisals CHANGED
@@ -1,15 +1,15 @@
1
- appraise '3.0' do
2
- gem 'activerecord', '~> 3.0'
3
- gem 'activesupport', '~> 3.0'
1
+ appraise '3.1' do
2
+ gem 'activerecord', '~> 3.1.0'
3
+ gem 'activesupport', '~> 3.1.0'
4
4
  end
5
5
 
6
6
  appraise '3.2' do
7
- gem 'activerecord', '~> 3.2'
8
- gem 'activesupport', '~> 3.2'
7
+ gem 'activerecord', '~> 3.2.0'
8
+ gem 'activesupport', '~> 3.2.0'
9
9
  end
10
10
 
11
11
  appraise '4.0' do
12
- gem 'activerecord', '~> 4.0'
13
- gem 'activesupport', '~> 4.0'
12
+ gem 'activerecord', '~> 4.0.0'
13
+ gem 'activesupport', '~> 4.0.0'
14
14
  end
15
15
 
data/Gemfile CHANGED
@@ -1,10 +1,14 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'activerecord', '>= 3.2'
4
- gem 'activesupport', '>= 3.2'
3
+ gem 'activerecord', '>= 3.1'
4
+ gem 'activesupport', '>= 3.1'
5
5
 
6
6
  gem 'appraisal', :group => :test
7
- gem 'jeweler', :group => :test
8
7
  gem 'sqlite3', :group => :test
8
+ gem 'rdoc', '>= 2.4.2', :group => :test
9
9
  # gem 'debugger', :group => :test
10
10
 
11
+ group :test do
12
+ gem 'jeweler'
13
+ end
14
+
@@ -74,8 +74,9 @@ PLATFORMS
74
74
  ruby
75
75
 
76
76
  DEPENDENCIES
77
- activerecord (>= 3.2)
78
- activesupport (>= 3.2)
77
+ activerecord (>= 3.1)
78
+ activesupport (>= 3.1)
79
79
  appraisal
80
80
  jeweler
81
+ rdoc (>= 2.4.2)
81
82
  sqlite3
@@ -7,7 +7,7 @@ Settler can be used for defining application wide settings in Rails. Settings ar
7
7
  == Requirements
8
8
 
9
9
  * Ruby >= 1.9 (tested with Rails 1.9.2, 1.9.3 and 2.0.0)
10
- * Activerecord >= 3.0 (tested with Rails 3.0, 3.2 and 4.0)
10
+ * Activerecord >= 3.1 (tested with Rails 3.1, 3.2 and 4.0)
11
11
 
12
12
  == Installation
13
13
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.0.1
@@ -3,8 +3,8 @@
3
3
  source "http://rubygems.org"
4
4
 
5
5
  gem "appraisal", :group=>:test
6
- gem "jeweler", :group=>:test
7
6
  gem "sqlite3", :group=>:test
8
- gem "activerecord", "~> 3.0"
9
- gem "activesupport", "~> 3.0"
7
+ gem "rdoc", ">= 2.4.2", :group=>:test
8
+ gem "activerecord", "~> 3.1.0"
9
+ gem "activesupport", "~> 3.1.0"
10
10
 
@@ -0,0 +1,37 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activemodel (3.1.12)
5
+ activesupport (= 3.1.12)
6
+ builder (~> 3.0.0)
7
+ i18n (~> 0.6)
8
+ activerecord (3.1.12)
9
+ activemodel (= 3.1.12)
10
+ activesupport (= 3.1.12)
11
+ arel (~> 2.2.3)
12
+ tzinfo (~> 0.3.29)
13
+ activesupport (3.1.12)
14
+ multi_json (~> 1.0)
15
+ appraisal (0.5.2)
16
+ bundler
17
+ rake
18
+ arel (2.2.3)
19
+ builder (3.0.4)
20
+ i18n (0.6.4)
21
+ json (1.8.0)
22
+ multi_json (1.7.9)
23
+ rake (10.1.0)
24
+ rdoc (4.0.1)
25
+ json (~> 1.4)
26
+ sqlite3 (1.3.7)
27
+ tzinfo (0.3.37)
28
+
29
+ PLATFORMS
30
+ ruby
31
+
32
+ DEPENDENCIES
33
+ activerecord (~> 3.1.0)
34
+ activesupport (~> 3.1.0)
35
+ appraisal
36
+ rdoc (>= 2.4.2)
37
+ sqlite3
@@ -3,8 +3,8 @@
3
3
  source "http://rubygems.org"
4
4
 
5
5
  gem "appraisal", :group=>:test
6
- gem "jeweler", :group=>:test
7
6
  gem "sqlite3", :group=>:test
8
- gem "activerecord", "~> 3.2"
9
- gem "activesupport", "~> 3.2"
7
+ gem "rdoc", ">= 2.4.2", :group=>:test
8
+ gem "activerecord", "~> 3.2.0"
9
+ gem "activesupport", "~> 3.2.0"
10
10
 
@@ -12,50 +12,14 @@ GEM
12
12
  activesupport (3.2.14)
13
13
  i18n (~> 0.6, >= 0.6.4)
14
14
  multi_json (~> 1.0)
15
- addressable (2.3.5)
16
15
  appraisal (0.5.2)
17
16
  bundler
18
17
  rake
19
18
  arel (3.0.2)
20
19
  builder (3.0.4)
21
- faraday (0.8.8)
22
- multipart-post (~> 1.2.0)
23
- git (1.2.5)
24
- github_api (0.10.1)
25
- addressable
26
- faraday (~> 0.8.1)
27
- hashie (>= 1.2)
28
- multi_json (~> 1.4)
29
- nokogiri (~> 1.5.2)
30
- oauth2
31
- hashie (2.0.5)
32
- highline (1.6.19)
33
- httpauth (0.2.0)
34
20
  i18n (0.6.4)
35
- jeweler (1.8.6)
36
- builder
37
- bundler (~> 1.0)
38
- git (>= 1.2.5)
39
- github_api (= 0.10.1)
40
- highline (>= 1.6.15)
41
- nokogiri (= 1.5.10)
42
- rake
43
- rdoc
44
21
  json (1.8.0)
45
- jwt (0.1.8)
46
- multi_json (>= 1.5)
47
- multi_json (1.7.8)
48
- multi_xml (0.5.5)
49
- multipart-post (1.2.0)
50
- nokogiri (1.5.10)
51
- oauth2 (0.9.2)
52
- faraday (~> 0.8)
53
- httpauth (~> 0.2)
54
- jwt (~> 0.1.4)
55
- multi_json (~> 1.0)
56
- multi_xml (~> 0.5)
57
- rack (~> 1.2)
58
- rack (1.5.2)
22
+ multi_json (1.7.9)
59
23
  rake (10.1.0)
60
24
  rdoc (4.0.1)
61
25
  json (~> 1.4)
@@ -66,8 +30,8 @@ PLATFORMS
66
30
  ruby
67
31
 
68
32
  DEPENDENCIES
69
- activerecord (~> 3.2)
70
- activesupport (~> 3.2)
33
+ activerecord (~> 3.2.0)
34
+ activesupport (~> 3.2.0)
71
35
  appraisal
72
- jeweler
36
+ rdoc (>= 2.4.2)
73
37
  sqlite3
@@ -3,8 +3,8 @@
3
3
  source "http://rubygems.org"
4
4
 
5
5
  gem "appraisal", :group=>:test
6
- gem "jeweler", :group=>:test
7
6
  gem "sqlite3", :group=>:test
8
- gem "activerecord", "~> 4.0"
9
- gem "activesupport", "~> 4.0"
7
+ gem "rdoc", ">= 2.4.2", :group=>:test
8
+ gem "activerecord", "~> 4.0.0"
9
+ gem "activesupport", "~> 4.0.0"
10
10
 
@@ -16,52 +16,16 @@ GEM
16
16
  multi_json (~> 1.3)
17
17
  thread_safe (~> 0.1)
18
18
  tzinfo (~> 0.3.37)
19
- addressable (2.3.5)
20
19
  appraisal (0.5.2)
21
20
  bundler
22
21
  rake
23
22
  arel (4.0.0)
24
23
  atomic (1.1.12)
25
24
  builder (3.1.4)
26
- faraday (0.8.8)
27
- multipart-post (~> 1.2.0)
28
- git (1.2.5)
29
- github_api (0.10.1)
30
- addressable
31
- faraday (~> 0.8.1)
32
- hashie (>= 1.2)
33
- multi_json (~> 1.4)
34
- nokogiri (~> 1.5.2)
35
- oauth2
36
- hashie (2.0.5)
37
- highline (1.6.19)
38
- httpauth (0.2.0)
39
25
  i18n (0.6.4)
40
- jeweler (1.8.6)
41
- builder
42
- bundler (~> 1.0)
43
- git (>= 1.2.5)
44
- github_api (= 0.10.1)
45
- highline (>= 1.6.15)
46
- nokogiri (= 1.5.10)
47
- rake
48
- rdoc
49
26
  json (1.8.0)
50
- jwt (0.1.8)
51
- multi_json (>= 1.5)
52
27
  minitest (4.7.5)
53
- multi_json (1.7.8)
54
- multi_xml (0.5.5)
55
- multipart-post (1.2.0)
56
- nokogiri (1.5.10)
57
- oauth2 (0.9.2)
58
- faraday (~> 0.8)
59
- httpauth (~> 0.2)
60
- jwt (~> 0.1.4)
61
- multi_json (~> 1.0)
62
- multi_xml (~> 0.5)
63
- rack (~> 1.2)
64
- rack (1.5.2)
28
+ multi_json (1.7.9)
65
29
  rake (10.1.0)
66
30
  rdoc (4.0.1)
67
31
  json (~> 1.4)
@@ -74,8 +38,8 @@ PLATFORMS
74
38
  ruby
75
39
 
76
40
  DEPENDENCIES
77
- activerecord (~> 4.0)
78
- activesupport (~> 4.0)
41
+ activerecord (~> 4.0.0)
42
+ activesupport (~> 4.0.0)
79
43
  appraisal
80
- jeweler
44
+ rdoc (>= 2.4.2)
81
45
  sqlite3
@@ -17,8 +17,9 @@ class Settler
17
17
 
18
18
  self.config = File.exist?(source) ? YAML.load(ERB.new(File.read(source)).result).to_hash : {}
19
19
  self.config = config[namespace] || {} if namespace
20
- self.config.each do |key, attributes|
21
- Setting.unscoped do
20
+
21
+ Setting.unscoped do
22
+ self.config.each do |key, attributes|
22
23
  setting = Setting.where(:key => key).first || Setting.create(:key => key) do |s|
23
24
  s.label = attributes['label']
24
25
  s.value = attributes['value']
@@ -26,8 +27,9 @@ class Settler
26
27
  s.deletable = attributes['deletable']
27
28
  end
28
29
  p "[Settler] Validation failed for setting '#{setting.key}': #{setting.errors.full_messages.to_sentence}" if !setting.valid?
29
- end
30
+ end
30
31
  end
32
+
31
33
  Setting.all.each{ |s| key = s.key; Settler.class.send(:define_method, key){ Setting.find_by_key(key) } }
32
34
  end
33
35
 
@@ -40,7 +42,7 @@ class Settler
40
42
  # Returns an array of all setting keys
41
43
  def settings(options = {})
42
44
  Settler.load! if config.nil?
43
- Setting.order(options[:order]).pluck(:key)
45
+ Setting.order(options[:order]).select(:key).map(&:key)
44
46
  end
45
47
 
46
48
  # Returns a list of validations to perform on a setting.
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "settler"
8
- s.version = "2.0.0"
8
+ s.version = "2.0.1"
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"]
@@ -27,8 +27,8 @@ Gem::Specification.new do |s|
27
27
  "README.rdoc",
28
28
  "Rakefile",
29
29
  "VERSION",
30
- "gemfiles/3.0.gemfile",
31
- "gemfiles/3.0.gemfile.lock",
30
+ "gemfiles/3.1.gemfile",
31
+ "gemfiles/3.1.gemfile.lock",
32
32
  "gemfiles/3.2.gemfile",
33
33
  "gemfiles/3.2.gemfile.lock",
34
34
  "gemfiles/4.0.gemfile",
@@ -58,15 +58,15 @@ Gem::Specification.new do |s|
58
58
  s.specification_version = 4
59
59
 
60
60
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
61
- s.add_runtime_dependency(%q<activerecord>, [">= 3.2"])
62
- s.add_runtime_dependency(%q<activesupport>, [">= 3.2"])
61
+ s.add_runtime_dependency(%q<activerecord>, [">= 3.1"])
62
+ s.add_runtime_dependency(%q<activesupport>, [">= 3.1"])
63
63
  else
64
- s.add_dependency(%q<activerecord>, [">= 3.2"])
65
- s.add_dependency(%q<activesupport>, [">= 3.2"])
64
+ s.add_dependency(%q<activerecord>, [">= 3.1"])
65
+ s.add_dependency(%q<activesupport>, [">= 3.1"])
66
66
  end
67
67
  else
68
- s.add_dependency(%q<activerecord>, [">= 3.2"])
69
- s.add_dependency(%q<activesupport>, [">= 3.2"])
68
+ s.add_dependency(%q<activerecord>, [">= 3.1"])
69
+ s.add_dependency(%q<activesupport>, [">= 3.1"])
70
70
  end
71
71
  end
72
72
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: settler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reinier de Lange
@@ -15,12 +15,12 @@ dependencies:
15
15
  requirements:
16
16
  - - ! '>='
17
17
  - !ruby/object:Gem::Version
18
- version: '3.2'
18
+ version: '3.1'
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
21
  - - ! '>='
22
22
  - !ruby/object:Gem::Version
23
- version: '3.2'
23
+ version: '3.1'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  name: activerecord
@@ -29,12 +29,12 @@ dependencies:
29
29
  requirements:
30
30
  - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
- version: '3.2'
32
+ version: '3.1'
33
33
  version_requirements: !ruby/object:Gem::Requirement
34
34
  requirements:
35
35
  - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
- version: '3.2'
37
+ version: '3.1'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  name: activesupport
@@ -59,8 +59,8 @@ files:
59
59
  - README.rdoc
60
60
  - Rakefile
61
61
  - VERSION
62
- - gemfiles/3.0.gemfile
63
- - gemfiles/3.0.gemfile.lock
62
+ - gemfiles/3.1.gemfile
63
+ - gemfiles/3.1.gemfile.lock
64
64
  - gemfiles/3.2.gemfile
65
65
  - gemfiles/3.2.gemfile.lock
66
66
  - gemfiles/4.0.gemfile
@@ -1,73 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- activemodel (3.2.14)
5
- activesupport (= 3.2.14)
6
- builder (~> 3.0.0)
7
- activerecord (3.2.14)
8
- activemodel (= 3.2.14)
9
- activesupport (= 3.2.14)
10
- arel (~> 3.0.2)
11
- tzinfo (~> 0.3.29)
12
- activesupport (3.2.14)
13
- i18n (~> 0.6, >= 0.6.4)
14
- multi_json (~> 1.0)
15
- addressable (2.3.5)
16
- appraisal (0.5.2)
17
- bundler
18
- rake
19
- arel (3.0.2)
20
- builder (3.0.4)
21
- faraday (0.8.8)
22
- multipart-post (~> 1.2.0)
23
- git (1.2.5)
24
- github_api (0.10.1)
25
- addressable
26
- faraday (~> 0.8.1)
27
- hashie (>= 1.2)
28
- multi_json (~> 1.4)
29
- nokogiri (~> 1.5.2)
30
- oauth2
31
- hashie (2.0.5)
32
- highline (1.6.19)
33
- httpauth (0.2.0)
34
- i18n (0.6.4)
35
- jeweler (1.8.6)
36
- builder
37
- bundler (~> 1.0)
38
- git (>= 1.2.5)
39
- github_api (= 0.10.1)
40
- highline (>= 1.6.15)
41
- nokogiri (= 1.5.10)
42
- rake
43
- rdoc
44
- json (1.8.0)
45
- jwt (0.1.8)
46
- multi_json (>= 1.5)
47
- multi_json (1.7.8)
48
- multi_xml (0.5.5)
49
- multipart-post (1.2.0)
50
- nokogiri (1.5.10)
51
- oauth2 (0.9.2)
52
- faraday (~> 0.8)
53
- httpauth (~> 0.2)
54
- jwt (~> 0.1.4)
55
- multi_json (~> 1.0)
56
- multi_xml (~> 0.5)
57
- rack (~> 1.2)
58
- rack (1.5.2)
59
- rake (10.1.0)
60
- rdoc (4.0.1)
61
- json (~> 1.4)
62
- sqlite3 (1.3.7)
63
- tzinfo (0.3.37)
64
-
65
- PLATFORMS
66
- ruby
67
-
68
- DEPENDENCIES
69
- activerecord (~> 3.0)
70
- activesupport (~> 3.0)
71
- appraisal
72
- jeweler
73
- sqlite3