high_voltage 2.2.0 → 2.3.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 +4 -4
- data/.gitignore +1 -4
- data/.travis.yml +13 -4
- data/Appraisals +3 -10
- data/CONTRIBUTING.md +4 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +61 -42
- data/MIT-LICENSE +1 -1
- data/NEWS.md +8 -0
- data/README.md +71 -10
- data/Rakefile +9 -4
- data/app/controllers/concerns/high_voltage/static_page.rb +7 -1
- data/gemfiles/rails4.0.gemfile +10 -0
- data/gemfiles/rails4.1.gemfile +10 -0
- data/gemfiles/rails4.2.gemfile +10 -0
- data/high_voltage.gemspec +1 -2
- data/lib/high_voltage/engine.rb +10 -3
- data/lib/high_voltage/page_finder.rb +11 -1
- data/lib/high_voltage/version.rb +1 -1
- data/spec/constraints/root_route_spec.rb +4 -4
- data/spec/controllers/pages_controller_spec.rb +57 -52
- data/spec/fake_app.rb +18 -0
- data/spec/fixtures/config/database.yml +3 -0
- data/spec/high_voltage/page_finder_spec.rb +30 -14
- data/spec/spec_helper.rb +14 -8
- metadata +48 -113
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/config/application.rb +0 -43
- data/spec/dummy/config/boot.rb +0 -10
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -25
- data/spec/dummy/config/environments/production.rb +0 -49
- data/spec/dummy/config/environments/test.rb +0 -30
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -10
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_key_base.rb +0 -1
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -26
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/application.js +0 -2
- data/spec/dummy/public/javascripts/controls.js +0 -965
- data/spec/dummy/public/javascripts/dragdrop.js +0 -974
- data/spec/dummy/public/javascripts/effects.js +0 -1123
- data/spec/dummy/public/javascripts/prototype.js +0 -6001
- data/spec/dummy/public/javascripts/rails.js +0 -191
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/rails +0 -6
- /data/spec/{dummy → fixtures}/app/views/layouts/alternate.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/layouts/application.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/other/wrong.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/other_pages/also_dir/also_nested.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/other_pages/also_exists.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/other_pages/also_exists_but_references_nonexistent_partial.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/also_dir/also_nested.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/also_exists.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/also_exists_but_references_nonexistent_partial.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/dir/nested.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/exists.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/exists_but_references_nonexistent_partial.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/rot13.html.erb +0 -0
- /data/spec/{dummy → fixtures}/config/routes.rb +0 -0
- /data/spec/{dummy → fixtures}/public/pages/exists.html +0 -0
- /data/spec/{dummy → support}/app/controllers/alternative_finder_controller.rb +0 -0
- /data/spec/{dummy → support}/app/controllers/subclassed_pages_controller.rb +0 -0
|
@@ -1,108 +1,113 @@
|
|
|
1
|
-
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require "spec_helper"
|
|
2
4
|
|
|
3
5
|
describe HighVoltage::PagesController do
|
|
4
6
|
render_views
|
|
5
7
|
|
|
6
|
-
context
|
|
7
|
-
describe
|
|
8
|
-
before { get :show, :
|
|
8
|
+
context "using default configuration" do
|
|
9
|
+
describe "on GET to /pages/exists" do
|
|
10
|
+
before { get :show, id: "exists" }
|
|
9
11
|
|
|
10
|
-
it
|
|
12
|
+
it "responds with success and render template" do
|
|
11
13
|
expect(response).to be_success
|
|
12
|
-
expect(response).to render_template(
|
|
14
|
+
expect(response).to render_template("exists")
|
|
13
15
|
end
|
|
14
16
|
|
|
15
|
-
it
|
|
16
|
-
expect(response).to render_template(
|
|
17
|
+
it "uses the default layout used by ApplicationController" do
|
|
18
|
+
expect(response).to render_template("layouts/application")
|
|
17
19
|
end
|
|
18
20
|
end
|
|
19
21
|
|
|
20
|
-
describe
|
|
21
|
-
before { get :show, :
|
|
22
|
+
describe "on GET to /pages/dir/nested" do
|
|
23
|
+
before { get :show, id: "dir/nested" }
|
|
22
24
|
|
|
23
|
-
it
|
|
25
|
+
it "responds with success and render template" do
|
|
24
26
|
expect(response).to be_success
|
|
25
|
-
expect(response).to render_template(
|
|
27
|
+
expect(response).to render_template("pages/dir/nested")
|
|
26
28
|
end
|
|
27
29
|
end
|
|
28
30
|
|
|
29
|
-
it
|
|
30
|
-
expect { get :show, id:
|
|
31
|
-
|
|
31
|
+
it "raises a routing error for an invalid page" do
|
|
32
|
+
expect { get :show, id: "invalid" }.
|
|
33
|
+
to raise_error(ActionController::RoutingError)
|
|
32
34
|
end
|
|
33
35
|
|
|
34
|
-
it
|
|
35
|
-
expect { get :show, id:
|
|
36
|
-
|
|
36
|
+
it "raises a routing error for a page in another directory" do
|
|
37
|
+
expect { get :show, id: "../other/wrong" }.
|
|
38
|
+
to raise_error(ActionController::RoutingError)
|
|
37
39
|
end
|
|
38
40
|
|
|
39
|
-
it
|
|
40
|
-
expect { get :show, id:
|
|
41
|
-
|
|
41
|
+
it "raises a missing template error for valid page with invalid partial" do
|
|
42
|
+
expect { get :show, id: "exists_but_references_nonexistent_partial" }.
|
|
43
|
+
to raise_error(ActionView::MissingTemplate)
|
|
42
44
|
end
|
|
43
45
|
end
|
|
44
46
|
|
|
45
|
-
context
|
|
47
|
+
context "using custom layout" do
|
|
46
48
|
before(:each) do
|
|
47
|
-
HighVoltage.layout =
|
|
49
|
+
HighVoltage.layout = "alternate"
|
|
48
50
|
end
|
|
49
51
|
|
|
50
|
-
describe
|
|
51
|
-
before { get :show, :
|
|
52
|
+
describe "on GET to /pages/exists" do
|
|
53
|
+
before { get :show, id: "exists" }
|
|
52
54
|
|
|
53
|
-
it
|
|
54
|
-
expect(response).not_to render_template(
|
|
55
|
-
expect(response).to render_template(
|
|
55
|
+
it "uses the custom configured layout" do
|
|
56
|
+
expect(response).not_to render_template("layouts/application")
|
|
57
|
+
expect(response).to render_template("layouts/alternate")
|
|
56
58
|
end
|
|
57
59
|
end
|
|
58
60
|
end
|
|
59
61
|
|
|
60
|
-
context
|
|
62
|
+
context "using custom content path" do
|
|
61
63
|
before(:each) do
|
|
62
|
-
HighVoltage.content_path =
|
|
64
|
+
HighVoltage.content_path = "other_pages/"
|
|
63
65
|
Rails.application.reload_routes!
|
|
64
66
|
end
|
|
65
67
|
|
|
66
|
-
describe
|
|
67
|
-
before { get :show, :
|
|
68
|
+
describe "on GET to /other_pages/also_exists" do
|
|
69
|
+
before { get :show, id: "also_exists" }
|
|
68
70
|
|
|
69
|
-
it
|
|
71
|
+
it "responds with success and render template" do
|
|
70
72
|
expect(response).to be_success
|
|
71
|
-
expect(response).to render_template(
|
|
73
|
+
expect(response).to render_template("other_pages/also_exists")
|
|
72
74
|
end
|
|
73
75
|
end
|
|
74
76
|
|
|
75
|
-
describe
|
|
76
|
-
before { get :show, :
|
|
77
|
+
describe "on GET to /other_pages/also_dir/nested" do
|
|
78
|
+
before { get :show, id: "also_dir/also_nested" }
|
|
77
79
|
|
|
78
|
-
it
|
|
80
|
+
it "responds with success and render template" do
|
|
79
81
|
expect(response).to be_success
|
|
80
|
-
expect(response).to render_template(
|
|
82
|
+
expect(response).to render_template("other_pages/also_dir/also_nested")
|
|
81
83
|
end
|
|
82
84
|
end
|
|
83
85
|
|
|
84
|
-
it
|
|
85
|
-
expect { get :show, id:
|
|
86
|
-
|
|
86
|
+
it "raises a routing error for an invalid page" do
|
|
87
|
+
expect { get :show, id: "also_invalid" }.
|
|
88
|
+
to raise_error(ActionController::RoutingError)
|
|
89
|
+
|
|
90
|
+
expect { get :show, id: "√®ø" }.
|
|
91
|
+
to raise_error(ActionController::RoutingError)
|
|
87
92
|
end
|
|
88
93
|
|
|
89
|
-
context
|
|
90
|
-
it
|
|
91
|
-
expect { get :show, id:
|
|
92
|
-
|
|
94
|
+
context "page in another directory" do
|
|
95
|
+
it "raises a routing error" do
|
|
96
|
+
expect { get :show, id: "../other_wrong" }.
|
|
97
|
+
to raise_error(ActionController::RoutingError)
|
|
93
98
|
end
|
|
94
99
|
|
|
95
|
-
it
|
|
96
|
-
expect { get :show, id:
|
|
97
|
-
|
|
100
|
+
it "raises a routing error when using a Unicode exploit" do
|
|
101
|
+
expect { get :show, id: "/\\../other/wrong" }.
|
|
102
|
+
to raise_error(ActionController::RoutingError)
|
|
98
103
|
end
|
|
99
104
|
end
|
|
100
105
|
|
|
101
|
-
it
|
|
102
|
-
id =
|
|
106
|
+
it "raises a missing template error for valid page with invalid partial" do
|
|
107
|
+
id = "also_exists_but_references_nonexistent_partial"
|
|
103
108
|
|
|
104
|
-
expect { get :show, id: id }
|
|
105
|
-
|
|
109
|
+
expect { get :show, id: id }.
|
|
110
|
+
to raise_error(ActionView::MissingTemplate)
|
|
106
111
|
end
|
|
107
112
|
end
|
|
108
113
|
end
|
data/spec/fake_app.rb
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class ApplicationController < ActionController::Base
|
|
2
|
+
protect_from_forgery
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
# Create a rails app
|
|
6
|
+
module Dummy
|
|
7
|
+
class Application < Rails::Application
|
|
8
|
+
config.secret_key_base = "test"
|
|
9
|
+
config.paths["public"] = ["spec/fixtures/public"]
|
|
10
|
+
config.paths["config/routes.rb"] = ["spec/fixtures/config/routes.rb"]
|
|
11
|
+
config.paths["app/views"] = ["spec/fixtures/app/views"]
|
|
12
|
+
config.paths["app/controllers"] = ["spec/support/app/controllers"]
|
|
13
|
+
config.eager_load = false
|
|
14
|
+
config.action_controller.perform_caching = true
|
|
15
|
+
config.action_controller.cache_store = :memory_store
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
Dummy::Application.initialize!
|
|
@@ -1,34 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require "spec_helper"
|
|
2
4
|
|
|
3
5
|
describe HighVoltage::PageFinder do
|
|
4
|
-
it
|
|
5
|
-
expect(find(
|
|
6
|
+
it "produces the name of an existing template" do
|
|
7
|
+
expect(find("existing")).to eq "pages/existing"
|
|
6
8
|
end
|
|
7
9
|
|
|
8
|
-
it
|
|
9
|
-
expect(find(
|
|
10
|
+
it "produces the name of a nested template" do
|
|
11
|
+
expect(find("dir/nested")).to eq "pages/dir/nested"
|
|
10
12
|
end
|
|
11
13
|
|
|
12
|
-
it
|
|
13
|
-
with_content_path(
|
|
14
|
-
expect(find(
|
|
14
|
+
it "uses a custom content path" do
|
|
15
|
+
with_content_path("other_pages/") do
|
|
16
|
+
expect(find("also_exists")).to eq "other_pages/also_exists"
|
|
15
17
|
end
|
|
16
18
|
end
|
|
17
19
|
|
|
18
|
-
it
|
|
19
|
-
with_content_path(
|
|
20
|
-
expect(page_finder.content_path).to eq
|
|
20
|
+
it "exposes the content path" do
|
|
21
|
+
with_content_path("another_thing/") do
|
|
22
|
+
expect(page_finder.content_path).to eq "another_thing/"
|
|
21
23
|
end
|
|
22
24
|
end
|
|
23
25
|
|
|
24
|
-
it
|
|
26
|
+
it "provides the page_id" do
|
|
25
27
|
subclass = Class.new(HighVoltage::PageFinder) do
|
|
26
28
|
def page_name
|
|
27
29
|
"the page is #{page_id}"
|
|
28
30
|
end
|
|
29
31
|
end
|
|
30
32
|
|
|
31
|
-
expect(subclass.new(
|
|
33
|
+
expect(subclass.new("sweet page").page_name).to eq "the page is sweet page"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
it "removes invalid characters from the page_id" do
|
|
37
|
+
expect(find("b\\a…d√")).to eq "pages/bad"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
context "sanitized page_id" do
|
|
41
|
+
it "throws an exception if the page_id is empty" do
|
|
42
|
+
expect { find("\\…√") }.to raise_error HighVoltage::InvalidPageIdError
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it "throws an exception if the page_id is just a file extension" do
|
|
46
|
+
expect { find("\\√.zip") }.to raise_error HighVoltage::InvalidPageIdError
|
|
47
|
+
end
|
|
32
48
|
end
|
|
33
49
|
|
|
34
50
|
private
|
|
@@ -37,7 +53,7 @@ describe HighVoltage::PageFinder do
|
|
|
37
53
|
page_finder(page_id).find
|
|
38
54
|
end
|
|
39
55
|
|
|
40
|
-
def page_finder(page_id =
|
|
56
|
+
def page_finder(page_id = "whatever")
|
|
41
57
|
HighVoltage::PageFinder.new(page_id)
|
|
42
58
|
end
|
|
43
59
|
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
ENV[
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
|
2
2
|
|
|
3
|
-
require
|
|
3
|
+
require "pry"
|
|
4
|
+
require "active_model/railtie"
|
|
5
|
+
require "action_controller/railtie"
|
|
6
|
+
require "action_view/railtie"
|
|
7
|
+
require "actionpack/action_caching/railtie"
|
|
8
|
+
require "actionpack/page_caching/railtie"
|
|
9
|
+
require "rspec/rails"
|
|
4
10
|
|
|
5
|
-
require
|
|
6
|
-
require
|
|
7
|
-
require 'rspec/expectations'
|
|
8
|
-
require 'rspec/rails'
|
|
11
|
+
require "high_voltage"
|
|
12
|
+
require "fake_app"
|
|
9
13
|
|
|
10
14
|
Rails.backtrace_cleaner.remove_silencers!
|
|
11
15
|
|
|
12
|
-
Dir[File.dirname(__FILE__) +
|
|
16
|
+
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each { |file| require file }
|
|
13
17
|
|
|
14
18
|
RSpec.configure do |config|
|
|
19
|
+
config.infer_spec_type_from_file_location!
|
|
20
|
+
|
|
15
21
|
config.after(:each) do
|
|
16
22
|
HighVoltage.set_default_configuration
|
|
17
23
|
Rails.application.reload_routes!
|
|
@@ -23,5 +29,5 @@ RSpec.configure do |config|
|
|
|
23
29
|
|
|
24
30
|
config.include RSpec::Matchers
|
|
25
31
|
config.mock_with :rspec
|
|
26
|
-
config.order =
|
|
32
|
+
config.order = "random"
|
|
27
33
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: high_voltage
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Jankowski
|
|
@@ -16,7 +16,7 @@ authors:
|
|
|
16
16
|
autorequire:
|
|
17
17
|
bindir: bin
|
|
18
18
|
cert_chain: []
|
|
19
|
-
date:
|
|
19
|
+
date: 2015-04-17 00:00:00.000000000 Z
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
22
22
|
name: activesupport
|
|
@@ -32,20 +32,6 @@ dependencies:
|
|
|
32
32
|
- - ">="
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
34
|
version: 3.1.0
|
|
35
|
-
- !ruby/object:Gem::Dependency
|
|
36
|
-
name: appraisal
|
|
37
|
-
requirement: !ruby/object:Gem::Requirement
|
|
38
|
-
requirements:
|
|
39
|
-
- - ">="
|
|
40
|
-
- !ruby/object:Gem::Version
|
|
41
|
-
version: '0'
|
|
42
|
-
type: :development
|
|
43
|
-
prerelease: false
|
|
44
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
45
|
-
requirements:
|
|
46
|
-
- - ">="
|
|
47
|
-
- !ruby/object:Gem::Version
|
|
48
|
-
version: '0'
|
|
49
35
|
- !ruby/object:Gem::Dependency
|
|
50
36
|
name: pry
|
|
51
37
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -64,16 +50,16 @@ dependencies:
|
|
|
64
50
|
name: rspec-rails
|
|
65
51
|
requirement: !ruby/object:Gem::Requirement
|
|
66
52
|
requirements:
|
|
67
|
-
- - "
|
|
53
|
+
- - "~>"
|
|
68
54
|
- !ruby/object:Gem::Version
|
|
69
|
-
version:
|
|
55
|
+
version: 3.2.0
|
|
70
56
|
type: :development
|
|
71
57
|
prerelease: false
|
|
72
58
|
version_requirements: !ruby/object:Gem::Requirement
|
|
73
59
|
requirements:
|
|
74
|
-
- - "
|
|
60
|
+
- - "~>"
|
|
75
61
|
- !ruby/object:Gem::Version
|
|
76
|
-
version:
|
|
62
|
+
version: 3.2.0
|
|
77
63
|
description: Fire in the disco. Fire in the ... taco bell.
|
|
78
64
|
email:
|
|
79
65
|
- support@thoughtbot.com
|
|
@@ -94,6 +80,9 @@ files:
|
|
|
94
80
|
- app/controllers/concerns/high_voltage/static_page.rb
|
|
95
81
|
- app/controllers/high_voltage/pages_controller.rb
|
|
96
82
|
- config/routes.rb
|
|
83
|
+
- gemfiles/rails4.0.gemfile
|
|
84
|
+
- gemfiles/rails4.1.gemfile
|
|
85
|
+
- gemfiles/rails4.2.gemfile
|
|
97
86
|
- high_voltage.gemspec
|
|
98
87
|
- lib/high_voltage.rb
|
|
99
88
|
- lib/high_voltage/configuration.rb
|
|
@@ -109,52 +98,23 @@ files:
|
|
|
109
98
|
- spec/controllers/page_caching_controller_spec.rb
|
|
110
99
|
- spec/controllers/pages_controller_spec.rb
|
|
111
100
|
- spec/controllers/subclassed_pages_controller_spec.rb
|
|
112
|
-
- spec/
|
|
113
|
-
- spec/
|
|
114
|
-
- spec/
|
|
115
|
-
- spec/
|
|
116
|
-
- spec/
|
|
117
|
-
- spec/
|
|
118
|
-
- spec/
|
|
119
|
-
- spec/
|
|
120
|
-
- spec/
|
|
121
|
-
- spec/
|
|
122
|
-
- spec/
|
|
123
|
-
- spec/
|
|
124
|
-
- spec/
|
|
125
|
-
- spec/
|
|
126
|
-
- spec/
|
|
127
|
-
- spec/
|
|
128
|
-
- spec/
|
|
129
|
-
- spec/dummy/app/views/pages/rot13.html.erb
|
|
130
|
-
- spec/dummy/config.ru
|
|
131
|
-
- spec/dummy/config/application.rb
|
|
132
|
-
- spec/dummy/config/boot.rb
|
|
133
|
-
- spec/dummy/config/environment.rb
|
|
134
|
-
- spec/dummy/config/environments/development.rb
|
|
135
|
-
- spec/dummy/config/environments/production.rb
|
|
136
|
-
- spec/dummy/config/environments/test.rb
|
|
137
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
|
138
|
-
- spec/dummy/config/initializers/inflections.rb
|
|
139
|
-
- spec/dummy/config/initializers/mime_types.rb
|
|
140
|
-
- spec/dummy/config/initializers/secret_key_base.rb
|
|
141
|
-
- spec/dummy/config/initializers/secret_token.rb
|
|
142
|
-
- spec/dummy/config/initializers/session_store.rb
|
|
143
|
-
- spec/dummy/config/locales/en.yml
|
|
144
|
-
- spec/dummy/config/routes.rb
|
|
145
|
-
- spec/dummy/public/404.html
|
|
146
|
-
- spec/dummy/public/422.html
|
|
147
|
-
- spec/dummy/public/500.html
|
|
148
|
-
- spec/dummy/public/favicon.ico
|
|
149
|
-
- spec/dummy/public/javascripts/application.js
|
|
150
|
-
- spec/dummy/public/javascripts/controls.js
|
|
151
|
-
- spec/dummy/public/javascripts/dragdrop.js
|
|
152
|
-
- spec/dummy/public/javascripts/effects.js
|
|
153
|
-
- spec/dummy/public/javascripts/prototype.js
|
|
154
|
-
- spec/dummy/public/javascripts/rails.js
|
|
155
|
-
- spec/dummy/public/pages/exists.html
|
|
156
|
-
- spec/dummy/public/stylesheets/.gitkeep
|
|
157
|
-
- spec/dummy/script/rails
|
|
101
|
+
- spec/fake_app.rb
|
|
102
|
+
- spec/fixtures/app/views/layouts/alternate.html.erb
|
|
103
|
+
- spec/fixtures/app/views/layouts/application.html.erb
|
|
104
|
+
- spec/fixtures/app/views/other/wrong.html.erb
|
|
105
|
+
- spec/fixtures/app/views/other_pages/also_dir/also_nested.html.erb
|
|
106
|
+
- spec/fixtures/app/views/other_pages/also_exists.html.erb
|
|
107
|
+
- spec/fixtures/app/views/other_pages/also_exists_but_references_nonexistent_partial.html.erb
|
|
108
|
+
- spec/fixtures/app/views/pages/also_dir/also_nested.html.erb
|
|
109
|
+
- spec/fixtures/app/views/pages/also_exists.html.erb
|
|
110
|
+
- spec/fixtures/app/views/pages/also_exists_but_references_nonexistent_partial.html.erb
|
|
111
|
+
- spec/fixtures/app/views/pages/dir/nested.html.erb
|
|
112
|
+
- spec/fixtures/app/views/pages/exists.html.erb
|
|
113
|
+
- spec/fixtures/app/views/pages/exists_but_references_nonexistent_partial.html.erb
|
|
114
|
+
- spec/fixtures/app/views/pages/rot13.html.erb
|
|
115
|
+
- spec/fixtures/config/database.yml
|
|
116
|
+
- spec/fixtures/config/routes.rb
|
|
117
|
+
- spec/fixtures/public/pages/exists.html
|
|
158
118
|
- spec/high_voltage/configuration_spec.rb
|
|
159
119
|
- spec/high_voltage/page_finder_spec.rb
|
|
160
120
|
- spec/high_voltage_spec.rb
|
|
@@ -163,6 +123,8 @@ files:
|
|
|
163
123
|
- spec/requests/home_page_spec.rb
|
|
164
124
|
- spec/routing/routes_spec.rb
|
|
165
125
|
- spec/spec_helper.rb
|
|
126
|
+
- spec/support/app/controllers/alternative_finder_controller.rb
|
|
127
|
+
- spec/support/app/controllers/subclassed_pages_controller.rb
|
|
166
128
|
homepage: http://github.com/thoughtbot/high_voltage
|
|
167
129
|
licenses:
|
|
168
130
|
- MIT
|
|
@@ -183,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
183
145
|
version: '0'
|
|
184
146
|
requirements: []
|
|
185
147
|
rubyforge_project:
|
|
186
|
-
rubygems_version: 2.
|
|
148
|
+
rubygems_version: 2.4.5
|
|
187
149
|
signing_key:
|
|
188
150
|
specification_version: 4
|
|
189
151
|
summary: Simple static page rendering controller
|
|
@@ -194,52 +156,23 @@ test_files:
|
|
|
194
156
|
- spec/controllers/page_caching_controller_spec.rb
|
|
195
157
|
- spec/controllers/pages_controller_spec.rb
|
|
196
158
|
- spec/controllers/subclassed_pages_controller_spec.rb
|
|
197
|
-
- spec/
|
|
198
|
-
- spec/
|
|
199
|
-
- spec/
|
|
200
|
-
- spec/
|
|
201
|
-
- spec/
|
|
202
|
-
- spec/
|
|
203
|
-
- spec/
|
|
204
|
-
- spec/
|
|
205
|
-
- spec/
|
|
206
|
-
- spec/
|
|
207
|
-
- spec/
|
|
208
|
-
- spec/
|
|
209
|
-
- spec/
|
|
210
|
-
- spec/
|
|
211
|
-
- spec/
|
|
212
|
-
- spec/
|
|
213
|
-
- spec/
|
|
214
|
-
- spec/dummy/app/views/pages/rot13.html.erb
|
|
215
|
-
- spec/dummy/config.ru
|
|
216
|
-
- spec/dummy/config/application.rb
|
|
217
|
-
- spec/dummy/config/boot.rb
|
|
218
|
-
- spec/dummy/config/environment.rb
|
|
219
|
-
- spec/dummy/config/environments/development.rb
|
|
220
|
-
- spec/dummy/config/environments/production.rb
|
|
221
|
-
- spec/dummy/config/environments/test.rb
|
|
222
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
|
223
|
-
- spec/dummy/config/initializers/inflections.rb
|
|
224
|
-
- spec/dummy/config/initializers/mime_types.rb
|
|
225
|
-
- spec/dummy/config/initializers/secret_key_base.rb
|
|
226
|
-
- spec/dummy/config/initializers/secret_token.rb
|
|
227
|
-
- spec/dummy/config/initializers/session_store.rb
|
|
228
|
-
- spec/dummy/config/locales/en.yml
|
|
229
|
-
- spec/dummy/config/routes.rb
|
|
230
|
-
- spec/dummy/public/404.html
|
|
231
|
-
- spec/dummy/public/422.html
|
|
232
|
-
- spec/dummy/public/500.html
|
|
233
|
-
- spec/dummy/public/favicon.ico
|
|
234
|
-
- spec/dummy/public/javascripts/application.js
|
|
235
|
-
- spec/dummy/public/javascripts/controls.js
|
|
236
|
-
- spec/dummy/public/javascripts/dragdrop.js
|
|
237
|
-
- spec/dummy/public/javascripts/effects.js
|
|
238
|
-
- spec/dummy/public/javascripts/prototype.js
|
|
239
|
-
- spec/dummy/public/javascripts/rails.js
|
|
240
|
-
- spec/dummy/public/pages/exists.html
|
|
241
|
-
- spec/dummy/public/stylesheets/.gitkeep
|
|
242
|
-
- spec/dummy/script/rails
|
|
159
|
+
- spec/fake_app.rb
|
|
160
|
+
- spec/fixtures/app/views/layouts/alternate.html.erb
|
|
161
|
+
- spec/fixtures/app/views/layouts/application.html.erb
|
|
162
|
+
- spec/fixtures/app/views/other/wrong.html.erb
|
|
163
|
+
- spec/fixtures/app/views/other_pages/also_dir/also_nested.html.erb
|
|
164
|
+
- spec/fixtures/app/views/other_pages/also_exists.html.erb
|
|
165
|
+
- spec/fixtures/app/views/other_pages/also_exists_but_references_nonexistent_partial.html.erb
|
|
166
|
+
- spec/fixtures/app/views/pages/also_dir/also_nested.html.erb
|
|
167
|
+
- spec/fixtures/app/views/pages/also_exists.html.erb
|
|
168
|
+
- spec/fixtures/app/views/pages/also_exists_but_references_nonexistent_partial.html.erb
|
|
169
|
+
- spec/fixtures/app/views/pages/dir/nested.html.erb
|
|
170
|
+
- spec/fixtures/app/views/pages/exists.html.erb
|
|
171
|
+
- spec/fixtures/app/views/pages/exists_but_references_nonexistent_partial.html.erb
|
|
172
|
+
- spec/fixtures/app/views/pages/rot13.html.erb
|
|
173
|
+
- spec/fixtures/config/database.yml
|
|
174
|
+
- spec/fixtures/config/routes.rb
|
|
175
|
+
- spec/fixtures/public/pages/exists.html
|
|
243
176
|
- spec/high_voltage/configuration_spec.rb
|
|
244
177
|
- spec/high_voltage/page_finder_spec.rb
|
|
245
178
|
- spec/high_voltage_spec.rb
|
|
@@ -248,3 +181,5 @@ test_files:
|
|
|
248
181
|
- spec/requests/home_page_spec.rb
|
|
249
182
|
- spec/routing/routes_spec.rb
|
|
250
183
|
- spec/spec_helper.rb
|
|
184
|
+
- spec/support/app/controllers/alternative_finder_controller.rb
|
|
185
|
+
- spec/support/app/controllers/subclassed_pages_controller.rb
|
data/spec/dummy/Rakefile
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
|
2
|
-
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
|
3
|
-
|
|
4
|
-
require File.expand_path('../config/application', __FILE__)
|
|
5
|
-
require 'rake'
|
|
6
|
-
|
|
7
|
-
Dummy::Application.load_tasks
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
require File.expand_path('../boot', __FILE__)
|
|
2
|
-
|
|
3
|
-
require "active_model/railtie"
|
|
4
|
-
require "action_controller/railtie"
|
|
5
|
-
require "action_view/railtie"
|
|
6
|
-
|
|
7
|
-
Bundler.require
|
|
8
|
-
require "high_voltage"
|
|
9
|
-
|
|
10
|
-
module Dummy
|
|
11
|
-
class Application < Rails::Application
|
|
12
|
-
# Settings in config/environments/* take precedence over those specified here.
|
|
13
|
-
# Application configuration should go into files in config/initializers
|
|
14
|
-
# -- all .rb files in that directory are automatically loaded.
|
|
15
|
-
|
|
16
|
-
# Custom directories with classes and modules you want to be autoloadable.
|
|
17
|
-
# config.autoload_paths += %W(#{config.root}/extras)
|
|
18
|
-
|
|
19
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
|
20
|
-
# :all can be used as a placeholder for all plugins not explicitly named.
|
|
21
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
|
22
|
-
|
|
23
|
-
# Activate observers that should always be running.
|
|
24
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
|
25
|
-
|
|
26
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
|
27
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
|
28
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
|
29
|
-
|
|
30
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
|
31
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
|
32
|
-
# config.i18n.default_locale = :de
|
|
33
|
-
|
|
34
|
-
# JavaScript files you want as :defaults (application.js is always included).
|
|
35
|
-
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
|
36
|
-
|
|
37
|
-
# Configure the default encoding used in templates for Ruby 1.9.
|
|
38
|
-
config.encoding = "utf-8"
|
|
39
|
-
|
|
40
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
|
41
|
-
config.filter_parameters += [:password]
|
|
42
|
-
end
|
|
43
|
-
end
|
data/spec/dummy/config/boot.rb
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
Dummy::Application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
3
|
-
|
|
4
|
-
# In the development environment your application's code is reloaded on
|
|
5
|
-
# every request. This slows down response time but is perfect for development
|
|
6
|
-
# since you don't have to restart the webserver when you make code changes.
|
|
7
|
-
config.cache_classes = false
|
|
8
|
-
|
|
9
|
-
# Log error messages when you accidentally call methods on nil.
|
|
10
|
-
config.whiny_nils = true
|
|
11
|
-
|
|
12
|
-
# Show full error reports and disable caching
|
|
13
|
-
config.consider_all_requests_local = true
|
|
14
|
-
config.action_controller.perform_caching = false
|
|
15
|
-
|
|
16
|
-
# Don't care if the mailer can't send
|
|
17
|
-
config.action_mailer.raise_delivery_errors = false
|
|
18
|
-
|
|
19
|
-
# Print deprecation notices to the Rails logger
|
|
20
|
-
config.active_support.deprecation = :log
|
|
21
|
-
|
|
22
|
-
# Only use best-standards-support built into browsers
|
|
23
|
-
config.action_dispatch.best_standards_support = :builtin
|
|
24
|
-
end
|
|
25
|
-
|