setting_accessors 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.editorconfig +10 -0
- data/.rspec +1 -0
- data/.rubocop.yml +131 -0
- data/.travis.yml +11 -7
- data/Appraisals +17 -0
- data/CHANGELOG.md +38 -1
- data/Gemfile +2 -0
- data/README.md +64 -124
- data/Rakefile +5 -27
- data/bin/console +15 -0
- data/bin/setup +10 -0
- data/gemfiles/rails_4.1.gemfile +7 -0
- data/gemfiles/rails_4.2.gemfile +7 -0
- data/gemfiles/rails_4.2.gemfile.lock +162 -0
- data/gemfiles/rails_5.0.gemfile +7 -0
- data/gemfiles/rails_5.0.gemfile.lock +169 -0
- data/gemfiles/rails_5.1.gemfile +7 -0
- data/gemfiles/rails_5.1.gemfile.lock +169 -0
- data/gemfiles/rails_5.2.gemfile +7 -0
- data/gemfiles/rails_5.2.gemfile.lock +177 -0
- data/lib/generators/setting_accessors/install_generator.rb +11 -9
- data/lib/generators/setting_accessors/templates/model.rb.erb +0 -24
- data/lib/setting_accessors.rb +14 -5
- data/lib/setting_accessors/accessor_generator.rb +66 -0
- data/lib/setting_accessors/converters/base.rb +24 -0
- data/lib/setting_accessors/converters/boolean_converter.rb +51 -0
- data/lib/setting_accessors/converters/integer_converter.rb +21 -0
- data/lib/setting_accessors/converters/polymorphic_converter.rb +11 -0
- data/lib/setting_accessors/converters/string_converter.rb +11 -0
- data/lib/setting_accessors/helpers.rb +28 -0
- data/lib/setting_accessors/integration.rb +83 -97
- data/lib/setting_accessors/internal.rb +37 -64
- data/lib/setting_accessors/setting_scaffold.rb +147 -214
- data/lib/setting_accessors/setting_set.rb +168 -0
- data/lib/setting_accessors/version.rb +3 -1
- data/lib/tasks/setting_accessors_tasks.rake +2 -0
- data/setting_accessors.gemspec +27 -19
- metadata +117 -143
- data/.codeclimate.yml +0 -66
- data/lib/setting_accessors/accessor.rb +0 -189
- data/lib/setting_accessors/converter.rb +0 -71
- data/lib/setting_accessors/integration_validator.rb +0 -15
- data/lib/setting_accessors/validator.rb +0 -144
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/dummy/app/assets/stylesheets/application.css +0 -15
- data/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/mailers/.keep +0 -0
- data/test/dummy/app/models/.keep +0 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/models/post.rb +0 -2
- data/test/dummy/app/models/setting.rb +0 -59
- data/test/dummy/app/models/user.rb +0 -19
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/bin/bundle +0 -3
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -25
- data/test/dummy/config/boot.rb +0 -5
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -37
- data/test/dummy/config/environments/production.rb +0 -83
- data/test/dummy/config/environments/test.rb +0 -34
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/mime_types.rb +0 -4
- data/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/dummy/config/initializers/setting_accessors.rb +0 -1
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -23
- data/test/dummy/config/routes.rb +0 -56
- data/test/dummy/config/secrets.yml +0 -22
- data/test/dummy/config/settings.yml +0 -23
- data/test/dummy/db/migrate/20150102112106_create_users.rb +0 -9
- data/test/dummy/db/migrate/20150102115329_create_settings.rb +0 -12
- data/test/dummy/db/migrate/20150723114600_create_posts.rb +0 -11
- data/test/dummy/db/schema.rb +0 -40
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/public/404.html +0 -67
- data/test/dummy/public/422.html +0 -67
- data/test/dummy/public/500.html +0 -66
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/test/fixtures/posts.yml +0 -11
- data/test/dummy/test/models/post_test.rb +0 -19
- data/test/dummy/test/models/setting_test.rb +0 -143
- data/test/dummy/test/models/user_test.rb +0 -154
- data/test/generators/install_generator_test.rb +0 -15
- data/test/setting_accessors_test.rb +0 -4
- data/test/test_helper.rb +0 -31
@@ -0,0 +1,168 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Helper class to make accessing record specific settings easier
|
5
|
+
#
|
6
|
+
module SettingAccessors
|
7
|
+
class SettingSet
|
8
|
+
include ::SettingAccessors::Helpers
|
9
|
+
|
10
|
+
attr_reader :record
|
11
|
+
|
12
|
+
def initialize(record)
|
13
|
+
@record = record
|
14
|
+
@temp_settings = {}
|
15
|
+
end
|
16
|
+
|
17
|
+
#
|
18
|
+
# Tries to retrieve the given setting's value from the temp settings
|
19
|
+
# (already read/written values in this instance). If the setting hasn't been
|
20
|
+
# used before, its value is retrieved from the database.
|
21
|
+
#
|
22
|
+
# If a setting hasn't been read by this record (instance) before, its value
|
23
|
+
# is stored in the local read set.
|
24
|
+
#
|
25
|
+
# TODO: See if this causes problems with read settings not being updated by external changes.
|
26
|
+
# User1: Read Setting X
|
27
|
+
# User2: Update Setting X
|
28
|
+
# User1: Read Setting X -> Gets old value from temp settings.
|
29
|
+
# This shouldn't be too dangerous as the system state will be refreshed with every request though.
|
30
|
+
#
|
31
|
+
# @param [Boolean] skip_cached
|
32
|
+
# If set to +true+, the setting value is freshly loaded from the database,
|
33
|
+
# even if a value that's not yet persisted exists.
|
34
|
+
#
|
35
|
+
def get(key, skip_cached: false)
|
36
|
+
return @temp_settings[key.to_sym] if !skip_cached && key?(key)
|
37
|
+
|
38
|
+
value = SettingAccessors.setting_class.get(key, record)
|
39
|
+
@temp_settings[key.to_sym] = value unless value.nil?
|
40
|
+
value
|
41
|
+
end
|
42
|
+
|
43
|
+
alias [] get
|
44
|
+
|
45
|
+
def key?(key)
|
46
|
+
@temp_settings.key?(key.to_sym)
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# Writes a setting's value
|
51
|
+
#
|
52
|
+
def set(key, val)
|
53
|
+
track_old_value(key)
|
54
|
+
set_value_before_type_cast(key, val)
|
55
|
+
@temp_settings[key.to_sym] = SettingAccessors::Internal.converter(value_type(key)).new(val).convert
|
56
|
+
end
|
57
|
+
|
58
|
+
alias []= set
|
59
|
+
|
60
|
+
#
|
61
|
+
# Tries to find a setting for this record.
|
62
|
+
# If none is found, will return the default setting value
|
63
|
+
# specified in the setting accessor call
|
64
|
+
#
|
65
|
+
# @param [Boolean] store_default
|
66
|
+
# If set to +true+, the setting's default value is written to the temporary settings
|
67
|
+
# for faster access. Otherwise, a database lookup is performed every time.
|
68
|
+
#
|
69
|
+
# @param [Boolean] skip_cached
|
70
|
+
# If set to +true+, a possible temporary setting is skipped when looking up the value.
|
71
|
+
# This means, the default value is returned even if there is a not yet persisted change to the setting.
|
72
|
+
#
|
73
|
+
def get_or_default(key, store_default: true, skip_cached: false)
|
74
|
+
result = get(key, skip_cached: skip_cached)
|
75
|
+
return result if result || (key?(key) && !skip_cached)
|
76
|
+
|
77
|
+
try_dup(SettingAccessors.setting_class.get_or_default(key, record)).tap do |value|
|
78
|
+
set(key, value) if store_default
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
#
|
83
|
+
# @return [String] the setting's value type in the +record+'s context
|
84
|
+
#
|
85
|
+
def value_type(key)
|
86
|
+
SettingAccessors::Internal.setting_value_type(key, record)
|
87
|
+
end
|
88
|
+
|
89
|
+
#----------------------------------------------------------------
|
90
|
+
# ActiveRecord Helper Methods Emulation
|
91
|
+
#----------------------------------------------------------------
|
92
|
+
|
93
|
+
#
|
94
|
+
# @return [Object] the value the given setting had after it was last persisted
|
95
|
+
#
|
96
|
+
def value_was(key)
|
97
|
+
lookup_nested_hash(@old_values, key.to_s)
|
98
|
+
rescue NestedHashKeyNotFoundException
|
99
|
+
get(key)
|
100
|
+
end
|
101
|
+
|
102
|
+
def value_changed?(key)
|
103
|
+
get(key) != value_was(key)
|
104
|
+
end
|
105
|
+
|
106
|
+
def value_before_type_cast(key)
|
107
|
+
lookup_nested_hash(@values_before_type_casts, key.to_s)
|
108
|
+
rescue NestedHashKeyNotFoundException
|
109
|
+
get(key)
|
110
|
+
end
|
111
|
+
|
112
|
+
def changed_settings
|
113
|
+
@temp_settings.select { |k, _| value_changed?(k) }
|
114
|
+
end
|
115
|
+
|
116
|
+
protected
|
117
|
+
|
118
|
+
#
|
119
|
+
# Keeps a record of the originally set value for a setting before it was
|
120
|
+
# automatically converted.
|
121
|
+
#
|
122
|
+
def set_value_before_type_cast(key, value)
|
123
|
+
@values_before_type_casts ||= {}
|
124
|
+
@values_before_type_casts[key.to_s] = value
|
125
|
+
end
|
126
|
+
|
127
|
+
#
|
128
|
+
# Keeps a local copy of a setting's value before it was overridden.
|
129
|
+
# Once the setting is persisted, this value is cleared.
|
130
|
+
#
|
131
|
+
def track_old_value(key)
|
132
|
+
@old_values ||= {}
|
133
|
+
|
134
|
+
unless @old_values.key?(key.to_s)
|
135
|
+
@old_values[key.to_s] = get_or_default(key, skip_cached: true, store_default: false)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
#
|
140
|
+
# @return [Object] the duplicated value if it is in fact duplicable. The actual value otherwise
|
141
|
+
#
|
142
|
+
def try_dup(value)
|
143
|
+
value.duplicable? ? value.dup : value
|
144
|
+
end
|
145
|
+
|
146
|
+
#
|
147
|
+
# Saves the new setting values into the database
|
148
|
+
# Please note that there is no check if the values changed their
|
149
|
+
# in the meantime.
|
150
|
+
#
|
151
|
+
# Also, this method expects that the settings were validated
|
152
|
+
# before using #validate! and will therefore not perform
|
153
|
+
# validations itself.
|
154
|
+
#
|
155
|
+
def persist!
|
156
|
+
@temp_settings.each do |key, value|
|
157
|
+
Setting.set(key, value, assignable: record)
|
158
|
+
end
|
159
|
+
flush!
|
160
|
+
end
|
161
|
+
|
162
|
+
def flush!
|
163
|
+
@temp_settings = {}
|
164
|
+
@values_before_type_casts = {}
|
165
|
+
@old_values = {}
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
data/setting_accessors.gemspec
CHANGED
@@ -1,32 +1,40 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'setting_accessors/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
8
|
spec.name = 'setting_accessors'
|
8
9
|
spec.version = SettingAccessors::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
13
|
-
|
10
|
+
spec.authors = ['Stefan Exner']
|
11
|
+
spec.email = ['stex@sterex.de']
|
12
|
+
spec.summary = 'A global key-value-store and virtual model columns'
|
13
|
+
spec.description = 'Adds a global key-value-store to Rails applications and allows adding typed columns
|
14
|
+
to model classes without having to change the database layout.'
|
14
15
|
spec.homepage = 'https://www.github.com/stex/setting_accessors'
|
15
|
-
spec.license =
|
16
|
+
spec.license = 'MIT'
|
17
|
+
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
+
f.match(%r{^(test|spec|features)/})
|
20
|
+
end
|
16
21
|
|
17
|
-
spec.
|
18
|
-
spec.executables = spec.files.grep(%r{^
|
19
|
-
spec.
|
20
|
-
spec.require_paths = ["lib"]
|
22
|
+
spec.bindir = 'exe'
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ['lib']
|
21
25
|
|
22
|
-
spec.required_ruby_version = ['>= 2.
|
26
|
+
spec.required_ruby_version = ['>= 2.3', '< 3']
|
23
27
|
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
28
|
+
spec.add_development_dependency 'appraisal', '~> 2.2'
|
29
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
30
|
+
spec.add_development_dependency 'generator_spec', '~> 0.9'
|
31
|
+
spec.add_development_dependency 'rake', '~> 10.4'
|
32
|
+
spec.add_development_dependency 'rspec', '~> 3.8'
|
33
|
+
spec.add_development_dependency 'rubocop', '~> 0.60'
|
26
34
|
spec.add_development_dependency 'sqlite3', '~> 1.3'
|
27
|
-
spec.add_development_dependency '
|
28
|
-
spec.add_development_dependency 'minitest', '~> 5.5'
|
29
|
-
spec.add_development_dependency 'byebug', '~> 3.5'
|
35
|
+
spec.add_development_dependency 'with_model', '~> 2.1'
|
30
36
|
|
31
|
-
spec.add_dependency '
|
37
|
+
spec.add_dependency 'activemodel', ['>= 4.2', '<= 5.2']
|
38
|
+
spec.add_dependency 'activerecord', ['>= 4.2', '<= 5.2']
|
39
|
+
spec.add_dependency 'activesupport', ['>= 4.2', '<= 5.2']
|
32
40
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: setting_accessors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Exner
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: appraisal
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.2'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.2'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -24,6 +38,20 @@ dependencies:
|
|
24
38
|
- - "~>"
|
25
39
|
- !ruby/object:Gem::Version
|
26
40
|
version: '1.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: generator_spec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.9'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.9'
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
56
|
name: rake
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,169 +67,171 @@ dependencies:
|
|
39
67
|
- !ruby/object:Gem::Version
|
40
68
|
version: '10.4'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
70
|
+
name: rspec
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
44
72
|
requirements:
|
45
73
|
- - "~>"
|
46
74
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
75
|
+
version: '3.8'
|
48
76
|
type: :development
|
49
77
|
prerelease: false
|
50
78
|
version_requirements: !ruby/object:Gem::Requirement
|
51
79
|
requirements:
|
52
80
|
- - "~>"
|
53
81
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
82
|
+
version: '3.8'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
84
|
+
name: rubocop
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
58
86
|
requirements:
|
59
87
|
- - "~>"
|
60
88
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
89
|
+
version: '0.60'
|
62
90
|
type: :development
|
63
91
|
prerelease: false
|
64
92
|
version_requirements: !ruby/object:Gem::Requirement
|
65
93
|
requirements:
|
66
94
|
- - "~>"
|
67
95
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
96
|
+
version: '0.60'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
98
|
+
name: sqlite3
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
72
100
|
requirements:
|
73
101
|
- - "~>"
|
74
102
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
103
|
+
version: '1.3'
|
76
104
|
type: :development
|
77
105
|
prerelease: false
|
78
106
|
version_requirements: !ruby/object:Gem::Requirement
|
79
107
|
requirements:
|
80
108
|
- - "~>"
|
81
109
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
110
|
+
version: '1.3'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
112
|
+
name: with_model
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
86
114
|
requirements:
|
87
115
|
- - "~>"
|
88
116
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
117
|
+
version: '2.1'
|
90
118
|
type: :development
|
91
119
|
prerelease: false
|
92
120
|
version_requirements: !ruby/object:Gem::Requirement
|
93
121
|
requirements:
|
94
122
|
- - "~>"
|
95
123
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
124
|
+
version: '2.1'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: activemodel
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '4.2'
|
132
|
+
- - "<="
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '5.2'
|
135
|
+
type: :runtime
|
136
|
+
prerelease: false
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
requirements:
|
139
|
+
- - ">="
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '4.2'
|
142
|
+
- - "<="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '5.2'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: activerecord
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '4.2'
|
152
|
+
- - "<="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '5.2'
|
155
|
+
type: :runtime
|
156
|
+
prerelease: false
|
157
|
+
version_requirements: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '4.2'
|
162
|
+
- - "<="
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '5.2'
|
97
165
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
166
|
+
name: activesupport
|
99
167
|
requirement: !ruby/object:Gem::Requirement
|
100
168
|
requirements:
|
101
169
|
- - ">="
|
102
170
|
- !ruby/object:Gem::Version
|
103
|
-
version: '4.
|
104
|
-
- - "
|
171
|
+
version: '4.2'
|
172
|
+
- - "<="
|
105
173
|
- !ruby/object:Gem::Version
|
106
|
-
version: '5.
|
174
|
+
version: '5.2'
|
107
175
|
type: :runtime
|
108
176
|
prerelease: false
|
109
177
|
version_requirements: !ruby/object:Gem::Requirement
|
110
178
|
requirements:
|
111
179
|
- - ">="
|
112
180
|
- !ruby/object:Gem::Version
|
113
|
-
version: '4.
|
114
|
-
- - "
|
181
|
+
version: '4.2'
|
182
|
+
- - "<="
|
115
183
|
- !ruby/object:Gem::Version
|
116
|
-
version: '5.
|
184
|
+
version: '5.2'
|
117
185
|
description: |-
|
118
186
|
Adds a global key-value-store to Rails applications and allows adding typed columns
|
119
|
-
|
187
|
+
to model classes without having to change the database layout.
|
120
188
|
email:
|
121
189
|
- stex@sterex.de
|
122
190
|
executables: []
|
123
191
|
extensions: []
|
124
192
|
extra_rdoc_files: []
|
125
193
|
files:
|
126
|
-
- ".
|
194
|
+
- ".editorconfig"
|
127
195
|
- ".gitignore"
|
196
|
+
- ".rspec"
|
197
|
+
- ".rubocop.yml"
|
128
198
|
- ".travis.yml"
|
199
|
+
- Appraisals
|
129
200
|
- CHANGELOG.md
|
130
201
|
- Gemfile
|
131
202
|
- LICENSE.txt
|
132
203
|
- README.md
|
133
204
|
- Rakefile
|
205
|
+
- bin/console
|
206
|
+
- bin/setup
|
207
|
+
- gemfiles/rails_4.1.gemfile
|
208
|
+
- gemfiles/rails_4.2.gemfile
|
209
|
+
- gemfiles/rails_4.2.gemfile.lock
|
210
|
+
- gemfiles/rails_5.0.gemfile
|
211
|
+
- gemfiles/rails_5.0.gemfile.lock
|
212
|
+
- gemfiles/rails_5.1.gemfile
|
213
|
+
- gemfiles/rails_5.1.gemfile.lock
|
214
|
+
- gemfiles/rails_5.2.gemfile
|
215
|
+
- gemfiles/rails_5.2.gemfile.lock
|
134
216
|
- lib/generators/setting_accessors/install_generator.rb
|
135
217
|
- lib/generators/setting_accessors/templates/migration.rb.erb
|
136
218
|
- lib/generators/setting_accessors/templates/model.rb.erb
|
137
219
|
- lib/generators/setting_accessors/templates/settings.yml
|
138
220
|
- lib/setting_accessors.rb
|
139
|
-
- lib/setting_accessors/
|
140
|
-
- lib/setting_accessors/
|
221
|
+
- lib/setting_accessors/accessor_generator.rb
|
222
|
+
- lib/setting_accessors/converters/base.rb
|
223
|
+
- lib/setting_accessors/converters/boolean_converter.rb
|
224
|
+
- lib/setting_accessors/converters/integer_converter.rb
|
225
|
+
- lib/setting_accessors/converters/polymorphic_converter.rb
|
226
|
+
- lib/setting_accessors/converters/string_converter.rb
|
227
|
+
- lib/setting_accessors/helpers.rb
|
141
228
|
- lib/setting_accessors/integration.rb
|
142
|
-
- lib/setting_accessors/integration_validator.rb
|
143
229
|
- lib/setting_accessors/internal.rb
|
144
230
|
- lib/setting_accessors/setting_scaffold.rb
|
145
|
-
- lib/setting_accessors/
|
231
|
+
- lib/setting_accessors/setting_set.rb
|
146
232
|
- lib/setting_accessors/version.rb
|
147
233
|
- lib/tasks/setting_accessors_tasks.rake
|
148
234
|
- setting_accessors.gemspec
|
149
|
-
- test/dummy/README.rdoc
|
150
|
-
- test/dummy/Rakefile
|
151
|
-
- test/dummy/app/assets/images/.keep
|
152
|
-
- test/dummy/app/assets/javascripts/application.js
|
153
|
-
- test/dummy/app/assets/stylesheets/application.css
|
154
|
-
- test/dummy/app/controllers/application_controller.rb
|
155
|
-
- test/dummy/app/controllers/concerns/.keep
|
156
|
-
- test/dummy/app/helpers/application_helper.rb
|
157
|
-
- test/dummy/app/mailers/.keep
|
158
|
-
- test/dummy/app/models/.keep
|
159
|
-
- test/dummy/app/models/concerns/.keep
|
160
|
-
- test/dummy/app/models/post.rb
|
161
|
-
- test/dummy/app/models/setting.rb
|
162
|
-
- test/dummy/app/models/user.rb
|
163
|
-
- test/dummy/app/views/layouts/application.html.erb
|
164
|
-
- test/dummy/bin/bundle
|
165
|
-
- test/dummy/bin/rails
|
166
|
-
- test/dummy/bin/rake
|
167
|
-
- test/dummy/config.ru
|
168
|
-
- test/dummy/config/application.rb
|
169
|
-
- test/dummy/config/boot.rb
|
170
|
-
- test/dummy/config/database.yml
|
171
|
-
- test/dummy/config/environment.rb
|
172
|
-
- test/dummy/config/environments/development.rb
|
173
|
-
- test/dummy/config/environments/production.rb
|
174
|
-
- test/dummy/config/environments/test.rb
|
175
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
176
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
177
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
178
|
-
- test/dummy/config/initializers/inflections.rb
|
179
|
-
- test/dummy/config/initializers/mime_types.rb
|
180
|
-
- test/dummy/config/initializers/session_store.rb
|
181
|
-
- test/dummy/config/initializers/setting_accessors.rb
|
182
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
183
|
-
- test/dummy/config/locales/en.yml
|
184
|
-
- test/dummy/config/routes.rb
|
185
|
-
- test/dummy/config/secrets.yml
|
186
|
-
- test/dummy/config/settings.yml
|
187
|
-
- test/dummy/db/migrate/20150102112106_create_users.rb
|
188
|
-
- test/dummy/db/migrate/20150102115329_create_settings.rb
|
189
|
-
- test/dummy/db/migrate/20150723114600_create_posts.rb
|
190
|
-
- test/dummy/db/schema.rb
|
191
|
-
- test/dummy/db/test.sqlite3
|
192
|
-
- test/dummy/lib/assets/.keep
|
193
|
-
- test/dummy/log/.keep
|
194
|
-
- test/dummy/public/404.html
|
195
|
-
- test/dummy/public/422.html
|
196
|
-
- test/dummy/public/500.html
|
197
|
-
- test/dummy/public/favicon.ico
|
198
|
-
- test/dummy/test/fixtures/posts.yml
|
199
|
-
- test/dummy/test/models/post_test.rb
|
200
|
-
- test/dummy/test/models/setting_test.rb
|
201
|
-
- test/dummy/test/models/user_test.rb
|
202
|
-
- test/generators/install_generator_test.rb
|
203
|
-
- test/setting_accessors_test.rb
|
204
|
-
- test/test_helper.rb
|
205
235
|
homepage: https://www.github.com/stex/setting_accessors
|
206
236
|
licenses:
|
207
237
|
- MIT
|
@@ -214,7 +244,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
214
244
|
requirements:
|
215
245
|
- - ">="
|
216
246
|
- !ruby/object:Gem::Version
|
217
|
-
version: 2.
|
247
|
+
version: '2.3'
|
218
248
|
- - "<"
|
219
249
|
- !ruby/object:Gem::Version
|
220
250
|
version: '3'
|
@@ -225,64 +255,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
255
|
version: '0'
|
226
256
|
requirements: []
|
227
257
|
rubyforge_project:
|
228
|
-
rubygems_version: 2.
|
258
|
+
rubygems_version: 2.7.3
|
229
259
|
signing_key:
|
230
260
|
specification_version: 4
|
231
261
|
summary: A global key-value-store and virtual model columns
|
232
|
-
test_files:
|
233
|
-
- test/dummy/README.rdoc
|
234
|
-
- test/dummy/Rakefile
|
235
|
-
- test/dummy/app/assets/images/.keep
|
236
|
-
- test/dummy/app/assets/javascripts/application.js
|
237
|
-
- test/dummy/app/assets/stylesheets/application.css
|
238
|
-
- test/dummy/app/controllers/application_controller.rb
|
239
|
-
- test/dummy/app/controllers/concerns/.keep
|
240
|
-
- test/dummy/app/helpers/application_helper.rb
|
241
|
-
- test/dummy/app/mailers/.keep
|
242
|
-
- test/dummy/app/models/.keep
|
243
|
-
- test/dummy/app/models/concerns/.keep
|
244
|
-
- test/dummy/app/models/post.rb
|
245
|
-
- test/dummy/app/models/setting.rb
|
246
|
-
- test/dummy/app/models/user.rb
|
247
|
-
- test/dummy/app/views/layouts/application.html.erb
|
248
|
-
- test/dummy/bin/bundle
|
249
|
-
- test/dummy/bin/rails
|
250
|
-
- test/dummy/bin/rake
|
251
|
-
- test/dummy/config.ru
|
252
|
-
- test/dummy/config/application.rb
|
253
|
-
- test/dummy/config/boot.rb
|
254
|
-
- test/dummy/config/database.yml
|
255
|
-
- test/dummy/config/environment.rb
|
256
|
-
- test/dummy/config/environments/development.rb
|
257
|
-
- test/dummy/config/environments/production.rb
|
258
|
-
- test/dummy/config/environments/test.rb
|
259
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
260
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
261
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
262
|
-
- test/dummy/config/initializers/inflections.rb
|
263
|
-
- test/dummy/config/initializers/mime_types.rb
|
264
|
-
- test/dummy/config/initializers/session_store.rb
|
265
|
-
- test/dummy/config/initializers/setting_accessors.rb
|
266
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
267
|
-
- test/dummy/config/locales/en.yml
|
268
|
-
- test/dummy/config/routes.rb
|
269
|
-
- test/dummy/config/secrets.yml
|
270
|
-
- test/dummy/config/settings.yml
|
271
|
-
- test/dummy/db/migrate/20150102112106_create_users.rb
|
272
|
-
- test/dummy/db/migrate/20150102115329_create_settings.rb
|
273
|
-
- test/dummy/db/migrate/20150723114600_create_posts.rb
|
274
|
-
- test/dummy/db/schema.rb
|
275
|
-
- test/dummy/db/test.sqlite3
|
276
|
-
- test/dummy/lib/assets/.keep
|
277
|
-
- test/dummy/log/.keep
|
278
|
-
- test/dummy/public/404.html
|
279
|
-
- test/dummy/public/422.html
|
280
|
-
- test/dummy/public/500.html
|
281
|
-
- test/dummy/public/favicon.ico
|
282
|
-
- test/dummy/test/fixtures/posts.yml
|
283
|
-
- test/dummy/test/models/post_test.rb
|
284
|
-
- test/dummy/test/models/setting_test.rb
|
285
|
-
- test/dummy/test/models/user_test.rb
|
286
|
-
- test/generators/install_generator_test.rb
|
287
|
-
- test/setting_accessors_test.rb
|
288
|
-
- test/test_helper.rb
|
262
|
+
test_files: []
|