sandboxy 1.1.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/pull_request_template.md +2 -2
- data/CHANGELOG.md +6 -0
- data/CODE_OF_CONDUCT.md +1 -1
- data/DEPRECATIONS.md +3 -1
- data/Gemfile +1 -1
- data/INSTALL.md +1 -1
- data/LICENSE +1 -1
- data/README.md +68 -38
- data/Rakefile +0 -1
- data/examples/rails_example/Gemfile +1 -0
- data/examples/rails_example/app/api/books/api.rb +33 -0
- data/examples/rails_example/app/assets/javascripts/{bars.coffee → applications.coffee} +0 -0
- data/examples/rails_example/app/assets/javascripts/{foos.coffee → authors.coffee} +0 -0
- data/examples/rails_example/app/assets/javascripts/books.coffee +3 -0
- data/examples/rails_example/app/assets/javascripts/libraries.coffee +3 -0
- data/examples/rails_example/app/assets/javascripts/sandbox.coffee +3 -0
- data/examples/rails_example/app/assets/stylesheets/applications.scss +3 -0
- data/examples/rails_example/app/assets/stylesheets/{foos.scss → authors.scss} +1 -1
- data/examples/rails_example/app/assets/stylesheets/{bars.scss → books.scss} +1 -1
- data/examples/rails_example/app/assets/stylesheets/libraries.scss +3 -0
- data/examples/rails_example/app/assets/stylesheets/sandbox.scss +3 -0
- data/examples/rails_example/app/controllers/application_controller.rb +5 -1
- data/examples/rails_example/app/controllers/applications_controller.rb +74 -0
- data/examples/rails_example/app/controllers/authors_controller.rb +77 -0
- data/examples/rails_example/app/controllers/books_controller.rb +77 -0
- data/examples/rails_example/app/controllers/libraries_controller.rb +77 -0
- data/examples/rails_example/app/controllers/sandbox_controller.rb +6 -0
- data/examples/rails_example/app/helpers/applications_helper.rb +2 -0
- data/examples/rails_example/app/helpers/authors_helper.rb +2 -0
- data/examples/rails_example/app/helpers/books_helper.rb +2 -0
- data/examples/rails_example/app/helpers/libraries_helper.rb +2 -0
- data/examples/rails_example/app/helpers/sandbox_helper.rb +2 -0
- data/examples/rails_example/app/models/application.rb +14 -0
- data/examples/rails_example/app/models/author.rb +2 -0
- data/examples/rails_example/app/models/book.rb +2 -0
- data/examples/rails_example/app/models/library.rb +2 -0
- data/examples/rails_example/app/views/applications/_application.json.jbuilder +2 -0
- data/examples/rails_example/app/views/applications/_form.html.erb +19 -0
- data/examples/rails_example/app/views/applications/edit.html.erb +6 -0
- data/examples/rails_example/app/views/applications/index.html.erb +25 -0
- data/examples/rails_example/app/views/applications/index.json.jbuilder +1 -0
- data/examples/rails_example/app/views/applications/new.html.erb +5 -0
- data/examples/rails_example/app/views/applications/show.html.erb +7 -0
- data/examples/rails_example/app/views/applications/show.json.jbuilder +1 -0
- data/examples/rails_example/app/views/authors/_author.json.jbuilder +2 -0
- data/examples/rails_example/app/views/authors/_form.html.erb +19 -0
- data/examples/rails_example/app/views/authors/edit.html.erb +6 -0
- data/examples/rails_example/app/views/authors/index.html.erb +25 -0
- data/examples/rails_example/app/views/authors/index.json.jbuilder +1 -0
- data/examples/rails_example/app/views/authors/new.html.erb +5 -0
- data/examples/rails_example/app/views/authors/show.html.erb +4 -0
- data/examples/rails_example/app/views/authors/show.json.jbuilder +1 -0
- data/examples/rails_example/app/views/books/_book.json.jbuilder +2 -0
- data/examples/rails_example/app/views/books/_form.html.erb +19 -0
- data/examples/rails_example/app/views/books/edit.html.erb +6 -0
- data/examples/rails_example/app/views/books/index.html.erb +25 -0
- data/examples/rails_example/app/views/books/index.json.jbuilder +1 -0
- data/examples/rails_example/app/views/books/new.html.erb +5 -0
- data/examples/rails_example/app/views/books/show.html.erb +4 -0
- data/examples/rails_example/app/views/books/show.json.jbuilder +1 -0
- data/examples/rails_example/app/views/libraries/_form.html.erb +19 -0
- data/examples/rails_example/app/views/libraries/_library.json.jbuilder +2 -0
- data/examples/rails_example/app/views/libraries/edit.html.erb +6 -0
- data/examples/rails_example/app/views/libraries/index.html.erb +25 -0
- data/examples/rails_example/app/views/libraries/index.json.jbuilder +1 -0
- data/examples/rails_example/app/views/libraries/new.html.erb +5 -0
- data/examples/rails_example/app/views/libraries/show.html.erb +4 -0
- data/examples/rails_example/app/views/libraries/show.json.jbuilder +1 -0
- data/examples/rails_example/config/initializers/grape.rb +2 -0
- data/examples/rails_example/config/initializers/sandboxy.rb +13 -0
- data/examples/rails_example/config/routes.rb +9 -3
- data/examples/rails_example/config/secrets.yml +2 -2
- data/examples/rails_example/db/migrate/20170827184048_create_books.rb +9 -0
- data/examples/rails_example/db/migrate/20170827184054_create_authors.rb +9 -0
- data/examples/rails_example/db/migrate/20170827184106_create_libraries.rb +9 -0
- data/examples/rails_example/db/migrate/20170827184304_create_applications.rb +11 -0
- data/examples/rails_example/db/migrate/{20170827105828_sandboxy_migration.rb → 20170827190815_sandboxy_migration.rb} +0 -0
- data/examples/rails_example/db/schema.rb +19 -3
- data/examples/rails_example/test/controllers/applications_controller_test.rb +48 -0
- data/examples/rails_example/test/controllers/authors_controller_test.rb +48 -0
- data/examples/rails_example/test/controllers/books_controller_test.rb +48 -0
- data/examples/rails_example/test/controllers/libraries_controller_test.rb +48 -0
- data/examples/rails_example/test/controllers/sandbox_controller_test.rb +7 -0
- data/examples/rails_example/test/fixtures/{bars.yml → applications.yml} +0 -0
- data/examples/rails_example/test/fixtures/{foos.yml → authors.yml} +0 -0
- data/examples/rails_example/test/fixtures/books.yml +11 -0
- data/examples/rails_example/test/fixtures/libraries.yml +11 -0
- data/examples/rails_example/test/models/application_test.rb +7 -0
- data/examples/rails_example/test/models/{bar_test.rb → author_test.rb} +1 -1
- data/examples/rails_example/test/models/{foo_test.rb → book_test.rb} +1 -1
- data/examples/rails_example/test/models/library_test.rb +7 -0
- data/examples/rails_example/test/system/applications_test.rb +9 -0
- data/examples/rails_example/test/system/authors_test.rb +9 -0
- data/examples/rails_example/test/system/books_test.rb +9 -0
- data/examples/rails_example/test/system/libraries_test.rb +9 -0
- data/lib/generators/sandboxy_generator.rb +4 -6
- data/lib/generators/templates/initializer.rb +13 -0
- data/lib/sandboxy/configuration.rb +11 -34
- data/lib/sandboxy/middleware.rb +3 -3
- data/lib/sandboxy/railtie.rb +3 -3
- data/lib/sandboxy/version.rb +1 -1
- data/lib/sandboxy.rb +12 -3
- data/sandboxy.gemspec +4 -6
- data/test/dummy30/config/initializers/sandboxy.rb +13 -0
- data/test/test_helper.rb +0 -2
- metadata +93 -78
- data/examples/rails_example/app/controllers/bars_controller.rb +0 -74
- data/examples/rails_example/app/controllers/foos_controller.rb +0 -74
- data/examples/rails_example/app/helpers/bars_helper.rb +0 -2
- data/examples/rails_example/app/helpers/foos_helper.rb +0 -2
- data/examples/rails_example/app/models/bar.rb +0 -2
- data/examples/rails_example/app/models/foo.rb +0 -2
- data/examples/rails_example/app/models/shared_sandbox.rb +0 -3
- data/examples/rails_example/app/views/bars/_bar.json.jbuilder +0 -2
- data/examples/rails_example/app/views/bars/_form.html.erb +0 -17
- data/examples/rails_example/app/views/bars/edit.html.erb +0 -6
- data/examples/rails_example/app/views/bars/index.html.erb +0 -25
- data/examples/rails_example/app/views/bars/index.json.jbuilder +0 -1
- data/examples/rails_example/app/views/bars/new.html.erb +0 -5
- data/examples/rails_example/app/views/bars/show.html.erb +0 -4
- data/examples/rails_example/app/views/bars/show.json.jbuilder +0 -1
- data/examples/rails_example/app/views/foos/_foo.json.jbuilder +0 -2
- data/examples/rails_example/app/views/foos/_form.html.erb +0 -17
- data/examples/rails_example/app/views/foos/edit.html.erb +0 -6
- data/examples/rails_example/app/views/foos/index.html.erb +0 -25
- data/examples/rails_example/app/views/foos/index.json.jbuilder +0 -1
- data/examples/rails_example/app/views/foos/new.html.erb +0 -5
- data/examples/rails_example/app/views/foos/show.html.erb +0 -4
- data/examples/rails_example/app/views/foos/show.json.jbuilder +0 -1
- data/examples/rails_example/config/sandboxy.yml +0 -13
- data/examples/rails_example/db/migrate/20170826223227_create_foos.rb +0 -8
- data/examples/rails_example/db/migrate/20170826223243_create_bars.rb +0 -8
- data/examples/rails_example/test/controllers/bars_controller_test.rb +0 -48
- data/examples/rails_example/test/controllers/foos_controller_test.rb +0 -48
- data/examples/rails_example/test/system/bars_test.rb +0 -9
- data/examples/rails_example/test/system/foos_test.rb +0 -9
- data/lib/generators/templates/configuration.yml.erb +0 -13
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class BarsControllerTest < ActionDispatch::IntegrationTest
|
4
|
-
setup do
|
5
|
-
@bar = bars(:one)
|
6
|
-
end
|
7
|
-
|
8
|
-
test "should get index" do
|
9
|
-
get bars_url
|
10
|
-
assert_response :success
|
11
|
-
end
|
12
|
-
|
13
|
-
test "should get new" do
|
14
|
-
get new_bar_url
|
15
|
-
assert_response :success
|
16
|
-
end
|
17
|
-
|
18
|
-
test "should create bar" do
|
19
|
-
assert_difference('Bar.count') do
|
20
|
-
post bars_url, params: { bar: { } }
|
21
|
-
end
|
22
|
-
|
23
|
-
assert_redirected_to bar_url(Bar.last)
|
24
|
-
end
|
25
|
-
|
26
|
-
test "should show bar" do
|
27
|
-
get bar_url(@bar)
|
28
|
-
assert_response :success
|
29
|
-
end
|
30
|
-
|
31
|
-
test "should get edit" do
|
32
|
-
get edit_bar_url(@bar)
|
33
|
-
assert_response :success
|
34
|
-
end
|
35
|
-
|
36
|
-
test "should update bar" do
|
37
|
-
patch bar_url(@bar), params: { bar: { } }
|
38
|
-
assert_redirected_to bar_url(@bar)
|
39
|
-
end
|
40
|
-
|
41
|
-
test "should destroy bar" do
|
42
|
-
assert_difference('Bar.count', -1) do
|
43
|
-
delete bar_url(@bar)
|
44
|
-
end
|
45
|
-
|
46
|
-
assert_redirected_to bars_url
|
47
|
-
end
|
48
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class FoosControllerTest < ActionDispatch::IntegrationTest
|
4
|
-
setup do
|
5
|
-
@foo = foos(:one)
|
6
|
-
end
|
7
|
-
|
8
|
-
test "should get index" do
|
9
|
-
get foos_url
|
10
|
-
assert_response :success
|
11
|
-
end
|
12
|
-
|
13
|
-
test "should get new" do
|
14
|
-
get new_foo_url
|
15
|
-
assert_response :success
|
16
|
-
end
|
17
|
-
|
18
|
-
test "should create foo" do
|
19
|
-
assert_difference('Foo.count') do
|
20
|
-
post foos_url, params: { foo: { } }
|
21
|
-
end
|
22
|
-
|
23
|
-
assert_redirected_to foo_url(Foo.last)
|
24
|
-
end
|
25
|
-
|
26
|
-
test "should show foo" do
|
27
|
-
get foo_url(@foo)
|
28
|
-
assert_response :success
|
29
|
-
end
|
30
|
-
|
31
|
-
test "should get edit" do
|
32
|
-
get edit_foo_url(@foo)
|
33
|
-
assert_response :success
|
34
|
-
end
|
35
|
-
|
36
|
-
test "should update foo" do
|
37
|
-
patch foo_url(@foo), params: { foo: { } }
|
38
|
-
assert_redirected_to foo_url(@foo)
|
39
|
-
end
|
40
|
-
|
41
|
-
test "should destroy foo" do
|
42
|
-
assert_difference('Foo.count', -1) do
|
43
|
-
delete foo_url(@foo)
|
44
|
-
end
|
45
|
-
|
46
|
-
assert_redirected_to foos_url
|
47
|
-
end
|
48
|
-
end
|
@@ -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
|
-
<% if options[:default] %>environment: <%= options[:default] %><% else %># environment: 'live'<% end %>
|
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
|
-
<% if options[:retain_environment] %>retain_environment: <%= options[:retain_environment] %><% else %># retain_environment: false<% end %>
|