rack-maintenance 1.2.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a53afd94dd0a604271a5cde5bb5b9b4c0fdcd6dc
4
- data.tar.gz: 271f1d25bad09379c36c417bbeb172b710ea49ac
3
+ metadata.gz: 00d9c81cf601e50ec54555b564e842dfff9eaff9
4
+ data.tar.gz: b95a117e0726e15354f091c1b8a6e1fb6b58fac5
5
5
  SHA512:
6
- metadata.gz: d69ec530a5e4cb128017be188495ac6ade119c54857f8f528222b8d2934d7ae63780ac80c9c12f862c9633511614da229b089cb162a96a4d54cbfe1cadc9f348
7
- data.tar.gz: 0d4d3545b0d3951932eba0af6599373f1e68e09b3562c0e683df7f78a208c72586d58710bdc089461785e729971be352b57886a62624f55404b8b4ee1592e353
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.
@@ -39,7 +39,7 @@ private ######################################################################
39
39
  end
40
40
 
41
41
  def path_in_app(env)
42
- env["PATH_INFO"] !~ /^\/assets/
42
+ env["PATH_INFO"] !~ options[:without]
43
43
  end
44
44
 
45
45
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Maintenance
3
- VERSION = "1.2.0"
3
+ VERSION = "2.0.0"
4
4
  end
5
5
  end
@@ -64,10 +64,16 @@ shared_examples "RackMaintenance" do
64
64
  end
65
65
  end
66
66
 
67
- context "and request to /assets" do
68
- it "calls the app" do
69
- app.should_receive(:call).once
70
- rack.call({"PATH_INFO"=>"/assets/application.css"})
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: 1.2.0
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-05-01 00:00:00.000000000 Z
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.14
91
+ rubygems_version: 2.0.3
78
92
  signing_key:
79
93
  specification_version: 4
80
94
  summary: Detect and show a maintenance page