maintenance_mode 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b2cca08b48be4097ada632ac661180edc79cd64f
4
- data.tar.gz: 6b025b13fdb30838929e7c2696f237d0f2f2b085
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ M2M0NDBkNDJjN2YxOWY1NmI4MDI4NzhmMTQ1MjNjYjVkNWZhZjU4MQ==
5
+ data.tar.gz: !binary |-
6
+ OTM2NjY0YzdhMDc1NTQ2NzQ5ZDYxYzRjOGZlMDI4ZWZhNzc3MjdhNQ==
5
7
  SHA512:
6
- metadata.gz: bbbe37a3660df19d604319eb21d893ef1bd04c012eae42df6fca8c75365e0980174433e8970d07d8220d3058784252ad53c008cb72dd08cf256bb9ae37b7c02c
7
- data.tar.gz: efb243a0d6c5015e2a3a0b97c81b8c442979a89bdf48447bcd91945009d48990913f4e09c0210c0d80ad198179b4b77549f0a6c4a1083161ad76b3b477d6a4a0
8
+ metadata.gz: !binary |-
9
+ NjIwNTFjZTZhNGQ2MTlhMjgyOWE2ZTQ2YWJmYzM1Yzg1NDE5ZDBkZTJkOTRl
10
+ MTQxNzExNTY4YTRmODY1ZDAzNTI2YzYyN2QwNjA3NGU5ZjBmNTllNjZjNGU1
11
+ OWFlNGFjY2E1YmY4MjZhMTZiNDk3YjgwNTAwZjJhM2FhMWM2MWM=
12
+ data.tar.gz: !binary |-
13
+ MjBiZWI2MDM3MjNmYjkyMTZkMzJjYjUzODUyYmQ3NTlmZDZhYzg2ZTMwMmZk
14
+ NjBlZmYwMTJmODY4OWU5Mzg0ZmQzMmFmMTMxZTdlZmUxNzBkOTA5M2RmODY1
15
+ NTYxZWJmZWUyMTFhNDA3NDVhZGYxMmE2Y2M0MzkzNDlkMTU2OWE=
@@ -11,7 +11,9 @@ class MaintenanceMode
11
11
  end
12
12
 
13
13
  def enable(message='')
14
- @pathname.write(message)
14
+ File.open(@pathname.to_s, 'w') do |f|
15
+ f.write(message)
16
+ end
15
17
  end
16
18
 
17
19
  def disable
@@ -1,3 +1,3 @@
1
1
  class MaintenanceMode
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.homepage = 'http://github.com/goodguide/maintenance_mode'
13
13
  spec.license = 'MIT'
14
14
 
15
- spec.required_ruby_version = '>= 2.1.0'
15
+ spec.required_ruby_version = '>= 2.0.0'
16
16
 
17
17
  all_files = `git ls-files -z`.split("\x0")
18
18
  spec.files = all_files - all_files.grep(%r{^.travis.yml})
@@ -8,6 +8,12 @@ class MaintenanceMode::FilePersistenceTest < Minitest::Test
8
8
  Pathname.new(@tempfile.path)
9
9
  end
10
10
 
11
+ def set_contents(contents)
12
+ File.open(_file, 'w') do |file|
13
+ file.write contents
14
+ end
15
+ end
16
+
11
17
  def setup
12
18
  _file.unlink
13
19
  end
@@ -41,7 +47,7 @@ class MaintenanceMode::FilePersistenceTest < Minitest::Test
41
47
  end
42
48
 
43
49
  def test_disable
44
- _file.write('foo')
50
+ set_contents('foo')
45
51
  assert _file.file?, 'file should exist'
46
52
  subject.disable
47
53
 
@@ -55,20 +61,20 @@ class MaintenanceMode::FilePersistenceTest < Minitest::Test
55
61
  end
56
62
 
57
63
  def test_enabled?
58
- _file.write('foo')
64
+ set_contents('foo')
59
65
  assert subject.enabled?
60
66
  _file.unlink
61
67
  assert !subject.enabled?
62
68
  end
63
69
 
64
70
  def test_message
65
- _file.write('foobar')
71
+ set_contents('foobar')
66
72
 
67
73
  assert_equal 'foobar', subject.message
68
74
  end
69
75
 
70
76
  def test_message_when_empty
71
- _file.write('')
77
+ set_contents('')
72
78
 
73
79
  assert_equal nil, subject.message
74
80
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maintenance_mode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Taylor Long
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-29 00:00:00.000000000 Z
11
+ date: 2015-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.9'
20
20
  type: :development
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.9'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
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: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: 5.6.1
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: 5.6.1
55
55
  description:
@@ -59,7 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - ".gitignore"
62
+ - .gitignore
63
63
  - Gemfile
64
64
  - LICENSE.txt
65
65
  - README.md
@@ -91,17 +91,17 @@ require_paths:
91
91
  - lib
92
92
  required_ruby_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - ! '>='
95
95
  - !ruby/object:Gem::Version
96
- version: 2.1.0
96
+ version: 2.0.0
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - ">="
99
+ - - ! '>='
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.2.2
104
+ rubygems_version: 2.4.5
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: This provides a simple interface to a 'maintenance mode' toggle with optional