guard-spring 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -11,7 +11,7 @@ Learn how to monitor file system changes with [Guard](https://github.com/guard/g
11
11
 
12
12
  Add this line to your application's Gemfile:
13
13
 
14
- gem 'guard-spring', :git => 'git://github.com/mknapik/guard-spring.git'
14
+ gem 'guard-spring'
15
15
 
16
16
  And then execute:
17
17
 
@@ -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
@@ -1,6 +1,6 @@
1
1
  module Guard
2
2
  module SpringVersion
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
6
6
 
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: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: