guard-spring 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/lib/guard/spring/runner.rb +11 -4
- data/lib/guard/spring/version.rb +1 -1
- metadata +1 -1
data/README.md
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
|
+
create_bin_stubs %w(rspec)
|
10
11
|
UI.info 'Guard::Spring Initialized'
|
11
12
|
end
|
12
13
|
|
@@ -22,7 +23,7 @@ module Guard
|
|
22
23
|
def run(paths)
|
23
24
|
existing_paths = paths.uniq.select { |path| File.exist? "#{Dir.pwd}/#{path}" }
|
24
25
|
rspec_paths = existing_paths.select { |path| path =~ /spec(\/\w+)*(\/\w+_spec\.rb)?/ }
|
25
|
-
run_command 'spring rspec', existing_paths.join(' ') unless rspec_paths.empty?
|
26
|
+
run_command './bin/spring rspec', existing_paths.join(' ') unless rspec_paths.empty?
|
26
27
|
|
27
28
|
# TBD: # testunit_paths = existing_paths.select { |path| path =~ /test(.*\.rb)?/ }
|
28
29
|
# TBD: # run_command 'spring testunit', existing_paths.join(' ') unless testunit_paths.empty?
|
@@ -51,21 +52,27 @@ module Guard
|
|
51
52
|
end
|
52
53
|
|
53
54
|
def start_spring
|
54
|
-
fork_exec('spring start > /dev/null')
|
55
|
+
fork_exec('./bin/spring start > /dev/null')
|
55
56
|
end
|
56
57
|
|
57
58
|
def stop_spring
|
58
|
-
run_command('spring stop')
|
59
|
+
run_command('./bin/spring stop')
|
59
60
|
UI.info 'Stopping Spring ', :reset => true
|
60
61
|
end
|
61
62
|
|
62
63
|
def push_command(paths)
|
63
64
|
cmd_parts = []
|
64
|
-
cmd_parts << 'spring rspec'
|
65
|
+
cmd_parts << './bin/spring rspec'
|
65
66
|
cmd_parts << paths.join(' ')
|
66
67
|
cmd_parts.join(' ')
|
67
68
|
end
|
68
69
|
|
70
|
+
def create_bin_stubs(stubs)
|
71
|
+
stubs.each do |stub|
|
72
|
+
run_command 'spring binstub', stub unless File.exist? "#{Dir.pwd}/bin/#{stub}"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
69
76
|
def bundler?
|
70
77
|
@bundler ||= options[:bundler] != false && File.exist?("#{Dir.pwd}/Gemfile")
|
71
78
|
end
|
data/lib/guard/spring/version.rb
CHANGED