guard-process 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 71f3ef6034e8422847c017d3ab4d57541f9abec0
4
+ data.tar.gz: 62ba22f6dae41b0c8a42d24e8604f67587b39c76
5
+ SHA512:
6
+ metadata.gz: ccde9ba1a1381c736c3215c2e22589ae911ca87718522be3ffbe4f0670eecbc9f9e6da90f5277b6427720da36ff4a1edfc11d4fea0503798bda730c63cdb2d52
7
+ data.tar.gz: 25d7266ffc963377bad5441cc551cf98c0f2bc8874351d3b2012417b0b4a3d9db134fbca5afcabeb8de8392181f4422d8e5013e0072db5b03fd0c3075121db0f
data/.travis.yml CHANGED
@@ -5,5 +5,6 @@ notifications:
5
5
  rvm:
6
6
  - 1.9.2
7
7
  - 1.9.3
8
+ - 2.0.0
8
9
  - jruby-19mode
9
10
  script: "bundle exec rake test"
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # Guard::Process [![Build Status](https://secure.travis-ci.org/socialreferral/guard-process.png)](http://travis-ci.org/socialreferral/guard-process)
2
- Guard to run continues processes.
1
+ # Guard::Process [![Build Status](https://secure.travis-ci.org/guard/guard-process.png)](http://travis-ci.org/guard/guard-process)
2
+ Guard to run processes and commands.
3
3
 
4
- This gem requires Ruby 1.9.2, 1.9.3 or JRuby in 1.9 mode.
4
+ This gem requires Ruby 1.9.2, 1.9.3, 2.0.0 or JRuby in 1.9 mode.
5
5
 
6
6
  # Usage
7
7
  Please read the [Guard documentation](https://github.com/guard/guard#readme) to learn how to use Guard.
@@ -18,7 +18,7 @@ You can add as many process Guards as you want, an example Guardfile:
18
18
  watch('Gemfile.lock')
19
19
  end
20
20
 
21
- guard 'process', :name => 'AnotherRunner', :command => 'rails runner AnotherRunner' do
21
+ guard 'process', :name => 'AnotherRunner', :command => ['rails', 'runner', 'AnotherRunner'] do
22
22
  watch('Gemfile.lock')
23
23
  end
24
24
  ```
@@ -48,6 +48,10 @@ Clean up the test cases
48
48
 
49
49
  # Changes
50
50
 
51
+ ## 1.0.6
52
+
53
+ - Allow passing in command as an Array as well as a String
54
+
51
55
  ## 1.0.5
52
56
 
53
57
  - Adds the dont_stop option
@@ -58,7 +62,7 @@ Clean up the test cases
58
62
 
59
63
  # Development
60
64
  - Source hosted on [GitHub](https://github.com)
61
- - Please report issues and feature requests using [GitHub issues](https://github.com/socialreferral/guard-process/issues)
65
+ - Please report issues and feature requests using [GitHub issues](https://github.com/guard/guard-process/issues)
62
66
 
63
67
  Pull requests are welcome, please make sure your patches are well tested before contributing. When sending a pull request:
64
68
  - Use a topic branch for your change
data/Vagrantfile CHANGED
@@ -1,10 +1,13 @@
1
1
  # -*- mode: ruby -*-
2
2
  # vi: set ft=ruby :
3
3
 
4
- Vagrant::Config.run do |config|
5
- config.vm.box = "guard"
4
+ # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5
+ VAGRANTFILE_API_VERSION = "2"
6
+
7
+ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8
+ config.vm.hostname = "guard"
9
+ config.vm.box = "precise64"
6
10
  config.vm.box_url = "http://files.vagrantup.com/precise64.box"
7
- config.vm.network :hostonly, "192.168.33.21"
8
- config.vm.share_folder "v-root", "/vagrant", ".", :nfs => !(ENV["OS"] =~ /windows/i)
11
+ config.vm.network :private_network, ip: "192.168.33.21"
9
12
  config.vm.provision :shell, :path => "vagrant-provision"
10
13
  end
@@ -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.5"
7
+ s.version = "1.0.6"
8
8
  s.authors = ["Mark Kremer"]
9
9
  s.email = ["mark@socialreferral.com"]
10
10
  s.homepage = ""
@@ -20,11 +20,11 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.add_dependency('guard', '>= 0.4.2')
22
22
  s.add_dependency('spoon', '~> 0.0.1')
23
- s.add_dependency('ffi', '~> 1.0.9')
24
23
  s.add_development_dependency('minitest')
25
24
  s.add_development_dependency('mocha')
26
25
  s.add_development_dependency('guard-minitest')
27
26
  s.add_development_dependency('guard-bundler')
28
27
  s.add_development_dependency('rake')
29
28
  s.add_development_dependency('rb-inotify') if RbConfig::CONFIG['target_os'] == 'linux'
29
+ s.add_development_dependency('pry')
30
30
  end
data/lib/guard/process.rb CHANGED
@@ -6,7 +6,8 @@ module Guard
6
6
  class Process < Guard
7
7
  def initialize(watchers = [], options = {})
8
8
  @pid = nil
9
- @command = options.fetch(:command).split(" ")
9
+ @command = options.fetch(:command)
10
+ @command = @command.split(" ") if @command.is_a?(String)
10
11
  @env = options[:env] || {}
11
12
  @name = options[:name]
12
13
  @dir = options[:dir] || Dir.getwd
@@ -46,8 +47,11 @@ module Guard
46
47
  def stop
47
48
  if @pid
48
49
  UI.info("Stopping process #{@name}")
49
- ::Process.kill(@stop_signal, @pid)
50
- ::Process.waitpid(@pid) rescue Errno::ESRCH
50
+ begin
51
+ ::Process.kill(@stop_signal, @pid)
52
+ ::Process.waitpid(@pid)
53
+ rescue Errno::ESRCH
54
+ end
51
55
  @pid = nil
52
56
  UI.info("Stopped process #{@name}")
53
57
  end
@@ -1,7 +1,7 @@
1
1
  require_relative '../test_helper'
2
2
  require 'timeout'
3
3
 
4
- class GuardProcessTest < MiniTest::Unit::TestCase
4
+ class GuardProcessTest < MiniTest::Test
5
5
  def setup
6
6
  ENV['GUARD_ENV'] = 'test'
7
7
  @command = "ruby #{TEST_ROOT}/run_me.rb"
@@ -101,6 +101,18 @@ class GuardProcessTest < MiniTest::Unit::TestCase
101
101
  def test_commands_are_formatted_properly_for_spoon
102
102
  @options = {:command => 'echo test test', :name => 'EchoProcess', :env => {"VAR1" => "VALUE 1"}}
103
103
  ::Process.stubs(:kill).returns(true)
104
+ ::Process.stubs(:waitpid).returns(true)
105
+
106
+ Spoon.expects(:spawnp).with("echo", "test", "test").returns(stub_everything)
107
+
108
+ @guard = Guard::Process.new([], @options)
109
+ @guard.start and @guard.stop
110
+ end
111
+
112
+ def test_commands_may_be_given_in_array_form
113
+ @options = {:command => ['echo', 'test', 'test'], :name => 'EchoProcess', :env => {"VAR1" => "VALUE 1"}}
114
+ ::Process.stubs(:kill).returns(true)
115
+ ::Process.stubs(:waitpid).returns(true)
104
116
 
105
117
  Spoon.expects(:spawnp).with("echo", "test", "test").returns(stub_everything)
106
118
 
data/test/test_helper.rb CHANGED
@@ -1,6 +1,6 @@
1
- require 'minitest/unit'
2
1
  require 'minitest/autorun'
3
- require 'mocha'
2
+ require 'mocha/setup'
4
3
  require 'guard/process'
4
+ require 'pry'
5
5
 
6
6
  TEST_ROOT = File.expand_path(File.dirname(__FILE__))
metadata CHANGED
@@ -1,115 +1,141 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-process
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
5
- prerelease:
4
+ version: 1.0.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mark Kremer
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-15 00:00:00.000000000 Z
11
+ date: 2013-08-31 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: guard
16
- requirement: &70332760 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.4.2
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *70332760
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.4.2
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: spoon
27
- requirement: &70332000 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ~>
31
32
  - !ruby/object:Gem::Version
32
33
  version: 0.0.1
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *70332000
36
- - !ruby/object:Gem::Dependency
37
- name: ffi
38
- requirement: &70331270 !ruby/object:Gem::Requirement
39
- none: false
36
+ version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - ~>
42
39
  - !ruby/object:Gem::Version
43
- version: 1.0.9
44
- type: :runtime
45
- prerelease: false
46
- version_requirements: *70331270
40
+ version: 0.0.1
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: minitest
49
- requirement: &70330970 !ruby/object:Gem::Requirement
50
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
51
44
  requirements:
52
- - - ! '>='
45
+ - - '>='
53
46
  - !ruby/object:Gem::Version
54
47
  version: '0'
55
48
  type: :development
56
49
  prerelease: false
57
- version_requirements: *70330970
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
58
55
  - !ruby/object:Gem::Dependency
59
56
  name: mocha
60
- requirement: &70330670 !ruby/object:Gem::Requirement
61
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
62
58
  requirements:
63
- - - ! '>='
59
+ - - '>='
64
60
  - !ruby/object:Gem::Version
65
61
  version: '0'
66
62
  type: :development
67
63
  prerelease: false
68
- version_requirements: *70330670
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: guard-minitest
71
- requirement: &70330400 !ruby/object:Gem::Requirement
72
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
73
72
  requirements:
74
- - - ! '>='
73
+ - - '>='
75
74
  - !ruby/object:Gem::Version
76
75
  version: '0'
77
76
  type: :development
78
77
  prerelease: false
79
- version_requirements: *70330400
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
80
83
  - !ruby/object:Gem::Dependency
81
84
  name: guard-bundler
82
- requirement: &70330070 !ruby/object:Gem::Requirement
83
- none: false
85
+ requirement: !ruby/object:Gem::Requirement
84
86
  requirements:
85
- - - ! '>='
87
+ - - '>='
86
88
  - !ruby/object:Gem::Version
87
89
  version: '0'
88
90
  type: :development
89
91
  prerelease: false
90
- version_requirements: *70330070
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
91
97
  - !ruby/object:Gem::Dependency
92
98
  name: rake
93
- requirement: &70329710 !ruby/object:Gem::Requirement
94
- none: false
99
+ requirement: !ruby/object:Gem::Requirement
95
100
  requirements:
96
- - - ! '>='
101
+ - - '>='
97
102
  - !ruby/object:Gem::Version
98
103
  version: '0'
99
104
  type: :development
100
105
  prerelease: false
101
- version_requirements: *70329710
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
102
111
  - !ruby/object:Gem::Dependency
103
112
  name: rb-inotify
104
- requirement: &70329420 !ruby/object:Gem::Requirement
105
- none: false
113
+ requirement: !ruby/object:Gem::Requirement
106
114
  requirements:
107
- - - ! '>='
115
+ - - '>='
108
116
  - !ruby/object:Gem::Version
109
117
  version: '0'
110
118
  type: :development
111
119
  prerelease: false
112
- version_requirements: *70329420
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
113
139
  description: Guard extension to run cli processes
114
140
  email:
115
141
  - mark@socialreferral.com
@@ -135,26 +161,25 @@ files:
135
161
  - vagrant-provision
136
162
  homepage: ''
137
163
  licenses: []
164
+ metadata: {}
138
165
  post_install_message:
139
166
  rdoc_options: []
140
167
  require_paths:
141
168
  - lib
142
169
  required_ruby_version: !ruby/object:Gem::Requirement
143
- none: false
144
170
  requirements:
145
- - - ! '>='
171
+ - - '>='
146
172
  - !ruby/object:Gem::Version
147
173
  version: 1.9.2
148
174
  required_rubygems_version: !ruby/object:Gem::Requirement
149
- none: false
150
175
  requirements:
151
- - - ! '>='
176
+ - - '>='
152
177
  - !ruby/object:Gem::Version
153
178
  version: '0'
154
179
  requirements: []
155
180
  rubyforge_project:
156
- rubygems_version: 1.8.11
181
+ rubygems_version: 2.0.0
157
182
  signing_key:
158
- specification_version: 3
183
+ specification_version: 4
159
184
  summary: Guard extension to run cli processes
160
185
  test_files: []