turnout 2.4.1 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/turnout/configuration.rb +15 -3
- data/lib/turnout/engine.rb +3 -5
- data/lib/turnout/maintenance_file.rb +1 -1
- data/lib/turnout/version.rb +1 -1
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28688f9c227f64ca86561cc5dcb53b9cb71448f8
|
4
|
+
data.tar.gz: 603319b24986962d1bc52602ab3246e518f6a664
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bde70a83589f2bb455fca464df8ec315ba72da60f2f89bac1aad6f35065f1966edcb1b71394f310ab4e7d89bd8354e67e9544894b8b290b617658d74eb25e9ac
|
7
|
+
data.tar.gz: 0a8de599aefd2a9570796893a36617defe67b1445d2d4f55221d8e68bdf499686f6df53782181eefe87572461bde2a6d3ddb5cfd2de34adf0dd07e791c315f5c
|
data/README.md
CHANGED
@@ -111,6 +111,7 @@ Turnout can be configured in two different ways:
|
|
111
111
|
|
112
112
|
```ruby
|
113
113
|
Turnout.configure do |config|
|
114
|
+
config.skip_middleware = true
|
114
115
|
config.app_root = '/some/path'
|
115
116
|
config.named_maintenance_file_paths = {app: 'tmp/app.yml', server: '/tmp/server.yml'}
|
116
117
|
config.maintenance_pages_path = 'app/views/maintenance'
|
@@ -1,21 +1,33 @@
|
|
1
1
|
require_relative './ordered_options'
|
2
2
|
module Turnout
|
3
3
|
class Configuration
|
4
|
-
SETTINGS = [
|
5
|
-
:
|
6
|
-
:
|
4
|
+
SETTINGS = [
|
5
|
+
:app_root,
|
6
|
+
:named_maintenance_file_paths,
|
7
|
+
:maintenance_pages_path,
|
8
|
+
:default_maintenance_page,
|
9
|
+
:default_reason,
|
10
|
+
:default_allowed_ips,
|
11
|
+
:skip_middleware,
|
12
|
+
:default_allowed_paths,
|
13
|
+
:default_response_code,
|
14
|
+
:default_retry_after,
|
15
|
+
:i18n
|
16
|
+
].freeze
|
7
17
|
|
8
18
|
SETTINGS.each do |setting|
|
9
19
|
attr_accessor setting
|
10
20
|
end
|
11
21
|
|
12
22
|
def initialize
|
23
|
+
@skip_middleware = false
|
13
24
|
@app_root = '.'
|
14
25
|
@named_maintenance_file_paths = {default: app_root.join('tmp', 'maintenance.yml').to_s}
|
15
26
|
@maintenance_pages_path = app_root.join('public').to_s
|
16
27
|
@default_maintenance_page = Turnout::MaintenancePage::HTML
|
17
28
|
@default_reason = "The site is temporarily down for maintenance.\nPlease check back soon."
|
18
29
|
@default_allowed_paths = []
|
30
|
+
@default_allowed_ips = []
|
19
31
|
@default_response_code = 503
|
20
32
|
@default_retry_after = 7200 # 2 hours by default
|
21
33
|
@i18n = Turnout::OrderedOptions.new
|
data/lib/turnout/engine.rb
CHANGED
@@ -7,11 +7,9 @@ if defined? Rails::Engine
|
|
7
7
|
module Turnout
|
8
8
|
class Engine < Rails::Engine
|
9
9
|
initializer 'turnout.add_to_middleware_stack' do |app|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
rake_tasks do
|
14
|
-
load 'tasks/maintenance.rake'
|
10
|
+
unless Turnout.config.skip_middleware
|
11
|
+
app.config.middleware.use(Rack::Turnout)
|
12
|
+
end
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|
@@ -12,7 +12,7 @@ module Turnout
|
|
12
12
|
@path = path
|
13
13
|
@reason = Turnout.config.default_reason
|
14
14
|
@allowed_paths = Turnout.config.default_allowed_paths
|
15
|
-
@allowed_ips =
|
15
|
+
@allowed_ips = Turnout.config.default_allowed_ips
|
16
16
|
@response_code = Turnout.config.default_response_code
|
17
17
|
@retry_after = Turnout.config.default_retry_after
|
18
18
|
|
data/lib/turnout/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turnout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Crownoble
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|
@@ -68,16 +68,22 @@ dependencies:
|
|
68
68
|
name: i18n
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
|
-
- - "
|
71
|
+
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0.7'
|
74
|
+
- - "<"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '2'
|
74
77
|
type: :runtime
|
75
78
|
prerelease: false
|
76
79
|
version_requirements: !ruby/object:Gem::Requirement
|
77
80
|
requirements:
|
78
|
-
- - "
|
81
|
+
- - ">="
|
79
82
|
- !ruby/object:Gem::Version
|
80
83
|
version: '0.7'
|
84
|
+
- - "<"
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '2'
|
81
87
|
- !ruby/object:Gem::Dependency
|
82
88
|
name: rack-test
|
83
89
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
215
|
version: '0'
|
210
216
|
requirements: []
|
211
217
|
rubyforge_project:
|
212
|
-
rubygems_version: 2.5.
|
218
|
+
rubygems_version: 2.5.2
|
213
219
|
signing_key:
|
214
220
|
specification_version: 4
|
215
221
|
summary: A Rack based maintenance mode plugin for Rails
|