rack-maintenance 1.2.0 → 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 +4 -4
- data/README.rdoc +11 -0
- data/lib/rack/maintenance.rb +1 -1
- data/lib/rack/maintenance/version.rb +1 -1
- data/spec/rack-maintenance_spec.rb +10 -4
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00d9c81cf601e50ec54555b564e842dfff9eaff9
|
4
|
+
data.tar.gz: b95a117e0726e15354f091c1b8a6e1fb6b58fac5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 018311df2e17fea006d1e638ee1e0b15c57c9b68ee2cff5d763c74291f9bc4f035a5d65e15baebc4069fffc8ddecd029f4ddfcdbb014c9882a94b178cd7690ca
|
7
|
+
data.tar.gz: 45d6334d82a8fe3a25e87f11c0823b5a24044a7b069feb738b3355905fc9fd494d203744b91e375d29a935250aab633806518c90f984f8d5a09bf3ce752bc3d1
|
data/README.rdoc
CHANGED
@@ -35,6 +35,17 @@ maintenance page if the environment variable is set.
|
|
35
35
|
|
36
36
|
If <tt>:env</tt> is not specified, the maintenance page will be shown if it exists.
|
37
37
|
|
38
|
+
# Leave some paths enabled while site is down
|
39
|
+
# You'll usually want to exclude /assets if you'd like to retain CSS.
|
40
|
+
# It also works for allowing access to admin while the rest is in maintenance mode.
|
41
|
+
config.middleware.use 'Rack::Maintenance',
|
42
|
+
:file => Rails.root.join('public', 'maintenance.html'),
|
43
|
+
:without => /\A\/assets/
|
44
|
+
|
45
|
+
If <tt>:paths</tt> is specified, only the paths specified in the given regular
|
46
|
+
expression will be put on maintenance mode. This is useful if you still want
|
47
|
+
access to an admin interface, as shown on the example.
|
48
|
+
|
38
49
|
== Note on Patches/Pull Requests
|
39
50
|
|
40
51
|
* Fork the project.
|
data/lib/rack/maintenance.rb
CHANGED
@@ -64,10 +64,16 @@ shared_examples "RackMaintenance" do
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
context "
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
context "without paths" do
|
68
|
+
let(:rack) { Rack::Maintenance.new(app, :file => file_name, :without => /\A\/assets/) }
|
69
|
+
|
70
|
+
it "enables access depending on the path" do
|
71
|
+
app.should_receive(:call).twice
|
72
|
+
rack.call({"PATH_INFO" => "/"})
|
73
|
+
rack.call({"PATH_INFO" => "/assets/application.css"})
|
74
|
+
rack.call({"PATH_INFO" => "/users"})
|
75
|
+
rack.call({"PATH_INFO" => "/assets/application.js"})
|
76
|
+
rack.call({"PATH_INFO" => "/stuff"})
|
71
77
|
end
|
72
78
|
end
|
73
79
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-maintenance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Dollar
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-09-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -58,7 +58,21 @@ files:
|
|
58
58
|
homepage: http://github.com/tilsammans/rack-maintenance
|
59
59
|
licenses: []
|
60
60
|
metadata: {}
|
61
|
-
post_install_message:
|
61
|
+
post_install_message: |2+
|
62
|
+
|
63
|
+
******** Rack::Maintenance 2.0.0 *********
|
64
|
+
|
65
|
+
Rack::Maintenance 2.0.0 has dropped the built-in filter for /assets.
|
66
|
+
This means that all your paths will now be blocked in maintenance
|
67
|
+
mode, unless you exclude them in the configuration.
|
68
|
+
|
69
|
+
To bring back pre-2.0.0 behaviour, configure the gem like so:
|
70
|
+
|
71
|
+
config.middleware.use 'Rack::Maintenance',
|
72
|
+
file: Rails.root.join("public", "maintenance.html"),
|
73
|
+
without: /\A\/assets/
|
74
|
+
|
75
|
+
|
62
76
|
rdoc_options: []
|
63
77
|
require_paths:
|
64
78
|
- lib
|
@@ -74,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
88
|
version: '0'
|
75
89
|
requirements: []
|
76
90
|
rubyforge_project:
|
77
|
-
rubygems_version: 2.0.
|
91
|
+
rubygems_version: 2.0.3
|
78
92
|
signing_key:
|
79
93
|
specification_version: 4
|
80
94
|
summary: Detect and show a maintenance page
|