sandboxy 1.1.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +5 -5
  2. data/.github/pull_request_template.md +2 -2
  3. data/CHANGELOG.md +6 -0
  4. data/CODE_OF_CONDUCT.md +1 -1
  5. data/DEPRECATIONS.md +3 -1
  6. data/Gemfile +1 -1
  7. data/INSTALL.md +1 -1
  8. data/LICENSE +1 -1
  9. data/README.md +68 -38
  10. data/Rakefile +0 -1
  11. data/examples/rails_example/Gemfile +1 -0
  12. data/examples/rails_example/app/api/books/api.rb +33 -0
  13. data/examples/rails_example/app/assets/javascripts/{bars.coffee → applications.coffee} +0 -0
  14. data/examples/rails_example/app/assets/javascripts/{foos.coffee → authors.coffee} +0 -0
  15. data/examples/rails_example/app/assets/javascripts/books.coffee +3 -0
  16. data/examples/rails_example/app/assets/javascripts/libraries.coffee +3 -0
  17. data/examples/rails_example/app/assets/javascripts/sandbox.coffee +3 -0
  18. data/examples/rails_example/app/assets/stylesheets/applications.scss +3 -0
  19. data/examples/rails_example/app/assets/stylesheets/{foos.scss → authors.scss} +1 -1
  20. data/examples/rails_example/app/assets/stylesheets/{bars.scss → books.scss} +1 -1
  21. data/examples/rails_example/app/assets/stylesheets/libraries.scss +3 -0
  22. data/examples/rails_example/app/assets/stylesheets/sandbox.scss +3 -0
  23. data/examples/rails_example/app/controllers/application_controller.rb +5 -1
  24. data/examples/rails_example/app/controllers/applications_controller.rb +74 -0
  25. data/examples/rails_example/app/controllers/authors_controller.rb +77 -0
  26. data/examples/rails_example/app/controllers/books_controller.rb +77 -0
  27. data/examples/rails_example/app/controllers/libraries_controller.rb +77 -0
  28. data/examples/rails_example/app/controllers/sandbox_controller.rb +6 -0
  29. data/examples/rails_example/app/helpers/applications_helper.rb +2 -0
  30. data/examples/rails_example/app/helpers/authors_helper.rb +2 -0
  31. data/examples/rails_example/app/helpers/books_helper.rb +2 -0
  32. data/examples/rails_example/app/helpers/libraries_helper.rb +2 -0
  33. data/examples/rails_example/app/helpers/sandbox_helper.rb +2 -0
  34. data/examples/rails_example/app/models/application.rb +14 -0
  35. data/examples/rails_example/app/models/author.rb +2 -0
  36. data/examples/rails_example/app/models/book.rb +2 -0
  37. data/examples/rails_example/app/models/library.rb +2 -0
  38. data/examples/rails_example/app/views/applications/_application.json.jbuilder +2 -0
  39. data/examples/rails_example/app/views/applications/_form.html.erb +19 -0
  40. data/examples/rails_example/app/views/applications/edit.html.erb +6 -0
  41. data/examples/rails_example/app/views/applications/index.html.erb +25 -0
  42. data/examples/rails_example/app/views/applications/index.json.jbuilder +1 -0
  43. data/examples/rails_example/app/views/applications/new.html.erb +5 -0
  44. data/examples/rails_example/app/views/applications/show.html.erb +7 -0
  45. data/examples/rails_example/app/views/applications/show.json.jbuilder +1 -0
  46. data/examples/rails_example/app/views/authors/_author.json.jbuilder +2 -0
  47. data/examples/rails_example/app/views/authors/_form.html.erb +19 -0
  48. data/examples/rails_example/app/views/authors/edit.html.erb +6 -0
  49. data/examples/rails_example/app/views/authors/index.html.erb +25 -0
  50. data/examples/rails_example/app/views/authors/index.json.jbuilder +1 -0
  51. data/examples/rails_example/app/views/authors/new.html.erb +5 -0
  52. data/examples/rails_example/app/views/authors/show.html.erb +4 -0
  53. data/examples/rails_example/app/views/authors/show.json.jbuilder +1 -0
  54. data/examples/rails_example/app/views/books/_book.json.jbuilder +2 -0
  55. data/examples/rails_example/app/views/books/_form.html.erb +19 -0
  56. data/examples/rails_example/app/views/books/edit.html.erb +6 -0
  57. data/examples/rails_example/app/views/books/index.html.erb +25 -0
  58. data/examples/rails_example/app/views/books/index.json.jbuilder +1 -0
  59. data/examples/rails_example/app/views/books/new.html.erb +5 -0
  60. data/examples/rails_example/app/views/books/show.html.erb +4 -0
  61. data/examples/rails_example/app/views/books/show.json.jbuilder +1 -0
  62. data/examples/rails_example/app/views/libraries/_form.html.erb +19 -0
  63. data/examples/rails_example/app/views/libraries/_library.json.jbuilder +2 -0
  64. data/examples/rails_example/app/views/libraries/edit.html.erb +6 -0
  65. data/examples/rails_example/app/views/libraries/index.html.erb +25 -0
  66. data/examples/rails_example/app/views/libraries/index.json.jbuilder +1 -0
  67. data/examples/rails_example/app/views/libraries/new.html.erb +5 -0
  68. data/examples/rails_example/app/views/libraries/show.html.erb +4 -0
  69. data/examples/rails_example/app/views/libraries/show.json.jbuilder +1 -0
  70. data/examples/rails_example/config/initializers/grape.rb +2 -0
  71. data/examples/rails_example/config/initializers/sandboxy.rb +13 -0
  72. data/examples/rails_example/config/routes.rb +9 -3
  73. data/examples/rails_example/config/secrets.yml +2 -2
  74. data/examples/rails_example/db/migrate/20170827184048_create_books.rb +9 -0
  75. data/examples/rails_example/db/migrate/20170827184054_create_authors.rb +9 -0
  76. data/examples/rails_example/db/migrate/20170827184106_create_libraries.rb +9 -0
  77. data/examples/rails_example/db/migrate/20170827184304_create_applications.rb +11 -0
  78. data/examples/rails_example/db/migrate/{20170827105828_sandboxy_migration.rb → 20170827190815_sandboxy_migration.rb} +0 -0
  79. data/examples/rails_example/db/schema.rb +19 -3
  80. data/examples/rails_example/test/controllers/applications_controller_test.rb +48 -0
  81. data/examples/rails_example/test/controllers/authors_controller_test.rb +48 -0
  82. data/examples/rails_example/test/controllers/books_controller_test.rb +48 -0
  83. data/examples/rails_example/test/controllers/libraries_controller_test.rb +48 -0
  84. data/examples/rails_example/test/controllers/sandbox_controller_test.rb +7 -0
  85. data/examples/rails_example/test/fixtures/{bars.yml → applications.yml} +0 -0
  86. data/examples/rails_example/test/fixtures/{foos.yml → authors.yml} +0 -0
  87. data/examples/rails_example/test/fixtures/books.yml +11 -0
  88. data/examples/rails_example/test/fixtures/libraries.yml +11 -0
  89. data/examples/rails_example/test/models/application_test.rb +7 -0
  90. data/examples/rails_example/test/models/{bar_test.rb → author_test.rb} +1 -1
  91. data/examples/rails_example/test/models/{foo_test.rb → book_test.rb} +1 -1
  92. data/examples/rails_example/test/models/library_test.rb +7 -0
  93. data/examples/rails_example/test/system/applications_test.rb +9 -0
  94. data/examples/rails_example/test/system/authors_test.rb +9 -0
  95. data/examples/rails_example/test/system/books_test.rb +9 -0
  96. data/examples/rails_example/test/system/libraries_test.rb +9 -0
  97. data/lib/generators/sandboxy_generator.rb +4 -6
  98. data/lib/generators/templates/initializer.rb +13 -0
  99. data/lib/sandboxy/configuration.rb +11 -34
  100. data/lib/sandboxy/middleware.rb +3 -3
  101. data/lib/sandboxy/railtie.rb +3 -3
  102. data/lib/sandboxy/version.rb +1 -1
  103. data/lib/sandboxy.rb +12 -3
  104. data/sandboxy.gemspec +4 -6
  105. data/test/dummy30/config/initializers/sandboxy.rb +13 -0
  106. data/test/test_helper.rb +0 -2
  107. metadata +93 -78
  108. data/examples/rails_example/app/controllers/bars_controller.rb +0 -74
  109. data/examples/rails_example/app/controllers/foos_controller.rb +0 -74
  110. data/examples/rails_example/app/helpers/bars_helper.rb +0 -2
  111. data/examples/rails_example/app/helpers/foos_helper.rb +0 -2
  112. data/examples/rails_example/app/models/bar.rb +0 -2
  113. data/examples/rails_example/app/models/foo.rb +0 -2
  114. data/examples/rails_example/app/models/shared_sandbox.rb +0 -3
  115. data/examples/rails_example/app/views/bars/_bar.json.jbuilder +0 -2
  116. data/examples/rails_example/app/views/bars/_form.html.erb +0 -17
  117. data/examples/rails_example/app/views/bars/edit.html.erb +0 -6
  118. data/examples/rails_example/app/views/bars/index.html.erb +0 -25
  119. data/examples/rails_example/app/views/bars/index.json.jbuilder +0 -1
  120. data/examples/rails_example/app/views/bars/new.html.erb +0 -5
  121. data/examples/rails_example/app/views/bars/show.html.erb +0 -4
  122. data/examples/rails_example/app/views/bars/show.json.jbuilder +0 -1
  123. data/examples/rails_example/app/views/foos/_foo.json.jbuilder +0 -2
  124. data/examples/rails_example/app/views/foos/_form.html.erb +0 -17
  125. data/examples/rails_example/app/views/foos/edit.html.erb +0 -6
  126. data/examples/rails_example/app/views/foos/index.html.erb +0 -25
  127. data/examples/rails_example/app/views/foos/index.json.jbuilder +0 -1
  128. data/examples/rails_example/app/views/foos/new.html.erb +0 -5
  129. data/examples/rails_example/app/views/foos/show.html.erb +0 -4
  130. data/examples/rails_example/app/views/foos/show.json.jbuilder +0 -1
  131. data/examples/rails_example/config/sandboxy.yml +0 -13
  132. data/examples/rails_example/db/migrate/20170826223227_create_foos.rb +0 -8
  133. data/examples/rails_example/db/migrate/20170826223243_create_bars.rb +0 -8
  134. data/examples/rails_example/test/controllers/bars_controller_test.rb +0 -48
  135. data/examples/rails_example/test/controllers/foos_controller_test.rb +0 -48
  136. data/examples/rails_example/test/system/bars_test.rb +0 -9
  137. data/examples/rails_example/test/system/foos_test.rb +0 -9
  138. data/lib/generators/templates/configuration.yml.erb +0 -13
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sandboxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - Slooob
7
+ - Jonas Hübotter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-27 00:00:00.000000000 Z
11
+ date: 2017-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: activerecord
14
+ name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '5.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4.0'
26
+ version: '5.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.5'
55
- - !ruby/object:Gem::Dependency
56
- name: shoulda_create
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '0.0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: factory_girl
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +66,6 @@ dependencies:
80
66
  - - "~>"
81
67
  - !ruby/object:Gem::Version
82
68
  version: '4.8'
83
- - !ruby/object:Gem::Dependency
84
- name: rails
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '4.0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '4.0'
97
69
  - !ruby/object:Gem::Dependency
98
70
  name: tzinfo-data
99
71
  requirement: !ruby/object:Gem::Requirement
@@ -111,7 +83,7 @@ dependencies:
111
83
  description: Sandboxy allows you to use virtual data-oriented environments inside
112
84
  a Rails application while being able to switch in between at runtime. It achieves
113
85
  that by using a combination of Rack Middleware and ActiveRecord.
114
- email: developer@slooob.com
86
+ email: jonas.huebotter@gmail.com
115
87
  executables: []
116
88
  extensions: []
117
89
  extra_rdoc_files: []
@@ -133,53 +105,83 @@ files:
133
105
  - examples/rails_example/Gemfile
134
106
  - examples/rails_example/README.md
135
107
  - examples/rails_example/Rakefile
108
+ - examples/rails_example/app/api/books/api.rb
136
109
  - examples/rails_example/app/assets/config/manifest.js
137
110
  - examples/rails_example/app/assets/images/.keep
138
111
  - examples/rails_example/app/assets/javascripts/application.js
139
- - examples/rails_example/app/assets/javascripts/bars.coffee
112
+ - examples/rails_example/app/assets/javascripts/applications.coffee
113
+ - examples/rails_example/app/assets/javascripts/authors.coffee
114
+ - examples/rails_example/app/assets/javascripts/books.coffee
140
115
  - examples/rails_example/app/assets/javascripts/cable.js
141
116
  - examples/rails_example/app/assets/javascripts/channels/.keep
142
- - examples/rails_example/app/assets/javascripts/foos.coffee
117
+ - examples/rails_example/app/assets/javascripts/libraries.coffee
118
+ - examples/rails_example/app/assets/javascripts/sandbox.coffee
143
119
  - examples/rails_example/app/assets/stylesheets/application.css
144
- - examples/rails_example/app/assets/stylesheets/bars.scss
145
- - examples/rails_example/app/assets/stylesheets/foos.scss
120
+ - examples/rails_example/app/assets/stylesheets/applications.scss
121
+ - examples/rails_example/app/assets/stylesheets/authors.scss
122
+ - examples/rails_example/app/assets/stylesheets/books.scss
123
+ - examples/rails_example/app/assets/stylesheets/libraries.scss
124
+ - examples/rails_example/app/assets/stylesheets/sandbox.scss
146
125
  - examples/rails_example/app/assets/stylesheets/scaffolds.scss
147
126
  - examples/rails_example/app/channels/application_cable/channel.rb
148
127
  - examples/rails_example/app/channels/application_cable/connection.rb
149
128
  - examples/rails_example/app/controllers/application_controller.rb
150
- - examples/rails_example/app/controllers/bars_controller.rb
129
+ - examples/rails_example/app/controllers/applications_controller.rb
130
+ - examples/rails_example/app/controllers/authors_controller.rb
131
+ - examples/rails_example/app/controllers/books_controller.rb
151
132
  - examples/rails_example/app/controllers/concerns/.keep
152
- - examples/rails_example/app/controllers/foos_controller.rb
133
+ - examples/rails_example/app/controllers/libraries_controller.rb
134
+ - examples/rails_example/app/controllers/sandbox_controller.rb
153
135
  - examples/rails_example/app/helpers/application_helper.rb
154
- - examples/rails_example/app/helpers/bars_helper.rb
155
- - examples/rails_example/app/helpers/foos_helper.rb
136
+ - examples/rails_example/app/helpers/applications_helper.rb
137
+ - examples/rails_example/app/helpers/authors_helper.rb
138
+ - examples/rails_example/app/helpers/books_helper.rb
139
+ - examples/rails_example/app/helpers/libraries_helper.rb
140
+ - examples/rails_example/app/helpers/sandbox_helper.rb
156
141
  - examples/rails_example/app/jobs/application_job.rb
157
142
  - examples/rails_example/app/mailers/application_mailer.rb
143
+ - examples/rails_example/app/models/application.rb
158
144
  - examples/rails_example/app/models/application_record.rb
159
- - examples/rails_example/app/models/bar.rb
145
+ - examples/rails_example/app/models/author.rb
146
+ - examples/rails_example/app/models/book.rb
160
147
  - examples/rails_example/app/models/concerns/.keep
161
- - examples/rails_example/app/models/foo.rb
148
+ - examples/rails_example/app/models/library.rb
162
149
  - examples/rails_example/app/models/sandbox.rb
163
- - examples/rails_example/app/models/shared_sandbox.rb
164
- - examples/rails_example/app/views/bars/_bar.json.jbuilder
165
- - examples/rails_example/app/views/bars/_form.html.erb
166
- - examples/rails_example/app/views/bars/edit.html.erb
167
- - examples/rails_example/app/views/bars/index.html.erb
168
- - examples/rails_example/app/views/bars/index.json.jbuilder
169
- - examples/rails_example/app/views/bars/new.html.erb
170
- - examples/rails_example/app/views/bars/show.html.erb
171
- - examples/rails_example/app/views/bars/show.json.jbuilder
172
- - examples/rails_example/app/views/foos/_foo.json.jbuilder
173
- - examples/rails_example/app/views/foos/_form.html.erb
174
- - examples/rails_example/app/views/foos/edit.html.erb
175
- - examples/rails_example/app/views/foos/index.html.erb
176
- - examples/rails_example/app/views/foos/index.json.jbuilder
177
- - examples/rails_example/app/views/foos/new.html.erb
178
- - examples/rails_example/app/views/foos/show.html.erb
179
- - examples/rails_example/app/views/foos/show.json.jbuilder
150
+ - examples/rails_example/app/views/applications/_application.json.jbuilder
151
+ - examples/rails_example/app/views/applications/_form.html.erb
152
+ - examples/rails_example/app/views/applications/edit.html.erb
153
+ - examples/rails_example/app/views/applications/index.html.erb
154
+ - examples/rails_example/app/views/applications/index.json.jbuilder
155
+ - examples/rails_example/app/views/applications/new.html.erb
156
+ - examples/rails_example/app/views/applications/show.html.erb
157
+ - examples/rails_example/app/views/applications/show.json.jbuilder
158
+ - examples/rails_example/app/views/authors/_author.json.jbuilder
159
+ - examples/rails_example/app/views/authors/_form.html.erb
160
+ - examples/rails_example/app/views/authors/edit.html.erb
161
+ - examples/rails_example/app/views/authors/index.html.erb
162
+ - examples/rails_example/app/views/authors/index.json.jbuilder
163
+ - examples/rails_example/app/views/authors/new.html.erb
164
+ - examples/rails_example/app/views/authors/show.html.erb
165
+ - examples/rails_example/app/views/authors/show.json.jbuilder
166
+ - examples/rails_example/app/views/books/_book.json.jbuilder
167
+ - examples/rails_example/app/views/books/_form.html.erb
168
+ - examples/rails_example/app/views/books/edit.html.erb
169
+ - examples/rails_example/app/views/books/index.html.erb
170
+ - examples/rails_example/app/views/books/index.json.jbuilder
171
+ - examples/rails_example/app/views/books/new.html.erb
172
+ - examples/rails_example/app/views/books/show.html.erb
173
+ - examples/rails_example/app/views/books/show.json.jbuilder
180
174
  - examples/rails_example/app/views/layouts/application.html.erb
181
175
  - examples/rails_example/app/views/layouts/mailer.html.erb
182
176
  - examples/rails_example/app/views/layouts/mailer.text.erb
177
+ - examples/rails_example/app/views/libraries/_form.html.erb
178
+ - examples/rails_example/app/views/libraries/_library.json.jbuilder
179
+ - examples/rails_example/app/views/libraries/edit.html.erb
180
+ - examples/rails_example/app/views/libraries/index.html.erb
181
+ - examples/rails_example/app/views/libraries/index.json.jbuilder
182
+ - examples/rails_example/app/views/libraries/new.html.erb
183
+ - examples/rails_example/app/views/libraries/show.html.erb
184
+ - examples/rails_example/app/views/libraries/show.json.jbuilder
183
185
  - examples/rails_example/bin/bundle
184
186
  - examples/rails_example/bin/rails
185
187
  - examples/rails_example/bin/rake
@@ -200,17 +202,20 @@ files:
200
202
  - examples/rails_example/config/initializers/backtrace_silencers.rb
201
203
  - examples/rails_example/config/initializers/cookies_serializer.rb
202
204
  - examples/rails_example/config/initializers/filter_parameter_logging.rb
205
+ - examples/rails_example/config/initializers/grape.rb
203
206
  - examples/rails_example/config/initializers/inflections.rb
204
207
  - examples/rails_example/config/initializers/mime_types.rb
208
+ - examples/rails_example/config/initializers/sandboxy.rb
205
209
  - examples/rails_example/config/initializers/wrap_parameters.rb
206
210
  - examples/rails_example/config/locales/en.yml
207
211
  - examples/rails_example/config/puma.rb
208
212
  - examples/rails_example/config/routes.rb
209
- - examples/rails_example/config/sandboxy.yml
210
213
  - examples/rails_example/config/secrets.yml
211
- - examples/rails_example/db/migrate/20170826223227_create_foos.rb
212
- - examples/rails_example/db/migrate/20170826223243_create_bars.rb
213
- - examples/rails_example/db/migrate/20170827105828_sandboxy_migration.rb
214
+ - examples/rails_example/db/migrate/20170827184048_create_books.rb
215
+ - examples/rails_example/db/migrate/20170827184054_create_authors.rb
216
+ - examples/rails_example/db/migrate/20170827184106_create_libraries.rb
217
+ - examples/rails_example/db/migrate/20170827184304_create_applications.rb
218
+ - examples/rails_example/db/migrate/20170827190815_sandboxy_migration.rb
214
219
  - examples/rails_example/db/schema.rb
215
220
  - examples/rails_example/db/seeds.rb
216
221
  - examples/rails_example/lib/assets/.keep
@@ -225,28 +230,37 @@ files:
225
230
  - examples/rails_example/public/robots.txt
226
231
  - examples/rails_example/test/application_system_test_case.rb
227
232
  - examples/rails_example/test/controllers/.keep
228
- - examples/rails_example/test/controllers/bars_controller_test.rb
229
- - examples/rails_example/test/controllers/foos_controller_test.rb
233
+ - examples/rails_example/test/controllers/applications_controller_test.rb
234
+ - examples/rails_example/test/controllers/authors_controller_test.rb
235
+ - examples/rails_example/test/controllers/books_controller_test.rb
236
+ - examples/rails_example/test/controllers/libraries_controller_test.rb
237
+ - examples/rails_example/test/controllers/sandbox_controller_test.rb
230
238
  - examples/rails_example/test/fixtures/.keep
231
- - examples/rails_example/test/fixtures/bars.yml
239
+ - examples/rails_example/test/fixtures/applications.yml
240
+ - examples/rails_example/test/fixtures/authors.yml
241
+ - examples/rails_example/test/fixtures/books.yml
232
242
  - examples/rails_example/test/fixtures/files/.keep
233
- - examples/rails_example/test/fixtures/foos.yml
243
+ - examples/rails_example/test/fixtures/libraries.yml
234
244
  - examples/rails_example/test/helpers/.keep
235
245
  - examples/rails_example/test/integration/.keep
236
246
  - examples/rails_example/test/mailers/.keep
237
247
  - examples/rails_example/test/models/.keep
238
- - examples/rails_example/test/models/bar_test.rb
239
- - examples/rails_example/test/models/foo_test.rb
248
+ - examples/rails_example/test/models/application_test.rb
249
+ - examples/rails_example/test/models/author_test.rb
250
+ - examples/rails_example/test/models/book_test.rb
251
+ - examples/rails_example/test/models/library_test.rb
240
252
  - examples/rails_example/test/system/.keep
241
- - examples/rails_example/test/system/bars_test.rb
242
- - examples/rails_example/test/system/foos_test.rb
253
+ - examples/rails_example/test/system/applications_test.rb
254
+ - examples/rails_example/test/system/authors_test.rb
255
+ - examples/rails_example/test/system/books_test.rb
256
+ - examples/rails_example/test/system/libraries_test.rb
243
257
  - examples/rails_example/test/test_helper.rb
244
258
  - examples/rails_example/tmp/.keep
245
259
  - examples/rails_example/vendor/.keep
246
260
  - init.rb
247
261
  - lib/generators/sandboxy_generator.rb
248
262
  - lib/generators/templates/README.md
249
- - lib/generators/templates/configuration.yml.erb
263
+ - lib/generators/templates/initializer.rb
250
264
  - lib/generators/templates/migration.rb.erb
251
265
  - lib/generators/templates/model.rb
252
266
  - lib/sandboxy.rb
@@ -269,6 +283,7 @@ files:
269
283
  - test/dummy30/config/environment.rb
270
284
  - test/dummy30/config/environments/development.rb
271
285
  - test/dummy30/config/environments/test.rb
286
+ - test/dummy30/config/initializers/sandboxy.rb
272
287
  - test/dummy30/config/initializers/secret_token.rb
273
288
  - test/dummy30/config/initializers/session_store.rb
274
289
  - test/dummy30/config/locales/en.yml
@@ -280,14 +295,14 @@ files:
280
295
  - test/sandboxed_test.rb
281
296
  - test/schema.rb
282
297
  - test/test_helper.rb
283
- homepage: https://developer.slooob.com/open-source
298
+ homepage: https://github.com/jonhue/sandboxy
284
299
  licenses:
285
300
  - MIT
286
301
  metadata: {}
287
302
  post_install_message: |
288
303
  **Thank you for installing sandboxy!**
289
304
  Get started by running `rails g sandboxy`.
290
- Learn more at https://github.com/slooob/sandboxy.
305
+ Learn more at https://github.com/jonhue/sandboxy.
291
306
  rdoc_options: []
292
307
  require_paths:
293
308
  - lib
@@ -303,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
303
318
  version: '0'
304
319
  requirements: []
305
320
  rubyforge_project:
306
- rubygems_version: 2.6.12
321
+ rubygems_version: 2.7.3
307
322
  signing_key:
308
323
  specification_version: 4
309
324
  summary: Virtual data-oriented environments for Rails
@@ -1,74 +0,0 @@
1
- class BarsController < ApplicationController
2
- before_action :set_bar, only: [:show, :edit, :update, :destroy]
3
-
4
- # GET /bars
5
- # GET /bars.json
6
- def index
7
- @bars = Bar.all
8
- end
9
-
10
- # GET /bars/1
11
- # GET /bars/1.json
12
- def show
13
- end
14
-
15
- # GET /bars/new
16
- def new
17
- @bar = Bar.new
18
- end
19
-
20
- # GET /bars/1/edit
21
- def edit
22
- end
23
-
24
- # POST /bars
25
- # POST /bars.json
26
- def create
27
- @bar = Bar.new(bar_params)
28
-
29
- respond_to do |format|
30
- if @bar.save
31
- format.html { redirect_to @bar, notice: 'Bar was successfully created.' }
32
- format.json { render :show, status: :created, location: @bar }
33
- else
34
- format.html { render :new }
35
- format.json { render json: @bar.errors, status: :unprocessable_entity }
36
- end
37
- end
38
- end
39
-
40
- # PATCH/PUT /bars/1
41
- # PATCH/PUT /bars/1.json
42
- def update
43
- respond_to do |format|
44
- if @bar.update(bar_params)
45
- format.html { redirect_to @bar, notice: 'Bar was successfully updated.' }
46
- format.json { render :show, status: :ok, location: @bar }
47
- else
48
- format.html { render :edit }
49
- format.json { render json: @bar.errors, status: :unprocessable_entity }
50
- end
51
- end
52
- end
53
-
54
- # DELETE /bars/1
55
- # DELETE /bars/1.json
56
- def destroy
57
- @bar.destroy
58
- respond_to do |format|
59
- format.html { redirect_to bars_url, notice: 'Bar was successfully destroyed.' }
60
- format.json { head :no_content }
61
- end
62
- end
63
-
64
- private
65
- # Use callbacks to share common setup or constraints between actions.
66
- def set_bar
67
- @bar = Bar.find(params[:id])
68
- end
69
-
70
- # Never trust parameters from the scary internet, only allow the white list through.
71
- def bar_params
72
- params.fetch(:bar, {})
73
- end
74
- end
@@ -1,74 +0,0 @@
1
- class FoosController < ApplicationController
2
- before_action :set_foo, only: [:show, :edit, :update, :destroy]
3
-
4
- # GET /foos
5
- # GET /foos.json
6
- def index
7
- @foos = Foo.all
8
- end
9
-
10
- # GET /foos/1
11
- # GET /foos/1.json
12
- def show
13
- end
14
-
15
- # GET /foos/new
16
- def new
17
- @foo = Foo.new
18
- end
19
-
20
- # GET /foos/1/edit
21
- def edit
22
- end
23
-
24
- # POST /foos
25
- # POST /foos.json
26
- def create
27
- @foo = Foo.new(foo_params)
28
-
29
- respond_to do |format|
30
- if @foo.save
31
- format.html { redirect_to @foo, notice: 'Foo was successfully created.' }
32
- format.json { render :show, status: :created, location: @foo }
33
- else
34
- format.html { render :new }
35
- format.json { render json: @foo.errors, status: :unprocessable_entity }
36
- end
37
- end
38
- end
39
-
40
- # PATCH/PUT /foos/1
41
- # PATCH/PUT /foos/1.json
42
- def update
43
- respond_to do |format|
44
- if @foo.update(foo_params)
45
- format.html { redirect_to @foo, notice: 'Foo was successfully updated.' }
46
- format.json { render :show, status: :ok, location: @foo }
47
- else
48
- format.html { render :edit }
49
- format.json { render json: @foo.errors, status: :unprocessable_entity }
50
- end
51
- end
52
- end
53
-
54
- # DELETE /foos/1
55
- # DELETE /foos/1.json
56
- def destroy
57
- @foo.destroy
58
- respond_to do |format|
59
- format.html { redirect_to foos_url, notice: 'Foo was successfully destroyed.' }
60
- format.json { head :no_content }
61
- end
62
- end
63
-
64
- private
65
- # Use callbacks to share common setup or constraints between actions.
66
- def set_foo
67
- @foo = Foo.find(params[:id])
68
- end
69
-
70
- # Never trust parameters from the scary internet, only allow the white list through.
71
- def foo_params
72
- params.fetch(:foo, {})
73
- end
74
- end
@@ -1,2 +0,0 @@
1
- module BarsHelper
2
- end
@@ -1,2 +0,0 @@
1
- module FoosHelper
2
- end
@@ -1,2 +0,0 @@
1
- class Bar < SharedSandbox
2
- end
@@ -1,2 +0,0 @@
1
- class Foo < SharedSandbox
2
- end
@@ -1,3 +0,0 @@
1
- class SharedSandbox < ApplicationRecord
2
- sandboxy
3
- end
@@ -1,2 +0,0 @@
1
- json.extract! bar, :id, :created_at, :updated_at
2
- json.url bar_url(bar, format: :json)
@@ -1,17 +0,0 @@
1
- <%= form_with(model: bar, local: true) do |form| %>
2
- <% if bar.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(bar.errors.count, "error") %> prohibited this bar from being saved:</h2>
5
-
6
- <ul>
7
- <% bar.errors.full_messages.each do |message| %>
8
- <li><%= message %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <div class="actions">
15
- <%= form.submit %>
16
- </div>
17
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing Bar</h1>
2
-
3
- <%= render 'form', bar: @bar %>
4
-
5
- <%= link_to 'Show', @bar %> |
6
- <%= link_to 'Back', bars_path %>
@@ -1,25 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <h1>Bars</h1>
4
-
5
- <table>
6
- <thead>
7
- <tr>
8
- <th colspan="3"></th>
9
- </tr>
10
- </thead>
11
-
12
- <tbody>
13
- <% @bars.each do |bar| %>
14
- <tr>
15
- <td><%= link_to 'Show', bar %></td>
16
- <td><%= link_to 'Edit', edit_bar_path(bar) %></td>
17
- <td><%= link_to 'Destroy', bar, method: :delete, data: { confirm: 'Are you sure?' } %></td>
18
- </tr>
19
- <% end %>
20
- </tbody>
21
- </table>
22
-
23
- <br>
24
-
25
- <%= link_to 'New Bar', new_bar_path %>
@@ -1 +0,0 @@
1
- json.array! @bars, partial: 'bars/bar', as: :bar
@@ -1,5 +0,0 @@
1
- <h1>New Bar</h1>
2
-
3
- <%= render 'form', bar: @bar %>
4
-
5
- <%= link_to 'Back', bars_path %>
@@ -1,4 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <%= link_to 'Edit', edit_bar_path(@bar) %> |
4
- <%= link_to 'Back', bars_path %>
@@ -1 +0,0 @@
1
- json.partial! "bars/bar", bar: @bar
@@ -1,2 +0,0 @@
1
- json.extract! foo, :id, :created_at, :updated_at
2
- json.url foo_url(foo, format: :json)
@@ -1,17 +0,0 @@
1
- <%= form_with(model: foo, local: true) do |form| %>
2
- <% if foo.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(foo.errors.count, "error") %> prohibited this foo from being saved:</h2>
5
-
6
- <ul>
7
- <% foo.errors.full_messages.each do |message| %>
8
- <li><%= message %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <div class="actions">
15
- <%= form.submit %>
16
- </div>
17
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing Foo</h1>
2
-
3
- <%= render 'form', foo: @foo %>
4
-
5
- <%= link_to 'Show', @foo %> |
6
- <%= link_to 'Back', foos_path %>
@@ -1,25 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <h1>Foos</h1>
4
-
5
- <table>
6
- <thead>
7
- <tr>
8
- <th colspan="3"></th>
9
- </tr>
10
- </thead>
11
-
12
- <tbody>
13
- <% @foos.each do |foo| %>
14
- <tr>
15
- <td><%= link_to 'Show', foo %></td>
16
- <td><%= link_to 'Edit', edit_foo_path(foo) %></td>
17
- <td><%= link_to 'Destroy', foo, method: :delete, data: { confirm: 'Are you sure?' } %></td>
18
- </tr>
19
- <% end %>
20
- </tbody>
21
- </table>
22
-
23
- <br>
24
-
25
- <%= link_to 'New Foo', new_foo_path %>
@@ -1 +0,0 @@
1
- json.array! @foos, partial: 'foos/foo', as: :foo
@@ -1,5 +0,0 @@
1
- <h1>New Foo</h1>
2
-
3
- <%= render 'form', foo: @foo %>
4
-
5
- <%= link_to 'Back', foos_path %>
@@ -1,4 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <%= link_to 'Edit', edit_foo_path(@foo) %> |
4
- <%= link_to 'Back', foos_path %>
@@ -1 +0,0 @@
1
- json.partial! "foos/foo", foo: @foo
@@ -1,13 +0,0 @@
1
- # ----------
2
- # Sandboxy
3
- # ----------
4
-
5
- # Set your environment default: Must be either `live` or `sandbox`.
6
- # This is the environment that your app boots with.
7
- # By default it gets refreshed with every new request to your server.
8
- # environment: 'live'
9
-
10
- # Specify whether to retain your current app environment on new requests.
11
- # If set to true, your app will only load your environment default when starting.
12
- # Every additional switch of your environment at runtime will then not be automatically resolved to your environment default on a new request.
13
- # retain_environment: false
@@ -1,8 +0,0 @@
1
- class CreateFoos < ActiveRecord::Migration[5.1]
2
- def change
3
- create_table :foos do |t|
4
-
5
- t.timestamps
6
- end
7
- end
8
- end