guard-spring 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 +6 -6
- data/guard-spring.gemspec +0 -4
- data/lib/guard/spring/runner.rb +7 -2
- data/lib/guard/spring/templates/Guardfile +1 -1
- data/lib/guard/spring/version.rb +1 -1
- metadata +11 -57
- data/spec/guard/spring_spec.rb +0 -238
- data/spec/spec_helper.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: df2464f22010d6178d6131a2532921f919723963
|
4
|
+
data.tar.gz: 33f829f4196e3aa36b9c377b8d8e00afa177701f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2a492ce4c9ad697248b4c375bd51f98f5ef0f2845cffbe3fc6af349423f3bdd7757b91703ab107744a951c5976c4dc18dbf494e1a4d76a4bafd5d4cd23b7e971
|
7
|
+
data.tar.gz: 99b6b1dddeebb3fb25abdcdf29a1763caab49196776977ac7a1c7f2d9a75c9fddd4971d147ee49107170f74dd8f81d996f8b097d0c895cd453ba8ad3cdeb2244
|
data/guard-spring.gemspec
CHANGED
data/lib/guard/spring/runner.rb
CHANGED
@@ -7,6 +7,7 @@ module Guard
|
|
7
7
|
|
8
8
|
def initialize(options = {})
|
9
9
|
@options = options
|
10
|
+
@options[:rspec_cli] = options[:rspec_cli].nil? ? '' : " #{options[:rspec_cli]} "
|
10
11
|
@spring_cmd = get_spring_cmd
|
11
12
|
UI.info 'Guard::Spring Initialized'
|
12
13
|
end
|
@@ -23,7 +24,7 @@ module Guard
|
|
23
24
|
def run(paths)
|
24
25
|
existing_paths = paths.uniq.select { |path| File.exist? "#{Dir.pwd}/#{path}" }
|
25
26
|
rspec_paths = existing_paths.select { |path| path =~ /spec(\/\w+)*(\/\w+_spec\.rb)?/ }
|
26
|
-
run_command "#@spring_cmd rspec", existing_paths.join(' ') unless rspec_paths.empty?
|
27
|
+
run_command "#@spring_cmd rspec", "#{rspec_cli}#{existing_paths.join(' ')}" unless rspec_paths.empty?
|
27
28
|
|
28
29
|
# TBD: # testunit_paths = existing_paths.select { |path| path =~ /test(.*\.rb)?/ }
|
29
30
|
# TBD: # run_command 'spring testunit', existing_paths.join(' ') unless testunit_paths.empty?
|
@@ -79,7 +80,7 @@ module Guard
|
|
79
80
|
results = stubs.map do |stub|
|
80
81
|
run_command 'spring binstub', stub unless File.exist? "#{Dir.pwd}/bin/#{stub}"
|
81
82
|
end
|
82
|
-
results.
|
83
|
+
!results.any? or results.all? { |result| result }
|
83
84
|
end
|
84
85
|
|
85
86
|
def bundler?
|
@@ -93,6 +94,10 @@ module Guard
|
|
93
94
|
def rspec?
|
94
95
|
@rspec ||= options[:rspec] != false && File.exist?("#{Dir.pwd}/spec")
|
95
96
|
end
|
97
|
+
|
98
|
+
def rspec_cli
|
99
|
+
options[:rspec_cli]
|
100
|
+
end
|
96
101
|
end
|
97
102
|
end
|
98
103
|
end
|
data/lib/guard/spring/version.rb
CHANGED
metadata
CHANGED
@@ -1,83 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-spring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michał Knapik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
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: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spring
|
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
|
-
- -
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: mocha
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
38
|
+
- - '>='
|
81
39
|
- !ruby/object:Gem::Version
|
82
40
|
version: '0'
|
83
41
|
description: Guard::Spring automatically runs tests with spring
|
@@ -87,7 +45,7 @@ executables: []
|
|
87
45
|
extensions: []
|
88
46
|
extra_rdoc_files: []
|
89
47
|
files:
|
90
|
-
-
|
48
|
+
- .gitignore
|
91
49
|
- Gemfile
|
92
50
|
- LICENSE.txt
|
93
51
|
- README.md
|
@@ -97,8 +55,6 @@ files:
|
|
97
55
|
- lib/guard/spring/runner.rb
|
98
56
|
- lib/guard/spring/templates/Guardfile
|
99
57
|
- lib/guard/spring/version.rb
|
100
|
-
- spec/guard/spring_spec.rb
|
101
|
-
- spec/spec_helper.rb
|
102
58
|
homepage: https://github.com/mknapik/guard-spring
|
103
59
|
licenses: []
|
104
60
|
metadata: {}
|
@@ -108,20 +64,18 @@ require_paths:
|
|
108
64
|
- lib
|
109
65
|
required_ruby_version: !ruby/object:Gem::Requirement
|
110
66
|
requirements:
|
111
|
-
- -
|
67
|
+
- - '>='
|
112
68
|
- !ruby/object:Gem::Version
|
113
69
|
version: '0'
|
114
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
71
|
requirements:
|
116
|
-
- -
|
72
|
+
- - '>='
|
117
73
|
- !ruby/object:Gem::Version
|
118
74
|
version: '0'
|
119
75
|
requirements: []
|
120
76
|
rubyforge_project:
|
121
|
-
rubygems_version: 2.0.
|
77
|
+
rubygems_version: 2.0.5
|
122
78
|
signing_key:
|
123
79
|
specification_version: 4
|
124
80
|
summary: Pushes watched files to spring
|
125
|
-
test_files:
|
126
|
-
- spec/guard/spring_spec.rb
|
127
|
-
- spec/spec_helper.rb
|
81
|
+
test_files: []
|
data/spec/guard/spring_spec.rb
DELETED
@@ -1,238 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Guard::Spring do
|
4
|
-
|
5
|
-
describe 'bin exists and is writable' do
|
6
|
-
before do
|
7
|
-
Dir.mkdir 'bin' unless Dir.exist? 'bin'
|
8
|
-
end
|
9
|
-
|
10
|
-
after do
|
11
|
-
%w(rspec spring).each { |f| File.delete('bin/' + f) if File.exist?('bin/' + f) }
|
12
|
-
Dir.rmdir 'bin' if Dir.exist? 'bin'
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should create binstubs' do
|
16
|
-
cut = Guard::Spring.new
|
17
|
-
#cut.should_receive(:system).with('spring binstub rspec')
|
18
|
-
File.exist?('bin/rspec').should be_true
|
19
|
-
File.exist?('bin/spring').should be_true
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe 'bin exists and is writable' do
|
24
|
-
before do
|
25
|
-
%w(rspec spring).each { |f| File.delete('bin/' + f) if File.exist?('bin/' + f) }
|
26
|
-
Dir.rmdir 'bin' if Dir.exist? 'bin'
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'should not create binstubs' do
|
30
|
-
cut = Guard::Spring.new
|
31
|
-
File.exist?('bin/rspec').should be_false
|
32
|
-
File.exist?('bin/spring').should be_false
|
33
|
-
end
|
34
|
-
end
|
35
|
-
# describe 'position' do
|
36
|
-
# it 'should use \'before\' position by default' do
|
37
|
-
# subject.options[:position].should == 'before'
|
38
|
-
# end
|
39
|
-
#
|
40
|
-
# it 'should allow user to customize position (before)' do
|
41
|
-
# subject = Guard::Spring.new( [], :position => 'before' )
|
42
|
-
# subject.options[:position].should == 'before'
|
43
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before')
|
44
|
-
# subject.start
|
45
|
-
# end
|
46
|
-
#
|
47
|
-
# it 'should allow user to customize position (after)' do
|
48
|
-
# subject = Guard::Spring.new( [], :position => 'after' )
|
49
|
-
# subject.options[:position].should == 'after'
|
50
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p after')
|
51
|
-
# subject.start
|
52
|
-
# end
|
53
|
-
# end
|
54
|
-
#
|
55
|
-
# describe 'routes' do
|
56
|
-
# it 'should not run routes by default' do
|
57
|
-
# subject.options[:routes].should be_false
|
58
|
-
# end
|
59
|
-
#
|
60
|
-
# it 'should allow the users to run routes if desired' do
|
61
|
-
# subject = Guard::Spring.new( [], :routes => true)
|
62
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before')
|
63
|
-
# subject.should_receive(:system).with('bundle exec Spring -r -p before')
|
64
|
-
# subject.start
|
65
|
-
# end
|
66
|
-
#
|
67
|
-
# it 'should allow the user to customize routes annotation position (before)' do
|
68
|
-
# subject = Guard::Spring.new( [], :routes => true, :position => 'before')
|
69
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before')
|
70
|
-
# subject.should_receive(:system).with('bundle exec Spring -r -p before')
|
71
|
-
# subject.start
|
72
|
-
# end
|
73
|
-
#
|
74
|
-
# it 'should allow the user to customize routes annotation position (after)' do
|
75
|
-
# subject = Guard::Spring.new( [], :routes => true, :position => 'after')
|
76
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p after')
|
77
|
-
# subject.should_receive(:system).with('bundle exec Spring -r -p after')
|
78
|
-
# subject.start
|
79
|
-
# end
|
80
|
-
# end
|
81
|
-
#
|
82
|
-
# describe 'tests & fixtures' do
|
83
|
-
# it 'should not run tests annotations by default' do
|
84
|
-
# subject.options[:tests].should be_false
|
85
|
-
# end
|
86
|
-
#
|
87
|
-
# it 'should allow user to run tests and fixtures annotations if desired' do
|
88
|
-
# subject = Guard::Spring.new( [], :tests => true )
|
89
|
-
# subject.should_receive(:system).with('bundle exec Spring -p before')
|
90
|
-
# subject.start
|
91
|
-
# end
|
92
|
-
# end
|
93
|
-
#
|
94
|
-
# describe 'indexes' do
|
95
|
-
# it 'should not add indexes to annotations by default' do
|
96
|
-
# subject.options[:show_indexes].should be_false
|
97
|
-
# end
|
98
|
-
#
|
99
|
-
# it 'should allow user to add indexes to annotations if desired' do
|
100
|
-
# subject = Guard::Spring.new( [], :show_indexes => true )
|
101
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before --show-indexes')
|
102
|
-
# subject.start
|
103
|
-
# end
|
104
|
-
# end
|
105
|
-
#
|
106
|
-
# describe 'simple indexes' do
|
107
|
-
# it 'should not add simple indexes to annotations by default' do
|
108
|
-
# subject.options[:simple_indexes].should be_false
|
109
|
-
# end
|
110
|
-
#
|
111
|
-
# it 'should allow user to add simple indexes to annotations if desired' do
|
112
|
-
# subject = Guard::Spring.new( [], :simple_indexes => true )
|
113
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before --simple-indexes')
|
114
|
-
# subject.start
|
115
|
-
# end
|
116
|
-
# end
|
117
|
-
#
|
118
|
-
# describe 'show migration' do
|
119
|
-
# it 'should not show migration version in annotations by default' do
|
120
|
-
# subject.options[:show_migration].should be_false
|
121
|
-
# end
|
122
|
-
#
|
123
|
-
# it 'should allow user to add migration version in annotations if desired' do
|
124
|
-
# subject = Guard::Spring.new( [], :show_migration => true )
|
125
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before --show-migration')
|
126
|
-
# subject.start
|
127
|
-
# end
|
128
|
-
# end
|
129
|
-
#
|
130
|
-
# describe 'annotation format' do
|
131
|
-
# it 'should not add format type to annotations by default' do
|
132
|
-
# subject.options[:show_migration].should be_false
|
133
|
-
# end
|
134
|
-
#
|
135
|
-
# describe 'invalid' do
|
136
|
-
# it 'should not add format type if option given is invalid' do
|
137
|
-
# subject = Guard::Spring.new( [], :format => :invalid_option)
|
138
|
-
# subject.options[:show_migration].should be_false
|
139
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before')
|
140
|
-
# subject.start
|
141
|
-
# end
|
142
|
-
# end
|
143
|
-
# describe 'bare' do
|
144
|
-
# it 'should allow user to choose format of annotations if desired' do
|
145
|
-
# subject = Guard::Spring.new( [], :format => :bare )
|
146
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before --format=bare')
|
147
|
-
# subject.start
|
148
|
-
# end
|
149
|
-
# end
|
150
|
-
# describe 'rdoc' do
|
151
|
-
# it 'should allow user to choose format of annotations if desired' do
|
152
|
-
# subject = Guard::Spring.new( [], :format => :rdoc )
|
153
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before --format=rdoc')
|
154
|
-
# subject.start
|
155
|
-
# end
|
156
|
-
# end
|
157
|
-
# describe 'markdown' do
|
158
|
-
# it 'should allow user to choose format of annotations if desired' do
|
159
|
-
# subject = Guard::Spring.new( [], :format => :markdown )
|
160
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before --format=markdown')
|
161
|
-
# subject.start
|
162
|
-
# end
|
163
|
-
# end
|
164
|
-
# end
|
165
|
-
#
|
166
|
-
# describe 'run_at_start' do
|
167
|
-
# it 'should run at start by default' do
|
168
|
-
# subject.options[:run_at_start].should be_true
|
169
|
-
# end
|
170
|
-
#
|
171
|
-
# it 'should allow user to opt out of running at start' do
|
172
|
-
# subject = Guard::Spring.new( [], :run_at_start => false)
|
173
|
-
# subject.options[:run_at_start].should be_false
|
174
|
-
# end
|
175
|
-
# end
|
176
|
-
#end
|
177
|
-
#
|
178
|
-
#context 'start' do
|
179
|
-
# it 'should run Spring command' do
|
180
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before')
|
181
|
-
# subject.start
|
182
|
-
# end
|
183
|
-
#
|
184
|
-
# it 'should return false if Spring command fails' do
|
185
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before').and_return(false)
|
186
|
-
# subject.start.should be_false
|
187
|
-
# end
|
188
|
-
#
|
189
|
-
# it 'should not run Spring command if disabled :run_at_start' do
|
190
|
-
# subject.should_not_receive(:system)
|
191
|
-
# subject.options[:run_at_start] = false
|
192
|
-
# subject.start
|
193
|
-
# end
|
194
|
-
#end
|
195
|
-
#
|
196
|
-
#context 'stop' do
|
197
|
-
# it 'should be a noop (return true)' do
|
198
|
-
# subject.stop.should be_true
|
199
|
-
# end
|
200
|
-
#end
|
201
|
-
#
|
202
|
-
#context 'reload' do
|
203
|
-
# it 'should run Spring command' do
|
204
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before')
|
205
|
-
# subject.reload
|
206
|
-
# end
|
207
|
-
#
|
208
|
-
# it 'should return false if Spring command fails' do
|
209
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before').and_return(false)
|
210
|
-
# subject.reload.should be_false
|
211
|
-
# end
|
212
|
-
#
|
213
|
-
# it 'should not run Spring command if disabled :run_at_start' do
|
214
|
-
# subject.should_not_receive(:system)
|
215
|
-
# subject.options[:run_at_start] = false
|
216
|
-
# subject.reload
|
217
|
-
# end
|
218
|
-
#end
|
219
|
-
#
|
220
|
-
#context 'run_all' do
|
221
|
-
# it 'should be a noop (return true)' do
|
222
|
-
# subject.run_all.should be_true
|
223
|
-
# end
|
224
|
-
#end
|
225
|
-
#
|
226
|
-
## For Guard 1.1. #run_on_change is deprecated
|
227
|
-
#context 'run_on_changes' do
|
228
|
-
# it 'should run Spring command' do
|
229
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before')
|
230
|
-
# subject.run_on_changes
|
231
|
-
# end
|
232
|
-
#
|
233
|
-
# it 'should return false if Spring command fails' do
|
234
|
-
# subject.should_receive(:system).with('bundle exec Spring --exclude tests,fixtures -p before').and_return(false)
|
235
|
-
# subject.run_on_changes.should be_false
|
236
|
-
# end
|
237
|
-
#end
|
238
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
require 'guard/spring'
|
3
|
-
require 'test/unit'
|
4
|
-
require 'mocha/setup'
|
5
|
-
|
6
|
-
Dir["#{File.expand_path('..', __FILE__)}/support/**/*.rb"].each { |f| require f }
|
7
|
-
|
8
|
-
RSpec.configure do |c|
|
9
|
-
c.color_enabled = true
|
10
|
-
c.filter_run :focus => true
|
11
|
-
c.run_all_when_everything_filtered = true
|
12
|
-
|
13
|
-
c.before( :each ) do
|
14
|
-
ENV['GUARD_ENV'] = 'test'
|
15
|
-
::Guard::Notifier.stub( :notify ).and_return( true )
|
16
|
-
@lib_path = Pathname.new( File.expand_path( '../../lib/', __FILE__ ) )
|
17
|
-
end
|
18
|
-
|
19
|
-
c.after( :each ) do
|
20
|
-
ENV['GUARD_ENV'] = nil
|
21
|
-
end
|
22
|
-
end
|