guard-spring 1.0.0 → 1.1.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 +6 -0
- data/lib/guard/spring.rb +2 -2
- data/lib/guard/spring/runner.rb +3 -3
- data/lib/guard/spring/version.rb +1 -2
- data/spec/guard/spring/runner_spec.rb +1 -1
- data/spec/guard/spring_spec.rb +7 -7
- data/spec/spec_helper.rb +9 -2
- metadata +73 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe476decb048298823af31c88781b964eb721da2
|
4
|
+
data.tar.gz: ff43048bdaba06cbf644f87725ec3dbbdd15ea7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bc9220db7e642ba253b81b7b12d5078b6c779c4efbb4edc07198515f50127c2c8a642439f7628e21a0d87e10219af83e2c549f555a70df02f41870953e3bc0c
|
7
|
+
data.tar.gz: 687a6287046fcea62961a975637802e4e2baa1c7ca7f3582cfcb71214ccead040f8af4e4aeaaf8ea7f0ddd1f7ead0e941b252237cd62d06369dfdac283549a07
|
data/README.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/mknapik/guard-spring.svg?branch=master)](https://travis-ci.org/mknapik/guard-spring)
|
2
|
+
[![Dependency Status](https://gemnasium.com/mknapik/guard-spring.svg)](https://gemnasium.com/mknapik/guard-spring)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/mknapik/guard-spring/badges/gpa.svg)](https://codeclimate.com/github/mknapik/guard-spring)
|
4
|
+
[![Test Coverage](https://codeclimate.com/github/mknapik/guard-spring/badges/coverage.svg)](https://codeclimate.com/github/mknapik/guard-spring/coverage)
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/guard-spring.svg)](http://badge.fury.io/rb/guard-spring)
|
6
|
+
|
1
7
|
# Guard::Spring
|
2
8
|
|
3
9
|
Guard::Spring starts, stops, and restarts [Spring](https://github.com/jonleighton/spring) - Rails application preloader. This plugin therefore most importantly ensures that Spring is not left running when Guard is stopped.
|
data/lib/guard/spring.rb
CHANGED
@@ -42,14 +42,14 @@ module Guard
|
|
42
42
|
# Called on file(s) modifications that the Guard watches.
|
43
43
|
# @param [Array<String>] paths the changes files or paths
|
44
44
|
# @raise [:task_has_failed] when run_on_change has failed
|
45
|
-
def run_on_changes(
|
45
|
+
def run_on_changes(_paths)
|
46
46
|
runner.restart
|
47
47
|
end
|
48
48
|
|
49
49
|
# Called on file(s) deletions that the Guard watches.
|
50
50
|
# @param [Array<String>] paths the deleted files or paths
|
51
51
|
# @raise [:task_has_failed] when run_on_change has failed
|
52
|
-
def run_on_removals(
|
52
|
+
def run_on_removals(_paths)
|
53
53
|
runner.restart
|
54
54
|
end
|
55
55
|
end
|
data/lib/guard/spring/runner.rb
CHANGED
@@ -11,17 +11,17 @@ module Guard
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def start
|
14
|
-
UI.info
|
14
|
+
UI.info 'Guard::Spring starting Spring'
|
15
15
|
start_spring
|
16
16
|
end
|
17
17
|
|
18
18
|
def stop
|
19
|
-
UI.info
|
19
|
+
UI.info 'Guard::Spring stopping Spring'
|
20
20
|
stop_spring
|
21
21
|
end
|
22
22
|
|
23
23
|
def restart
|
24
|
-
UI.info
|
24
|
+
UI.info 'Guard::Spring restarting Spring'
|
25
25
|
stop_spring
|
26
26
|
start_spring
|
27
27
|
end
|
data/lib/guard/spring/version.rb
CHANGED
data/spec/guard/spring_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Guard::Spring do
|
4
4
|
describe '#initialize' do
|
5
|
-
it
|
5
|
+
it 'instantiates Runner with given options' do
|
6
6
|
expect(described_class::Runner).to receive(:new).with(foo: 'bar')
|
7
7
|
described_class.new(foo: 'bar')
|
8
8
|
end
|
@@ -17,41 +17,41 @@ describe Guard::Spring do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
describe '#start' do
|
20
|
-
it
|
20
|
+
it 'call runner.start' do
|
21
21
|
expect(runner).to receive(:start).with(no_args)
|
22
22
|
plugin_instance.start
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
describe '#stop' do
|
27
|
-
it
|
27
|
+
it 'call runner.stop' do
|
28
28
|
expect(runner).to receive(:stop).with(no_args)
|
29
29
|
plugin_instance.stop
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
describe '#reload' do
|
34
|
-
it
|
34
|
+
it 'calls runner.restart' do
|
35
35
|
expect(runner).to receive(:restart).with(no_args)
|
36
36
|
plugin_instance.reload
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
describe '#run_all' do
|
41
|
-
it
|
41
|
+
it 'does nothing' do
|
42
42
|
plugin_instance.run_all
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
46
|
describe '#run_on_changes' do
|
47
|
-
it
|
47
|
+
it 'calls runner.restart' do
|
48
48
|
expect(runner).to receive(:restart).with(no_args)
|
49
49
|
plugin_instance.run_on_changes('foo')
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
53
|
describe '#run_on_removals' do
|
54
|
-
it
|
54
|
+
it 'calls runner.restart' do
|
55
55
|
expect(runner).to receive(:restart).with(no_args)
|
56
56
|
plugin_instance.run_on_removals('foo')
|
57
57
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
|
2
|
+
|
3
|
+
if ENV['COVERAGE']
|
3
4
|
require 'simplecov'
|
5
|
+
require 'codeclimate-test-reporter'
|
6
|
+
|
7
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
8
|
+
SimpleCov::Formatter::HTMLFormatter,
|
9
|
+
CodeClimate::TestReporter::Formatter,
|
10
|
+
]
|
4
11
|
SimpleCov.start do
|
5
12
|
add_group 'Guard::Spring', 'lib/guard'
|
6
13
|
add_group 'Specs', 'spec'
|
@@ -11,7 +18,7 @@ require 'rspec'
|
|
11
18
|
require 'guard/compat/test/helper'
|
12
19
|
require 'guard/spring'
|
13
20
|
|
14
|
-
ENV[
|
21
|
+
ENV['GUARD_ENV'] = 'test'
|
15
22
|
|
16
23
|
RSpec.configure do |config|
|
17
24
|
config.before(:each) do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-spring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michał Knapik
|
@@ -52,6 +52,62 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.7'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.7'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '10.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.31'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.31'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.3'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.3'
|
55
111
|
- !ruby/object:Gem::Dependency
|
56
112
|
name: rspec
|
57
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,9 +136,23 @@ dependencies:
|
|
80
136
|
- - ">="
|
81
137
|
- !ruby/object:Gem::Version
|
82
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: codeclimate-test-reporter
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
83
153
|
description: Guard::Spring automatically runs tests with spring
|
84
154
|
email:
|
85
|
-
-
|
155
|
+
- michal@knapik.me
|
86
156
|
executables: []
|
87
157
|
extensions: []
|
88
158
|
extra_rdoc_files: []
|
@@ -116,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
186
|
version: '0'
|
117
187
|
requirements: []
|
118
188
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.4.
|
189
|
+
rubygems_version: 2.4.7
|
120
190
|
signing_key:
|
121
191
|
specification_version: 4
|
122
192
|
summary: Pushes watched files to spring
|