guard-process 1.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ notifications:
2
+ recipients:
3
+ - mark@socialreferral.com
4
+ - andre@socialreferral.com
5
+ rvm:
6
+ - 1.9.2
7
+ - jruby
8
+ script: "bundle exec rake test"
9
+ env: "JRUBY_OPTS='--1.9' "
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- Guard::Process
1
+ Guard::Process [![Build Status](https://secure.travis-ci.org/socialreferral/guard-process.png)](http://travis-ci.org/socialreferral/guard-process)
2
2
  ==============
3
3
  Guard to run continues processes.
4
4
 
@@ -4,7 +4,7 @@ require 'rbconfig' unless defined?(RbConfig)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "guard-process"
7
- s.version = "1.0"
7
+ s.version = "1.0.1"
8
8
  s.authors = ["Mark Kremer"]
9
9
  s.email = ["mark@socialreferral.com"]
10
10
  s.homepage = ""
data/lib/guard/process.rb CHANGED
@@ -6,8 +6,8 @@ module Guard
6
6
  def initialize(watchers = [], options = {})
7
7
  @process = nil
8
8
  @pid = nil
9
- @command = options[:command]
10
- @env = options[:env]
9
+ @command = options.fetch(:command).split
10
+ @env = options[:env]
11
11
  @name = options[:name]
12
12
  @stop_signal = options[:stop_signal] || "TERM"
13
13
  super
@@ -23,7 +23,8 @@ module Guard
23
23
 
24
24
  def start
25
25
  UI.info("Starting process #{@name}")
26
- @process = @env ? IO.popen([@env, @command]) : IO.popen(@command)
26
+ @command.unshift(@env) if @env
27
+ @process = IO.popen(@command)
27
28
  UI.info("Started process #{@name}")
28
29
  @pid = @process.pid
29
30
  end
@@ -13,7 +13,7 @@ class GuardProcessTest < MiniTest::Unit::TestCase
13
13
  @guard.stop if @guard.process_running?
14
14
  ENV['GUARD_ENV'] = nil
15
15
  end
16
-
16
+
17
17
  def test_run_all_returns_true
18
18
  assert @guard.run_all
19
19
  end
@@ -47,4 +47,20 @@ class GuardProcessTest < MiniTest::Unit::TestCase
47
47
  @guard.reload
48
48
  assert @guard.process_running?
49
49
  end
50
+
51
+ def test_commands_are_formatted_correctly_with_and_without_env
52
+ @options = {:command => 'echo test test', :name => 'EchoProcess'}
53
+ @env = {'VAR3' => 'VALUE 3'}
54
+
55
+ IO.expects(:popen).with(["echo", "test", "test"]).returns(stub_everything)
56
+ IO.expects(:popen).with([@env, "echo", "test", "test"]).returns(stub_everything)
57
+
58
+ @guard = Guard::Process.new([], @options)
59
+ @guard.start and @guard.stop
60
+
61
+ @options[:env] = @env
62
+
63
+ @guard = Guard::Process.new([], @options)
64
+ @guard.start and @guard.stop
65
+ end
50
66
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-process
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-05 00:00:00.000000000 +02:00
12
+ date: 2011-07-08 00:00:00.000000000 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: guard
17
- requirement: &24104480 !ruby/object:Gem::Requirement
17
+ requirement: &11464980 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 0.4.2
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *24104480
25
+ version_requirements: *11464980
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: minitest
28
- requirement: &24103960 !ruby/object:Gem::Requirement
28
+ requirement: &11464440 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *24103960
36
+ version_requirements: *11464440
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: mocha
39
- requirement: &24103380 !ruby/object:Gem::Requirement
39
+ requirement: &11463840 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *24103380
47
+ version_requirements: *11463840
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: guard-minitest
50
- requirement: &24102840 !ruby/object:Gem::Requirement
50
+ requirement: &11463300 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *24102840
58
+ version_requirements: *11463300
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: guard-bundler
61
- requirement: &24101840 !ruby/object:Gem::Requirement
61
+ requirement: &11432120 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *24101840
69
+ version_requirements: *11432120
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rake
72
- requirement: &24097500 !ruby/object:Gem::Requirement
72
+ requirement: &11431540 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *24097500
80
+ version_requirements: *11431540
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rb-inotify
83
- requirement: &24096660 !ruby/object:Gem::Requirement
83
+ requirement: &11430540 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,7 +88,7 @@ dependencies:
88
88
  version: '0'
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *24096660
91
+ version_requirements: *11430540
92
92
  description: Guard extension to run cli processes
93
93
  email:
94
94
  - mark@socialreferral.com
@@ -97,6 +97,7 @@ extensions: []
97
97
  extra_rdoc_files: []
98
98
  files:
99
99
  - .gitignore
100
+ - .travis.yml
100
101
  - Gemfile
101
102
  - Guardfile
102
103
  - LICENSE
@@ -129,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
130
  version: '0'
130
131
  segments:
131
132
  - 0
132
- hash: -2213643143478501703
133
+ hash: -228258594788711827
133
134
  requirements: []
134
135
  rubyforge_project:
135
136
  rubygems_version: 1.6.2