turnout 0.2.5 → 0.3.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: 158e82d9865bd39e8f14b5381d67707672625e77
4
- data.tar.gz: d0d0ccf1be0f39489cad42a119b5c5d29be918ae
3
+ metadata.gz: 4208ab9f575833c1136e95f562967f73c0d447ff
4
+ data.tar.gz: abac3c012ceb68cab13c4f743cc4ba99dd781340
5
5
  SHA512:
6
- metadata.gz: 6b58428790591d16d32de6501bb7a754434054c6a518f390d846922b661574bec8790f27737e7690e655ea67122f27e9532d57900b82fafc495aad4673019324
7
- data.tar.gz: fc2116ffc38a6cc34bf7c2f3f5fbbd7f1362d9c944edbb576b866b0385c0697f9fdba30c10b1864ba86917a6d6402883f22d9db2b5492a88e3a3559111e67412
6
+ metadata.gz: db27f6aa29b51d5821f9ae79edb5aecc9be8e428c6684d791f65e47424e2342b7a826ae5bc4bd991ba2692f9a0df2e0adc775cce5c097e874568a1ca83dbf189
7
+ data.tar.gz: 3285dd2df5fcefd131e1bde7ed4cef9f4c4f489380b25bd59b7c70fb8c6df5496dc3a078d832496bda6fe812131aec06e9fbad5c0feaeb9fdc596caba2fdb836
@@ -14,7 +14,7 @@ class Rack::Turnout
14
14
  reload_settings
15
15
 
16
16
  if on?
17
- [ 503, { 'Content-Type' => 'text/html', 'Content-Length' => content_length }, [content] ]
17
+ [ response_code, { 'Content-Type' => 'text/html', 'Content-Length' => content_length }, [content] ]
18
18
  else
19
19
  @app.call(env)
20
20
  end
@@ -104,4 +104,8 @@ class Rack::Turnout
104
104
 
105
105
  content
106
106
  end
107
- end
107
+
108
+ def response_code
109
+ settings['response_code'] || 503
110
+ end
111
+ end
@@ -4,7 +4,8 @@ namespace :maintenance do
4
4
  settings = {
5
5
  'reason' => ENV['reason'],
6
6
  'allowed_paths' => split_paths(ENV['allowed_paths']),
7
- 'allowed_ips' => split_ips(ENV['allowed_ips'])
7
+ 'allowed_ips' => split_ips(ENV['allowed_ips']),
8
+ 'response_code' => ENV['response_code']
8
9
  }
9
10
 
10
11
  file = File.open settings_file, 'w'
@@ -41,4 +42,4 @@ namespace :maintenance do
41
42
  def split_ips(ips_string)
42
43
  ips_string.to_s.split(',')
43
44
  end
44
- end
45
+ end
@@ -1,3 +1,3 @@
1
1
  module Turnout
2
- VERSION = '0.2.5'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turnout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.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: 2013-09-06 00:00:00.000000000 Z
11
+ date: 2014-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rack-test
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.12'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.12'
69
69
  description: Turnout makes it easy to put your Rails application into maintenance
@@ -73,16 +73,16 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - README.markdown
77
76
  - MIT-LICENSE
78
- - rails/init.rb
79
- - lib/turnout.rb
77
+ - README.markdown
80
78
  - lib/rack/turnout.rb
81
- - lib/turnout/version.rb
79
+ - lib/tasks/maintenance.rake
80
+ - lib/turnout.rb
82
81
  - lib/turnout/engine.rb
83
82
  - lib/turnout/rake_tasks.rb
84
- - lib/tasks/maintenance.rake
83
+ - lib/turnout/version.rb
85
84
  - public/maintenance.html
85
+ - rails/init.rb
86
86
  homepage: https://github.com/biola/turnout
87
87
  licenses:
88
88
  - MIT
@@ -93,17 +93,17 @@ require_paths:
93
93
  - lib
94
94
  required_ruby_version: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - '>='
96
+ - - ">="
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.0.3
106
+ rubygems_version: 2.2.2
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: A Rack based maintenance mode plugin for Rails