setting_accessors 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +29 -0
  3. data/.ruby-gemset +1 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +254 -0
  8. data/Rakefile +2 -0
  9. data/lib/generators/setting_accessors/install_generator.rb +38 -0
  10. data/lib/generators/setting_accessors/templates/migration.rb.erb +12 -0
  11. data/lib/generators/setting_accessors/templates/model.rb.erb +47 -0
  12. data/lib/generators/setting_accessors/templates/settings.yml +24 -0
  13. data/lib/setting_accessors.rb +26 -0
  14. data/lib/setting_accessors/accessor.rb +148 -0
  15. data/lib/setting_accessors/converter.rb +67 -0
  16. data/lib/setting_accessors/integration.rb +79 -0
  17. data/lib/setting_accessors/integration_validator.rb +15 -0
  18. data/lib/setting_accessors/internal.rb +108 -0
  19. data/lib/setting_accessors/setting_scaffold.rb +252 -0
  20. data/lib/setting_accessors/validator.rb +144 -0
  21. data/lib/setting_accessors/version.rb +3 -0
  22. data/lib/tasks/setting_accessors_tasks.rake +4 -0
  23. data/setting_accessors.gemspec +30 -0
  24. data/test/dummy/README.rdoc +28 -0
  25. data/test/dummy/Rakefile +6 -0
  26. data/test/dummy/app/assets/images/.keep +0 -0
  27. data/test/dummy/app/assets/javascripts/application.js +13 -0
  28. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  29. data/test/dummy/app/controllers/application_controller.rb +5 -0
  30. data/test/dummy/app/controllers/concerns/.keep +0 -0
  31. data/test/dummy/app/helpers/application_helper.rb +2 -0
  32. data/test/dummy/app/mailers/.keep +0 -0
  33. data/test/dummy/app/models/.keep +0 -0
  34. data/test/dummy/app/models/concerns/.keep +0 -0
  35. data/test/dummy/app/models/setting.rb +59 -0
  36. data/test/dummy/app/models/user.rb +15 -0
  37. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  38. data/test/dummy/bin/bundle +3 -0
  39. data/test/dummy/bin/rails +4 -0
  40. data/test/dummy/bin/rake +4 -0
  41. data/test/dummy/config.ru +4 -0
  42. data/test/dummy/config/application.rb +25 -0
  43. data/test/dummy/config/boot.rb +5 -0
  44. data/test/dummy/config/database.yml +25 -0
  45. data/test/dummy/config/environment.rb +5 -0
  46. data/test/dummy/config/environments/development.rb +37 -0
  47. data/test/dummy/config/environments/production.rb +83 -0
  48. data/test/dummy/config/environments/test.rb +34 -0
  49. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  50. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  51. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  52. data/test/dummy/config/initializers/inflections.rb +16 -0
  53. data/test/dummy/config/initializers/mime_types.rb +4 -0
  54. data/test/dummy/config/initializers/session_store.rb +3 -0
  55. data/test/dummy/config/initializers/setting_accessors.rb +1 -0
  56. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  57. data/test/dummy/config/locales/en.yml +23 -0
  58. data/test/dummy/config/routes.rb +56 -0
  59. data/test/dummy/config/secrets.yml +22 -0
  60. data/test/dummy/config/settings.yml +23 -0
  61. data/test/dummy/db/migrate/20150102112106_create_users.rb +9 -0
  62. data/test/dummy/db/migrate/20150102115329_create_settings.rb +12 -0
  63. data/test/dummy/db/schema.rb +32 -0
  64. data/test/dummy/db/test.sqlite3 +0 -0
  65. data/test/dummy/lib/assets/.keep +0 -0
  66. data/test/dummy/log/.keep +0 -0
  67. data/test/dummy/public/404.html +67 -0
  68. data/test/dummy/public/422.html +67 -0
  69. data/test/dummy/public/500.html +66 -0
  70. data/test/dummy/public/favicon.ico +0 -0
  71. data/test/dummy/test/models/setting_test.rb +131 -0
  72. data/test/dummy/test/models/user_test.rb +5 -0
  73. data/test/generators/install_generator_test.rb +15 -0
  74. data/test/setting_accessors_test.rb +4 -0
  75. data/test/test_helper.rb +23 -0
  76. metadata +270 -0
@@ -0,0 +1,5 @@
1
+ class UserTest < ActiveSupport::TestCase
2
+ # test "the truth" do
3
+ # assert true
4
+ # end
5
+ end
@@ -0,0 +1,15 @@
1
+ require_relative '../test_helper'
2
+
3
+ class InstallGeneratorTest < Rails::Generators::TestCase
4
+ tests SettingAccessors::Generators::InstallGenerator
5
+ destination File.expand_path('../dummy/tmp', File.dirname(__FILE__))
6
+ setup :prepare_destination
7
+
8
+ test 'Assert all files are properly created' do
9
+ run_generator
10
+ assert_file 'config/settings.yml'
11
+ assert_file 'config/initializers/setting_accessors.rb'
12
+ assert_file 'app/models/setting.rb'
13
+ assert_migration 'db/migrate/create_settings.rb'
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ require_relative 'test_helper'
2
+
3
+ class SettingAccessorsTest < ActiveSupport::TestCase
4
+ end
@@ -0,0 +1,23 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+
6
+ require 'active_support'
7
+ require 'minitest'
8
+ require 'shoulda'
9
+ require "rails/test_help"
10
+
11
+ Rails.backtrace_cleaner.remove_silencers!
12
+
13
+ # Load support files
14
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
15
+
16
+ # Load fixtures from the engine
17
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
18
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
19
+ end
20
+
21
+ # For generators
22
+ require "rails/generators/test_case"
23
+ require "generators/setting_accessors/install_generator"
metadata ADDED
@@ -0,0 +1,270 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: setting_accessors
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Stefan Exner
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.4'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.4'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sqlite3
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: shoulda
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.5'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.5'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '5.5'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '5.5'
83
+ - !ruby/object:Gem::Dependency
84
+ name: byebug
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.5'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.5'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '4'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '4'
111
+ description: |-
112
+ Adds a global key-value-store to Rails applications and allows adding typed columns
113
+ to model classes without having to change the database layout.
114
+ email:
115
+ - stex@sterex.de
116
+ executables: []
117
+ extensions: []
118
+ extra_rdoc_files: []
119
+ files:
120
+ - ".gitignore"
121
+ - ".ruby-gemset"
122
+ - ".ruby-version"
123
+ - Gemfile
124
+ - LICENSE.txt
125
+ - README.md
126
+ - Rakefile
127
+ - lib/generators/setting_accessors/install_generator.rb
128
+ - lib/generators/setting_accessors/templates/migration.rb.erb
129
+ - lib/generators/setting_accessors/templates/model.rb.erb
130
+ - lib/generators/setting_accessors/templates/settings.yml
131
+ - lib/setting_accessors.rb
132
+ - lib/setting_accessors/accessor.rb
133
+ - lib/setting_accessors/converter.rb
134
+ - lib/setting_accessors/integration.rb
135
+ - lib/setting_accessors/integration_validator.rb
136
+ - lib/setting_accessors/internal.rb
137
+ - lib/setting_accessors/setting_scaffold.rb
138
+ - lib/setting_accessors/validator.rb
139
+ - lib/setting_accessors/version.rb
140
+ - lib/tasks/setting_accessors_tasks.rake
141
+ - setting_accessors.gemspec
142
+ - test/dummy/README.rdoc
143
+ - test/dummy/Rakefile
144
+ - test/dummy/app/assets/images/.keep
145
+ - test/dummy/app/assets/javascripts/application.js
146
+ - test/dummy/app/assets/stylesheets/application.css
147
+ - test/dummy/app/controllers/application_controller.rb
148
+ - test/dummy/app/controllers/concerns/.keep
149
+ - test/dummy/app/helpers/application_helper.rb
150
+ - test/dummy/app/mailers/.keep
151
+ - test/dummy/app/models/.keep
152
+ - test/dummy/app/models/concerns/.keep
153
+ - test/dummy/app/models/setting.rb
154
+ - test/dummy/app/models/user.rb
155
+ - test/dummy/app/views/layouts/application.html.erb
156
+ - test/dummy/bin/bundle
157
+ - test/dummy/bin/rails
158
+ - test/dummy/bin/rake
159
+ - test/dummy/config.ru
160
+ - test/dummy/config/application.rb
161
+ - test/dummy/config/boot.rb
162
+ - test/dummy/config/database.yml
163
+ - test/dummy/config/environment.rb
164
+ - test/dummy/config/environments/development.rb
165
+ - test/dummy/config/environments/production.rb
166
+ - test/dummy/config/environments/test.rb
167
+ - test/dummy/config/initializers/backtrace_silencers.rb
168
+ - test/dummy/config/initializers/cookies_serializer.rb
169
+ - test/dummy/config/initializers/filter_parameter_logging.rb
170
+ - test/dummy/config/initializers/inflections.rb
171
+ - test/dummy/config/initializers/mime_types.rb
172
+ - test/dummy/config/initializers/session_store.rb
173
+ - test/dummy/config/initializers/setting_accessors.rb
174
+ - test/dummy/config/initializers/wrap_parameters.rb
175
+ - test/dummy/config/locales/en.yml
176
+ - test/dummy/config/routes.rb
177
+ - test/dummy/config/secrets.yml
178
+ - test/dummy/config/settings.yml
179
+ - test/dummy/db/migrate/20150102112106_create_users.rb
180
+ - test/dummy/db/migrate/20150102115329_create_settings.rb
181
+ - test/dummy/db/schema.rb
182
+ - test/dummy/db/test.sqlite3
183
+ - test/dummy/lib/assets/.keep
184
+ - test/dummy/log/.keep
185
+ - test/dummy/public/404.html
186
+ - test/dummy/public/422.html
187
+ - test/dummy/public/500.html
188
+ - test/dummy/public/favicon.ico
189
+ - test/dummy/test/models/setting_test.rb
190
+ - test/dummy/test/models/user_test.rb
191
+ - test/generators/install_generator_test.rb
192
+ - test/setting_accessors_test.rb
193
+ - test/test_helper.rb
194
+ homepage: https://www.github.com/stex/setting_accessors
195
+ licenses:
196
+ - MIT
197
+ metadata: {}
198
+ post_install_message:
199
+ rdoc_options: []
200
+ require_paths:
201
+ - lib
202
+ required_ruby_version: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
207
+ required_rubygems_version: !ruby/object:Gem::Requirement
208
+ requirements:
209
+ - - ">="
210
+ - !ruby/object:Gem::Version
211
+ version: '0'
212
+ requirements: []
213
+ rubyforge_project:
214
+ rubygems_version: 2.2.2
215
+ signing_key:
216
+ specification_version: 4
217
+ summary: A global key-value-store and virtual model columns
218
+ test_files:
219
+ - test/dummy/README.rdoc
220
+ - test/dummy/Rakefile
221
+ - test/dummy/app/assets/images/.keep
222
+ - test/dummy/app/assets/javascripts/application.js
223
+ - test/dummy/app/assets/stylesheets/application.css
224
+ - test/dummy/app/controllers/application_controller.rb
225
+ - test/dummy/app/controllers/concerns/.keep
226
+ - test/dummy/app/helpers/application_helper.rb
227
+ - test/dummy/app/mailers/.keep
228
+ - test/dummy/app/models/.keep
229
+ - test/dummy/app/models/concerns/.keep
230
+ - test/dummy/app/models/setting.rb
231
+ - test/dummy/app/models/user.rb
232
+ - test/dummy/app/views/layouts/application.html.erb
233
+ - test/dummy/bin/bundle
234
+ - test/dummy/bin/rails
235
+ - test/dummy/bin/rake
236
+ - test/dummy/config.ru
237
+ - test/dummy/config/application.rb
238
+ - test/dummy/config/boot.rb
239
+ - test/dummy/config/database.yml
240
+ - test/dummy/config/environment.rb
241
+ - test/dummy/config/environments/development.rb
242
+ - test/dummy/config/environments/production.rb
243
+ - test/dummy/config/environments/test.rb
244
+ - test/dummy/config/initializers/backtrace_silencers.rb
245
+ - test/dummy/config/initializers/cookies_serializer.rb
246
+ - test/dummy/config/initializers/filter_parameter_logging.rb
247
+ - test/dummy/config/initializers/inflections.rb
248
+ - test/dummy/config/initializers/mime_types.rb
249
+ - test/dummy/config/initializers/session_store.rb
250
+ - test/dummy/config/initializers/setting_accessors.rb
251
+ - test/dummy/config/initializers/wrap_parameters.rb
252
+ - test/dummy/config/locales/en.yml
253
+ - test/dummy/config/routes.rb
254
+ - test/dummy/config/secrets.yml
255
+ - test/dummy/config/settings.yml
256
+ - test/dummy/db/migrate/20150102112106_create_users.rb
257
+ - test/dummy/db/migrate/20150102115329_create_settings.rb
258
+ - test/dummy/db/schema.rb
259
+ - test/dummy/db/test.sqlite3
260
+ - test/dummy/lib/assets/.keep
261
+ - test/dummy/log/.keep
262
+ - test/dummy/public/404.html
263
+ - test/dummy/public/422.html
264
+ - test/dummy/public/500.html
265
+ - test/dummy/public/favicon.ico
266
+ - test/dummy/test/models/setting_test.rb
267
+ - test/dummy/test/models/user_test.rb
268
+ - test/generators/install_generator_test.rb
269
+ - test/setting_accessors_test.rb
270
+ - test/test_helper.rb