settingson 1.7.6 → 1.7.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f694dc0ae8fbd86f5c64e4c66844876c90ae607b
4
- data.tar.gz: 8732e4b92ec3ebab8c5c5fbf24a09921f9c2088f
2
+ SHA256:
3
+ metadata.gz: '029f4b7934884ec49504aa25070f056bd41c303cc4aa60e268f9874ef2135dbd'
4
+ data.tar.gz: 73c561c6fbd85eb06e4d65548228e0c287bfa801a58b7f3d28c9e25246639e7c
5
5
  SHA512:
6
- metadata.gz: a26fc3405ec03c65bd3c663b9de579975bb0a811d919ea4cec5e0dcb4cce990b339f96846d8165c5a30d3fcef019d44974b3554a0f69e866debbec8ec9eb6056
7
- data.tar.gz: 073b4eb59078be399ad906166008ed1f82d8264113f2e0acb02e15e5b15f69b377d8aabdb5cf55e82f12a2d0acd90636d1b689cda48c910ac574541dd95107ec
6
+ metadata.gz: f48a3d9ddee9b3c729b6c4ebf4301dbcef3913cf75d349510cd2555bf9d0699e2e18e5826c52cefc3242daac87c6d248c7debbdcad06e558e1b980eab6f279c8
7
+ data.tar.gz: 12df9a647182c640647ac6242021e18e6bd0a67fa7e393b737eb96a9d35a4fa1b93dcb8137912d1ded6af3a41298359ab9189e092c4668050e4a09c5828cc40e
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- Gemfile.lock
7
6
  InstalledFiles
8
7
  _yardoc
9
8
  coverage
@@ -27,3 +26,4 @@ spec/dummy/tmp/*
27
26
  !spec/dummy/tmp/cache
28
27
  spec/dummy/tmp/cache/*
29
28
  !spec/dummy/tmp/cache/.keep
29
+ Gemfile.lock
data/.travis.yml CHANGED
@@ -1,16 +1,22 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
 
3
4
  sudo: false
4
- cache: bundler
5
+ #cache: bundler
5
6
 
6
- script: bundle exec rspec
7
+ script: "bundle exec rspec && bundle exec codeclimate-test-reporter"
7
8
 
8
9
  rvm:
9
- - 2.2.2
10
+ - 2.2
11
+ - 2.3
12
+ - 2.4
13
+ - 2.6
10
14
 
11
15
  gemfile:
12
16
  - gemfiles/4.2.gemfile
13
17
  - gemfiles/5.0.gemfile
18
+ - gemfiles/5.1.gemfile
19
+ - gemfiles/5.2.gemfile
14
20
 
15
21
  env:
16
22
  - CODECLIMATE_REPO_TOKEN=620b22e287791de2c9f8a522182ddf57098302ff8958768f8192eaaa7d8a685d
data/Appraisals CHANGED
@@ -1,7 +1,15 @@
1
1
  appraise "4.2" do
2
- gem "rails", "~> 4.2.0"
2
+ gem "rails", "~> 4.2"
3
3
  end
4
4
 
5
5
  appraise "5.0" do
6
- gem "rails", "~> 5.0.0"
6
+ gem "rails", "~> 5.0"
7
+ end
8
+
9
+ appraise "5.1" do
10
+ gem "rails", "~> 5.1"
11
+ end
12
+
13
+ appraise "5.2" do
14
+ gem "rails", "~> 5.1"
7
15
  end
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  # Settingson
7
7
 
8
- Simple settings management for applications (Ruby on Rails 4 with ActiveRecord)
8
+ Simple settings management for applications (Ruby on Rails with ActiveRecord)
9
9
 
10
10
  ## Installation
11
11
 
@@ -36,7 +36,10 @@ Replace MODEL by the class name used for the applications settings, it's frequen
36
36
 
37
37
  Next, you'll usually run
38
38
  ```console
39
+ bin/rails db:migrate
40
+ # or
39
41
  rake db:migrate
42
+ # for rails 4 or less
40
43
  ```
41
44
  as the generator will have created a migration file (if your ORM supports them).
42
45
 
@@ -44,8 +47,8 @@ as the generator will have created a migration file (if your ORM supports them).
44
47
 
45
48
  shell commands:
46
49
  ```console
47
- rails g settingson Settings
48
- rake db:migrate
50
+ bin/rails g settingson Settings
51
+ bin/rails db:migrate
49
52
  ```
50
53
 
51
54
  code:
@@ -117,15 +120,31 @@ end
117
120
  ## The initial values
118
121
  in config/initializers/settingson.rb
119
122
  ```ruby
120
- Settings.defaults do |conf|
121
- conf.server.smtp.host = 'host'
122
- conf.server.smtp.port = 25
123
+ Settings.defaults do |default|
124
+ default.server.smtp.host = 'host'
125
+ default.server.smtp.port = 25
123
126
  end
124
127
 
125
128
  Settings.server.smtp.host # => 'host'
126
129
  Settings.server.smtp.port # => 25
127
130
  ```
128
131
 
132
+ ## Debug and testings
133
+ in config/initializers/settingson.rb
134
+ ```ruby
135
+
136
+ if Rails.env.development?
137
+ Settings.configure.debug = true
138
+ Settings.configure.trace = 3
139
+ Settings.configure.cache.enabled = false # default: true
140
+ end
141
+ ```
142
+ Caching is disabled by default only in test environment.
143
+
144
+ ## TODO:
145
+ * Skip key search when assignment requested
146
+
147
+
129
148
  ## Contributing
130
149
 
131
150
  1. Fork it ( https://github.com/daanforever/settingson/fork )
data/Rakefile CHANGED
@@ -1,3 +1,6 @@
1
- require "bundler/gem_tasks"
2
- require "appraisal"
1
+ #require "bundler/gem_tasks"
2
+ #require "appraisal"
3
3
  #require "rails/dummy/tasks"
4
+
5
+ require "rubygems"
6
+ require "bundler/setup"
@@ -19,15 +19,20 @@ module Settingson::Base
19
19
  @_settings
20
20
  end
21
21
 
22
- # Settings.defaults do |settings|
23
- # settings.server.host = 'host'
24
- # settings.server.port = 80
22
+ # Settings.defaults do |default|
23
+ # default.server.host = 'host'
24
+ # default.server.port = 80
25
25
  # end
26
26
  def defaults
27
- return unless block_given?
28
- Rails.application.config.after_initialize do
29
- yield Settingson::Store.new( klass: self, path: '__defaults' )
27
+ @__defaults = Settingson::Store::Default.new( klass: self )
28
+
29
+ if block_given?
30
+ Rails.application.config.after_initialize do
31
+ yield @__defaults
32
+ end
30
33
  end
34
+
35
+ @__defaults
31
36
  end
32
37
 
33
38
  # Settings.from_hash('smtp.host' => 'host')
@@ -53,7 +58,7 @@ module Settingson::Base
53
58
  def method_missing(symbol, *args)
54
59
  super
55
60
  rescue NameError, NoMethodError
56
- Settingson::Store.new(klass: self).send(symbol, *args)
61
+ Settingson::Store::General.new(klass: self).send(symbol, *args)
57
62
  end
58
63
 
59
64
  end # module ClassMethods
data/gemfiles/4.2.gemfile CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "codeclimate-test-reporter", :group => :test, :require => nil
6
- gem "rails", "~> 4.2.0"
5
+ gem "codeclimate-test-reporter", group: :test, require: nil
6
+ gem "rails", "~> 4.2"
7
7
 
8
- gemspec :path => "../"
8
+ gemspec path: "../"
@@ -1,149 +1,144 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- settingson (1.6.0)
4
+ settingson (1.7.10)
5
5
  rails (>= 4.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actionmailer (4.2.7.1)
11
- actionpack (= 4.2.7.1)
12
- actionview (= 4.2.7.1)
13
- activejob (= 4.2.7.1)
10
+ actionmailer (4.2.10)
11
+ actionpack (= 4.2.10)
12
+ actionview (= 4.2.10)
13
+ activejob (= 4.2.10)
14
14
  mail (~> 2.5, >= 2.5.4)
15
15
  rails-dom-testing (~> 1.0, >= 1.0.5)
16
- actionpack (4.2.7.1)
17
- actionview (= 4.2.7.1)
18
- activesupport (= 4.2.7.1)
16
+ actionpack (4.2.10)
17
+ actionview (= 4.2.10)
18
+ activesupport (= 4.2.10)
19
19
  rack (~> 1.6)
20
20
  rack-test (~> 0.6.2)
21
21
  rails-dom-testing (~> 1.0, >= 1.0.5)
22
22
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
- actionview (4.2.7.1)
24
- activesupport (= 4.2.7.1)
23
+ actionview (4.2.10)
24
+ activesupport (= 4.2.10)
25
25
  builder (~> 3.1)
26
26
  erubis (~> 2.7.0)
27
27
  rails-dom-testing (~> 1.0, >= 1.0.5)
28
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- activejob (4.2.7.1)
30
- activesupport (= 4.2.7.1)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
29
+ activejob (4.2.10)
30
+ activesupport (= 4.2.10)
31
31
  globalid (>= 0.3.0)
32
- activemodel (4.2.7.1)
33
- activesupport (= 4.2.7.1)
32
+ activemodel (4.2.10)
33
+ activesupport (= 4.2.10)
34
34
  builder (~> 3.1)
35
- activerecord (4.2.7.1)
36
- activemodel (= 4.2.7.1)
37
- activesupport (= 4.2.7.1)
35
+ activerecord (4.2.10)
36
+ activemodel (= 4.2.10)
37
+ activesupport (= 4.2.10)
38
38
  arel (~> 6.0)
39
- activesupport (4.2.7.1)
39
+ activesupport (4.2.10)
40
40
  i18n (~> 0.7)
41
- json (~> 1.7, >= 1.7.7)
42
41
  minitest (~> 5.1)
43
42
  thread_safe (~> 0.3, >= 0.3.4)
44
43
  tzinfo (~> 1.1)
45
- appraisal (2.1.0)
44
+ appraisal (2.2.0)
46
45
  bundler
47
46
  rake
48
47
  thor (>= 0.14.0)
49
- arel (6.0.3)
50
- builder (3.2.2)
51
- codeclimate-test-reporter (0.6.0)
52
- simplecov (>= 0.7.1, < 1.0.0)
53
- concurrent-ruby (1.0.2)
54
- database_cleaner (1.5.3)
55
- diff-lcs (1.2.5)
48
+ arel (6.0.4)
49
+ builder (3.2.3)
50
+ codeclimate-test-reporter (1.0.8)
51
+ simplecov (<= 0.13)
52
+ concurrent-ruby (1.0.5)
53
+ crass (1.0.3)
54
+ database_cleaner (1.6.2)
55
+ diff-lcs (1.3)
56
56
  docile (1.1.5)
57
57
  erubis (2.7.0)
58
- faker (1.6.6)
58
+ faker (1.8.4)
59
59
  i18n (~> 0.5)
60
- globalid (0.3.7)
61
- activesupport (>= 4.1.0)
62
- i18n (0.7.0)
63
- json (1.8.3)
64
- loofah (2.0.3)
60
+ globalid (0.4.1)
61
+ activesupport (>= 4.2.0)
62
+ i18n (0.9.1)
63
+ concurrent-ruby (~> 1.0)
64
+ json (2.1.0)
65
+ loofah (2.1.1)
66
+ crass (~> 1.0.2)
65
67
  nokogiri (>= 1.5.9)
66
- mail (2.6.4)
67
- mime-types (>= 1.16, < 4)
68
- mime-types (3.1)
69
- mime-types-data (~> 3.2015)
70
- mime-types-data (3.2016.0521)
71
- mini_portile2 (2.1.0)
72
- minitest (5.9.0)
73
- nokogiri (1.6.8)
74
- mini_portile2 (~> 2.1.0)
75
- pkg-config (~> 1.1.7)
76
- pkg-config (1.1.7)
77
- rack (1.6.4)
68
+ mail (2.7.0)
69
+ mini_mime (>= 0.1.1)
70
+ mini_mime (1.0.0)
71
+ mini_portile2 (2.3.0)
72
+ minitest (5.10.3)
73
+ nokogiri (1.8.1)
74
+ mini_portile2 (~> 2.3.0)
75
+ rack (1.6.8)
78
76
  rack-test (0.6.3)
79
77
  rack (>= 1.0)
80
- rails (4.2.7.1)
81
- actionmailer (= 4.2.7.1)
82
- actionpack (= 4.2.7.1)
83
- actionview (= 4.2.7.1)
84
- activejob (= 4.2.7.1)
85
- activemodel (= 4.2.7.1)
86
- activerecord (= 4.2.7.1)
87
- activesupport (= 4.2.7.1)
78
+ rails (4.2.10)
79
+ actionmailer (= 4.2.10)
80
+ actionpack (= 4.2.10)
81
+ actionview (= 4.2.10)
82
+ activejob (= 4.2.10)
83
+ activemodel (= 4.2.10)
84
+ activerecord (= 4.2.10)
85
+ activesupport (= 4.2.10)
88
86
  bundler (>= 1.3.0, < 2.0)
89
- railties (= 4.2.7.1)
87
+ railties (= 4.2.10)
90
88
  sprockets-rails
91
89
  rails-deprecated_sanitizer (1.0.3)
92
90
  activesupport (>= 4.2.0.alpha)
93
- rails-dom-testing (1.0.7)
91
+ rails-dom-testing (1.0.8)
94
92
  activesupport (>= 4.2.0.beta, < 5.0)
95
- nokogiri (~> 1.6.0)
93
+ nokogiri (~> 1.6)
96
94
  rails-deprecated_sanitizer (>= 1.0.1)
97
95
  rails-dummy (0.0.4)
98
96
  rails
99
97
  rails-html-sanitizer (1.0.3)
100
98
  loofah (~> 2.0)
101
- railties (4.2.7.1)
102
- actionpack (= 4.2.7.1)
103
- activesupport (= 4.2.7.1)
99
+ railties (4.2.10)
100
+ actionpack (= 4.2.10)
101
+ activesupport (= 4.2.10)
104
102
  rake (>= 0.8.7)
105
103
  thor (>= 0.18.1, < 2.0)
106
- rake (11.2.2)
107
- rspec (3.5.0)
108
- rspec-core (~> 3.5.0)
109
- rspec-expectations (~> 3.5.0)
110
- rspec-mocks (~> 3.5.0)
111
- rspec-core (3.5.3)
112
- rspec-support (~> 3.5.0)
113
- rspec-expectations (3.5.0)
104
+ rake (12.3.0)
105
+ rspec (3.7.0)
106
+ rspec-core (~> 3.7.0)
107
+ rspec-expectations (~> 3.7.0)
108
+ rspec-mocks (~> 3.7.0)
109
+ rspec-core (3.7.0)
110
+ rspec-support (~> 3.7.0)
111
+ rspec-expectations (3.7.0)
114
112
  diff-lcs (>= 1.2.0, < 2.0)
115
- rspec-support (~> 3.5.0)
116
- rspec-mocks (3.5.0)
113
+ rspec-support (~> 3.7.0)
114
+ rspec-mocks (3.7.0)
117
115
  diff-lcs (>= 1.2.0, < 2.0)
118
- rspec-support (~> 3.5.0)
119
- rspec-rails (3.5.2)
116
+ rspec-support (~> 3.7.0)
117
+ rspec-rails (3.7.2)
120
118
  actionpack (>= 3.0)
121
119
  activesupport (>= 3.0)
122
120
  railties (>= 3.0)
123
- rspec-core (~> 3.5.0)
124
- rspec-expectations (~> 3.5.0)
125
- rspec-mocks (~> 3.5.0)
126
- rspec-support (~> 3.5.0)
127
- rspec-support (3.5.0)
128
- simplecov (0.12.0)
121
+ rspec-core (~> 3.7.0)
122
+ rspec-expectations (~> 3.7.0)
123
+ rspec-mocks (~> 3.7.0)
124
+ rspec-support (~> 3.7.0)
125
+ rspec-support (3.7.0)
126
+ simplecov (0.13.0)
129
127
  docile (~> 1.1.0)
130
128
  json (>= 1.8, < 3)
131
129
  simplecov-html (~> 0.10.0)
132
- simplecov-html (0.10.0)
133
- spring (1.7.2)
134
- spring-commands-rspec (1.0.4)
135
- spring (>= 0.9.1)
136
- sprockets (3.7.0)
130
+ simplecov-html (0.10.2)
131
+ sprockets (3.7.1)
137
132
  concurrent-ruby (~> 1.0)
138
133
  rack (> 1, < 3)
139
- sprockets-rails (3.2.0)
134
+ sprockets-rails (3.2.1)
140
135
  actionpack (>= 4.0)
141
136
  activesupport (>= 4.0)
142
137
  sprockets (>= 3.0.0)
143
- sqlite3 (1.3.11)
144
- thor (0.19.1)
145
- thread_safe (0.3.5)
146
- tzinfo (1.2.2)
138
+ sqlite3 (1.3.13)
139
+ thor (0.20.0)
140
+ thread_safe (0.3.6)
141
+ tzinfo (1.2.4)
147
142
  thread_safe (~> 0.1)
148
143
 
149
144
  PLATFORMS
@@ -155,13 +150,12 @@ DEPENDENCIES
155
150
  codeclimate-test-reporter
156
151
  database_cleaner
157
152
  faker
158
- rails (~> 4.2.0)
153
+ rails (~> 4.2)
159
154
  rails-dummy
160
155
  rspec (~> 3.5)
161
156
  rspec-rails (~> 3.5)
162
157
  settingson!
163
- spring-commands-rspec
164
158
  sqlite3
165
159
 
166
160
  BUNDLED WITH
167
- 1.12.5
161
+ 1.16.6
data/gemfiles/5.0.gemfile CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "codeclimate-test-reporter", :group => :test, :require => nil
6
- gem "rails", "~> 5.0.0"
5
+ gem "codeclimate-test-reporter", group: :test, require: nil
6
+ gem "rails", "~> 5.0"
7
7
 
8
- gemspec :path => "../"
8
+ gemspec path: "../"