cocaine 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of cocaine might be problematic. Click here for more details.
- data/.gitignore +1 -0
- data/.travis.yml +6 -3
- data/README.md +43 -1
- data/cocaine.gemspec +1 -1
- data/lib/cocaine/command_line.rb +12 -16
- data/lib/cocaine/command_line/runners.rb +1 -0
- data/lib/cocaine/command_line/runners/backticks_runner.rb +7 -0
- data/lib/cocaine/command_line/runners/fake_runner.rb +7 -0
- data/lib/cocaine/command_line/runners/popen_runner.rb +29 -0
- data/lib/cocaine/command_line/runners/posix_runner.rb +33 -15
- data/lib/cocaine/command_line/runners/process_runner.rb +30 -17
- data/lib/cocaine/exceptions.rb +3 -3
- data/lib/cocaine/version.rb +1 -1
- data/spec/cocaine/command_line/runners/backticks_runner_spec.rb +14 -12
- data/spec/cocaine/command_line/runners/popen_runner_spec.rb +22 -0
- data/spec/cocaine/command_line/runners/posix_runner_spec.rb +1 -2
- data/spec/cocaine/command_line/runners/process_runner_spec.rb +1 -1
- data/spec/cocaine/command_line_spec.rb +21 -11
- data/spec/spec_helper.rb +12 -1
- data/spec/support/nonblocking_examples.rb +2 -0
- data/spec/support/unsetting_exitstatus.rb +7 -0
- data/spec/support/with_exitstatus.rb +1 -1
- metadata +126 -124
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -34,6 +34,15 @@ line = Cocaine::CommandLine.new("cat", ":file")
|
|
34
34
|
line.command(:file => "ohyeah?'`rm -rf /`.ha!") # => "cat 'ohyeah?'\\''`rm -rf /`.ha!'"
|
35
35
|
```
|
36
36
|
|
37
|
+
NOTE: It only does that for arguments interpolated via `run`, NOT argumnets
|
38
|
+
passed into `new` (see 'Security' below):
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
line = Cocaine::CommandLine.new("echo", "haha`whoami`")
|
42
|
+
line.command # => "echo haha`whoami`"
|
43
|
+
line.run # => "hahawebserver"
|
44
|
+
```
|
45
|
+
|
37
46
|
You can ignore the result:
|
38
47
|
|
39
48
|
```ruby
|
@@ -116,6 +125,17 @@ Cocaine::CommandLine.logger = Logger.new(STDOUT)
|
|
116
125
|
Cocaine::CommandLine.new("date").run # => Logs this -> Command :: date
|
117
126
|
```
|
118
127
|
|
128
|
+
## Security
|
129
|
+
|
130
|
+
Short version: Only pass user-generated data into the `run` method and NOT
|
131
|
+
`new`.
|
132
|
+
|
133
|
+
As shown in examples above, Cocaine will only shell-escape what is passed in as
|
134
|
+
interpolations to the `run` method. It WILL NOT escape what is passed in to the
|
135
|
+
second argument of `new`. Cocaine assumes that you will not be manually
|
136
|
+
passing user-generated data to that argument and will be using it as a template
|
137
|
+
for your command line's structure.
|
138
|
+
|
119
139
|
## POSIX Spawn
|
120
140
|
|
121
141
|
You can potentially increase performance by installing [the posix-spawn
|
@@ -141,7 +161,9 @@ Cocaine::CommandLine.runner = Cocaine::CommandLine::BackticksRunner.new
|
|
141
161
|
And if you really want to, you can define your own Runner, though I can't
|
142
162
|
imagine why you would.
|
143
163
|
|
144
|
-
### JRuby
|
164
|
+
### JRuby issues
|
165
|
+
|
166
|
+
#### Caveat
|
145
167
|
|
146
168
|
If you get `Error::ECHILD` errors and are using JRuby, there is a very good
|
147
169
|
chance that the error is actually in JRuby. This was brought to our attention
|
@@ -149,6 +171,16 @@ in https://github.com/thoughtbot/cocaine/issues/24 and probably fixed in
|
|
149
171
|
http://jira.codehaus.org/browse/JRUBY-6162. You *will* want to use the
|
150
172
|
`BackticksRunner` if you are unable to update JRuby.
|
151
173
|
|
174
|
+
#### Spawn warning
|
175
|
+
|
176
|
+
If you get `unsupported spawn option: out` warning (like in [issue 38](https://github.com/thoughtbot/cocaine/issues/38)),
|
177
|
+
try to use `PopenRunner`:
|
178
|
+
|
179
|
+
```ruby
|
180
|
+
Cocaine::CommandLine.runner = Cocaine::CommandLine::PopenRunner.new
|
181
|
+
```
|
182
|
+
|
183
|
+
|
152
184
|
## REE
|
153
185
|
|
154
186
|
So, here's the thing about REE: The specs that involve timeouts don't work
|
@@ -171,6 +203,16 @@ Question? Idea? Problem? Bug? Comment? Concern? Like using question marks?
|
|
171
203
|
|
172
204
|
[GitHub Issues For All!](https://github.com/thoughtbot/cocaine/issues)
|
173
205
|
|
206
|
+
## Credits
|
207
|
+
|
208
|
+
Thank you to all [the contributors](https://github.com/thoughtbot/cocaine/graphs/contributors)!
|
209
|
+
|
210
|
+
![thoughtbot](http://thoughtbot.com/logo.png)
|
211
|
+
|
212
|
+
Cocaine is maintained and funded by [thoughtbot, inc](http://thoughtbot.com/community)
|
213
|
+
|
214
|
+
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
|
215
|
+
|
174
216
|
## License
|
175
217
|
|
176
218
|
Copyright 2011-2013 Jon Yurek and thoughtbot, inc. This is free software, and
|
data/cocaine.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_development_dependency('bourne')
|
22
22
|
s.add_development_dependency('mocha')
|
23
23
|
s.add_development_dependency('rake')
|
24
|
-
s.add_development_dependency('
|
24
|
+
s.add_development_dependency('activesupport', ">= 3.0.0", "< 5.0")
|
25
25
|
s.add_development_dependency('pry')
|
26
26
|
end
|
27
27
|
|
data/lib/cocaine/command_line.rb
CHANGED
@@ -15,15 +15,6 @@ module Cocaine
|
|
15
15
|
@supplemental_environment['PATH'] = (Array(supplemental_path) + [ENV['PATH']]).join(File::PATH_SEPARATOR)
|
16
16
|
end
|
17
17
|
|
18
|
-
def posix_spawn_available?
|
19
|
-
@posix_spawn_available ||= begin
|
20
|
-
require 'posix/spawn'
|
21
|
-
true
|
22
|
-
rescue LoadError => e
|
23
|
-
false
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
18
|
def environment
|
28
19
|
@supplemental_environment ||= {}
|
29
20
|
end
|
@@ -40,12 +31,16 @@ module Cocaine
|
|
40
31
|
@runner = nil
|
41
32
|
end
|
42
33
|
|
34
|
+
def java?
|
35
|
+
RUBY_PLATFORM =~ /java/
|
36
|
+
end
|
37
|
+
|
43
38
|
private
|
44
39
|
|
45
40
|
def best_runner
|
46
|
-
|
47
|
-
|
48
|
-
|
41
|
+
[PosixRunner, ProcessRunner, BackticksRunner].detect do |runner|
|
42
|
+
runner.supported?
|
43
|
+
end.new
|
49
44
|
end
|
50
45
|
end
|
51
46
|
|
@@ -74,6 +69,7 @@ module Cocaine
|
|
74
69
|
|
75
70
|
def run(interpolations = {})
|
76
71
|
output = ''
|
72
|
+
@exit_status = nil
|
77
73
|
begin
|
78
74
|
full_command = command(interpolations)
|
79
75
|
log("#{colored("Command")} :: #{full_command}")
|
@@ -81,14 +77,14 @@ module Cocaine
|
|
81
77
|
rescue Errno::ENOENT
|
82
78
|
raise Cocaine::CommandNotFoundError
|
83
79
|
ensure
|
84
|
-
@exit_status = $?.exitstatus
|
80
|
+
@exit_status = $?.exitstatus if $?.respond_to?(:exitstatus)
|
85
81
|
end
|
86
|
-
if
|
82
|
+
if @exit_status == 127
|
87
83
|
raise Cocaine::CommandNotFoundError
|
88
84
|
end
|
89
|
-
unless @expected_outcodes.include?(
|
85
|
+
unless @expected_outcodes.include?(@exit_status)
|
90
86
|
message = [
|
91
|
-
"Command '#{full_command}' returned #{
|
87
|
+
"Command '#{full_command}' returned #{@exit_status}. Expected #{@expected_outcodes.join(", ")}",
|
92
88
|
"Here is the command output:\n",
|
93
89
|
output
|
94
90
|
].join("\n")
|
@@ -3,4 +3,5 @@
|
|
3
3
|
require 'cocaine/command_line/runners/backticks_runner'
|
4
4
|
require 'cocaine/command_line/runners/process_runner'
|
5
5
|
require 'cocaine/command_line/runners/posix_runner'
|
6
|
+
require 'cocaine/command_line/runners/popen_runner'
|
6
7
|
require 'cocaine/command_line/runners/fake_runner'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: UTF-8
|
2
|
+
|
3
|
+
module Cocaine
|
4
|
+
class CommandLine
|
5
|
+
class PopenRunner
|
6
|
+
def self.supported?
|
7
|
+
true
|
8
|
+
end
|
9
|
+
|
10
|
+
def supported?
|
11
|
+
self.class.supported?
|
12
|
+
end
|
13
|
+
|
14
|
+
def call(command, env = {})
|
15
|
+
with_modified_environment(env) do
|
16
|
+
IO.popen(command, "r") do |pipe|
|
17
|
+
pipe.read
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def with_modified_environment(env, &block)
|
25
|
+
ClimateControl.modify(env, &block)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -3,28 +3,46 @@
|
|
3
3
|
module Cocaine
|
4
4
|
class CommandLine
|
5
5
|
class PosixRunner
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
result = input.read
|
13
|
-
waitpid(pid)
|
14
|
-
result
|
6
|
+
def self.available?
|
7
|
+
begin
|
8
|
+
require 'posix/spawn'
|
9
|
+
true
|
10
|
+
rescue LoadError => e
|
11
|
+
false
|
15
12
|
end
|
13
|
+
end
|
16
14
|
|
17
|
-
|
15
|
+
def self.supported?
|
16
|
+
available? && !Cocaine::CommandLine.java?
|
17
|
+
end
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
def supported?
|
20
|
+
self.class.supported?
|
21
|
+
end
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
def call(command, env = {})
|
24
|
+
input, output = IO.pipe
|
25
|
+
pid = spawn(env, command, :out => output)
|
26
|
+
output.close
|
27
|
+
result = ""
|
28
|
+
while partial_result = input.read(8192)
|
29
|
+
result << partial_result
|
25
30
|
end
|
31
|
+
waitpid(pid)
|
32
|
+
input.close
|
33
|
+
result
|
34
|
+
end
|
26
35
|
|
36
|
+
private
|
37
|
+
|
38
|
+
def spawn(*args)
|
39
|
+
POSIX::Spawn.spawn(*args)
|
40
|
+
end
|
41
|
+
|
42
|
+
def waitpid(pid)
|
43
|
+
Process.waitpid(pid)
|
27
44
|
end
|
45
|
+
|
28
46
|
end
|
29
47
|
end
|
30
48
|
end
|
@@ -3,29 +3,42 @@
|
|
3
3
|
module Cocaine
|
4
4
|
class CommandLine
|
5
5
|
class ProcessRunner
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
input, output = IO.pipe
|
10
|
-
pid = spawn(env, command, :out => output)
|
11
|
-
output.close
|
12
|
-
result = input.read
|
13
|
-
waitpid(pid)
|
14
|
-
result
|
15
|
-
end
|
6
|
+
def self.available?
|
7
|
+
Process.respond_to?(:spawn)
|
8
|
+
end
|
16
9
|
|
17
|
-
|
10
|
+
def self.supported?
|
11
|
+
available? && !Cocaine::CommandLine.java?
|
12
|
+
end
|
18
13
|
|
19
|
-
|
20
|
-
|
21
|
-
|
14
|
+
def supported?
|
15
|
+
self.class.supported?
|
16
|
+
end
|
17
|
+
|
18
|
+
def call(command, env = {})
|
19
|
+
input, output = IO.pipe
|
20
|
+
pid = spawn(env, command, :out => output)
|
21
|
+
output.close
|
22
|
+
result = input.read
|
23
|
+
waitpid(pid)
|
24
|
+
input.close
|
25
|
+
result
|
26
|
+
end
|
22
27
|
|
23
|
-
|
28
|
+
private
|
29
|
+
|
30
|
+
def spawn(*args)
|
31
|
+
Process.spawn(*args)
|
32
|
+
end
|
33
|
+
|
34
|
+
def waitpid(pid)
|
35
|
+
begin
|
24
36
|
Process.waitpid(pid)
|
37
|
+
rescue Errno::ECHILD => e
|
38
|
+
# In JRuby, waiting on a finished pid raises.
|
25
39
|
end
|
26
|
-
|
27
40
|
end
|
41
|
+
|
28
42
|
end
|
29
43
|
end
|
30
44
|
end
|
31
|
-
|
data/lib/cocaine/exceptions.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# coding: UTF-8
|
2
2
|
|
3
3
|
module Cocaine
|
4
|
-
class CommandLineError
|
4
|
+
class CommandLineError < StandardError; end
|
5
5
|
class CommandNotFoundError < CommandLineError; end
|
6
|
-
class ExitStatusError
|
7
|
-
class InterpolationError
|
6
|
+
class ExitStatusError < CommandLineError; end
|
7
|
+
class InterpolationError < CommandLineError; end
|
8
8
|
end
|
data/lib/cocaine/version.rb
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Cocaine::CommandLine::BackticksRunner do
|
4
|
-
|
4
|
+
if Cocaine::CommandLine::BackticksRunner.supported?
|
5
|
+
it_behaves_like 'a command that does not block'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
it 'runs the command given' do
|
8
|
+
subject.call("echo hello").should == "hello\n"
|
9
|
+
end
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
it 'modifies the environment and runs the command given' do
|
12
|
+
subject.call("echo $yes", {"yes" => "no"}).should == "no\n"
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
it 'sets the exitstatus when a command completes' do
|
16
|
+
subject.call("ruby -e 'exit 0'")
|
17
|
+
$?.exitstatus.should == 0
|
18
|
+
subject.call("ruby -e 'exit 5'")
|
19
|
+
$?.exitstatus.should == 5
|
20
|
+
end
|
19
21
|
end
|
20
22
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Cocaine::CommandLine::PopenRunner do
|
4
|
+
if Cocaine::CommandLine::PopenRunner.supported?
|
5
|
+
it_behaves_like 'a command that does not block'
|
6
|
+
|
7
|
+
it 'runs the command given' do
|
8
|
+
subject.call("echo hello").should == "hello\n"
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'modifies the environment and runs the command given' do
|
12
|
+
subject.call("echo $yes", {"yes" => "no"}).should == "no\n"
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'sets the exitstatus when a command completes' do
|
16
|
+
subject.call("ruby -e 'exit 0'")
|
17
|
+
$?.exitstatus.should == 0
|
18
|
+
subject.call("ruby -e 'exit 5'")
|
19
|
+
$?.exitstatus.should == 5
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Cocaine::CommandLine::PosixRunner do
|
4
|
-
if Cocaine::CommandLine::
|
4
|
+
if Cocaine::CommandLine::PosixRunner.supported?
|
5
5
|
it_behaves_like 'a command that does not block'
|
6
6
|
|
7
7
|
it 'runs the command given' do
|
@@ -20,4 +20,3 @@ describe Cocaine::CommandLine::PosixRunner do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
|
-
|
@@ -69,6 +69,15 @@ describe Cocaine::CommandLine do
|
|
69
69
|
command.run(:hello_world => "Hello, world").should match(/Hello, world/)
|
70
70
|
end
|
71
71
|
|
72
|
+
it "does not blow up if running the command errored before the actual execution" do
|
73
|
+
assuming_no_processes_have_been_run
|
74
|
+
command = Cocaine::CommandLine.new("echo", ":hello_world")
|
75
|
+
command.stubs(:command).raises("An Error")
|
76
|
+
|
77
|
+
lambda{ command.run }.should raise_error("An Error")
|
78
|
+
command.exit_status.should be_nil
|
79
|
+
end
|
80
|
+
|
72
81
|
it "quotes command line options differently if we're on windows" do
|
73
82
|
on_windows!
|
74
83
|
cmd = Cocaine::CommandLine.new("convert",
|
@@ -202,7 +211,7 @@ describe Cocaine::CommandLine do
|
|
202
211
|
|
203
212
|
it 'can still take something that does not respond to tty as a logger' do
|
204
213
|
output_buffer = StringIO.new
|
205
|
-
logger =
|
214
|
+
logger = best_logger.new(output_buffer)
|
206
215
|
logger.should_not respond_to(:tty?)
|
207
216
|
Cocaine::CommandLine.new("echo", "'Logging!' :foo", :logger => logger).run(:foo => "bar")
|
208
217
|
output_buffer.rewind
|
@@ -229,38 +238,39 @@ describe Cocaine::CommandLine do
|
|
229
238
|
|
230
239
|
describe "command execution" do
|
231
240
|
it "uses the BackticksRunner by default" do
|
232
|
-
|
233
|
-
Cocaine::CommandLine.stubs(:
|
241
|
+
Cocaine::CommandLine::ProcessRunner.stubs(:supported?).returns(false)
|
242
|
+
Cocaine::CommandLine::PosixRunner.stubs(:supported?).returns(false)
|
234
243
|
|
235
244
|
cmd = Cocaine::CommandLine.new("echo", "hello")
|
245
|
+
|
236
246
|
cmd.runner.class.should == Cocaine::CommandLine::BackticksRunner
|
237
247
|
end
|
238
248
|
|
239
249
|
it "uses the ProcessRunner on 1.9 and it's available" do
|
240
|
-
|
241
|
-
Cocaine::CommandLine.stubs(:
|
250
|
+
Cocaine::CommandLine::ProcessRunner.stubs(:supported?).returns(true)
|
251
|
+
Cocaine::CommandLine::PosixRunner.stubs(:supported?).returns(false)
|
242
252
|
|
243
253
|
cmd = Cocaine::CommandLine.new("echo", "hello")
|
244
254
|
cmd.runner.class.should == Cocaine::CommandLine::ProcessRunner
|
245
255
|
end
|
246
256
|
|
247
|
-
it "uses the PosixRunner if the
|
248
|
-
Cocaine::CommandLine.stubs(:
|
257
|
+
it "uses the PosixRunner if the PosixRunner is available" do
|
258
|
+
Cocaine::CommandLine::PosixRunner.stubs(:supported?).returns(true)
|
249
259
|
|
250
260
|
cmd = Cocaine::CommandLine.new("echo", "hello")
|
251
261
|
cmd.runner.class.should == Cocaine::CommandLine::PosixRunner
|
252
262
|
end
|
253
263
|
|
254
|
-
it "uses the BackticksRunner if the
|
255
|
-
Cocaine::CommandLine.stubs(:
|
264
|
+
it "uses the BackticksRunner if the PosixRunner is available, but we told it to use Backticks all the time" do
|
265
|
+
Cocaine::CommandLine::PosixRunner.stubs(:supported?).returns(true)
|
256
266
|
Cocaine::CommandLine.runner = Cocaine::CommandLine::BackticksRunner.new
|
257
267
|
|
258
268
|
cmd = Cocaine::CommandLine.new("echo", "hello")
|
259
269
|
cmd.runner.class.should == Cocaine::CommandLine::BackticksRunner
|
260
270
|
end
|
261
271
|
|
262
|
-
it "uses the BackticksRunner if the
|
263
|
-
Cocaine::CommandLine.stubs(:
|
272
|
+
it "uses the BackticksRunner if the PosixRunner is available, but we told it to use Backticks" do
|
273
|
+
Cocaine::CommandLine::PosixRunner.stubs(:supported?).returns(true)
|
264
274
|
|
265
275
|
cmd = Cocaine::CommandLine.new("echo", "hello", :runner => Cocaine::CommandLine::BackticksRunner.new)
|
266
276
|
cmd.runner.class.should == Cocaine::CommandLine::BackticksRunner
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'rspec'
|
2
|
-
require 'mocha'
|
2
|
+
require 'mocha/api'
|
3
3
|
require 'bourne'
|
4
4
|
require 'cocaine'
|
5
5
|
require 'timeout'
|
@@ -14,4 +14,15 @@ RSpec.configure do |config|
|
|
14
14
|
config.mock_with :mocha
|
15
15
|
config.include WithExitstatus
|
16
16
|
config.include StubOS
|
17
|
+
config.include UnsettingExitstatus
|
18
|
+
end
|
19
|
+
|
20
|
+
def best_logger
|
21
|
+
if ActiveSupport.const_defined?("Logger")
|
22
|
+
ActiveSupport::Logger
|
23
|
+
elsif ActiveSupport.const_defined?("BufferedLogger")
|
24
|
+
ActiveSupport::BufferedLogger
|
25
|
+
else
|
26
|
+
Logger
|
27
|
+
end
|
17
28
|
end
|
metadata
CHANGED
@@ -1,139 +1,146 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocaine
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.2
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 5
|
9
|
-
- 1
|
10
|
-
version: 0.5.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Jon Yurek
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-09-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: climate_control
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 25
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 0
|
33
|
-
- 3
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 0.0.3
|
35
22
|
- - <
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
|
38
|
-
segments:
|
39
|
-
- 1
|
40
|
-
- 0
|
41
|
-
version: "1.0"
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '1.0'
|
42
25
|
type: :runtime
|
43
|
-
version_requirements: *id001
|
44
|
-
- !ruby/object:Gem::Dependency
|
45
|
-
name: rspec
|
46
26
|
prerelease: false
|
47
|
-
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.0.3
|
33
|
+
- - <
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '1.0'
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
48
39
|
none: false
|
49
|
-
requirements:
|
50
|
-
- -
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
|
53
|
-
segments:
|
54
|
-
- 0
|
55
|
-
version: "0"
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
56
44
|
type: :development
|
57
|
-
version_requirements: *id002
|
58
|
-
- !ruby/object:Gem::Dependency
|
59
|
-
name: bourne
|
60
45
|
prerelease: false
|
61
|
-
|
46
|
+
version_requirements: !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
48
|
+
requirements:
|
49
|
+
- - ! '>='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: bourne
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
62
55
|
none: false
|
63
|
-
requirements:
|
64
|
-
- -
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
|
67
|
-
segments:
|
68
|
-
- 0
|
69
|
-
version: "0"
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
70
60
|
type: :development
|
71
|
-
version_requirements: *id003
|
72
|
-
- !ruby/object:Gem::Dependency
|
73
|
-
name: mocha
|
74
61
|
prerelease: false
|
75
|
-
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ! '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: mocha
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
76
71
|
none: false
|
77
|
-
requirements:
|
78
|
-
- -
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
|
81
|
-
segments:
|
82
|
-
- 0
|
83
|
-
version: "0"
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
84
76
|
type: :development
|
85
|
-
version_requirements: *id004
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
name: rake
|
88
77
|
prerelease: false
|
89
|
-
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
80
|
+
requirements:
|
81
|
+
- - ! '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rake
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
90
87
|
none: false
|
91
|
-
requirements:
|
92
|
-
- -
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
|
95
|
-
segments:
|
96
|
-
- 0
|
97
|
-
version: "0"
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
98
92
|
type: :development
|
99
|
-
version_requirements: *id005
|
100
|
-
- !ruby/object:Gem::Dependency
|
101
|
-
name: active_support
|
102
93
|
prerelease: false
|
103
|
-
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
104
95
|
none: false
|
105
|
-
requirements:
|
106
|
-
- -
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
96
|
+
requirements:
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: activesupport
|
102
|
+
requirement: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
104
|
+
requirements:
|
105
|
+
- - ! '>='
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: 3.0.0
|
108
|
+
- - <
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '5.0'
|
112
111
|
type: :development
|
113
|
-
version_requirements: *id006
|
114
|
-
- !ruby/object:Gem::Dependency
|
115
|
-
name: pry
|
116
112
|
prerelease: false
|
117
|
-
|
113
|
+
version_requirements: !ruby/object:Gem::Requirement
|
118
114
|
none: false
|
119
|
-
requirements:
|
120
|
-
- -
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
version:
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: 3.0.0
|
119
|
+
- - <
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '5.0'
|
122
|
+
- !ruby/object:Gem::Dependency
|
123
|
+
name: pry
|
124
|
+
requirement: !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
126
|
+
requirements:
|
127
|
+
- - ! '>='
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
126
130
|
type: :development
|
127
|
-
|
131
|
+
prerelease: false
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
133
|
+
none: false
|
134
|
+
requirements:
|
135
|
+
- - ! '>='
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
128
138
|
description: A small library for doing (command) lines
|
129
139
|
email: jyurek@thoughtbot.com
|
130
140
|
executables: []
|
131
|
-
|
132
141
|
extensions: []
|
133
|
-
|
134
142
|
extra_rdoc_files: []
|
135
|
-
|
136
|
-
files:
|
143
|
+
files:
|
137
144
|
- .gitignore
|
138
145
|
- .travis.yml
|
139
146
|
- GOALS
|
@@ -148,12 +155,14 @@ files:
|
|
148
155
|
- lib/cocaine/command_line/runners.rb
|
149
156
|
- lib/cocaine/command_line/runners/backticks_runner.rb
|
150
157
|
- lib/cocaine/command_line/runners/fake_runner.rb
|
158
|
+
- lib/cocaine/command_line/runners/popen_runner.rb
|
151
159
|
- lib/cocaine/command_line/runners/posix_runner.rb
|
152
160
|
- lib/cocaine/command_line/runners/process_runner.rb
|
153
161
|
- lib/cocaine/exceptions.rb
|
154
162
|
- lib/cocaine/version.rb
|
155
163
|
- spec/cocaine/command_line/runners/backticks_runner_spec.rb
|
156
164
|
- spec/cocaine/command_line/runners/fake_runner_spec.rb
|
165
|
+
- spec/cocaine/command_line/runners/popen_runner_spec.rb
|
157
166
|
- spec/cocaine/command_line/runners/posix_runner_spec.rb
|
158
167
|
- spec/cocaine/command_line/runners/process_runner_spec.rb
|
159
168
|
- spec/cocaine/command_line_spec.rb
|
@@ -161,44 +170,36 @@ files:
|
|
161
170
|
- spec/support/fake_logger.rb
|
162
171
|
- spec/support/nonblocking_examples.rb
|
163
172
|
- spec/support/stub_os.rb
|
173
|
+
- spec/support/unsetting_exitstatus.rb
|
164
174
|
- spec/support/with_exitstatus.rb
|
165
|
-
has_rdoc: true
|
166
175
|
homepage: http://github.com/thoughtbot/cocaine
|
167
176
|
licenses: []
|
168
|
-
|
169
177
|
post_install_message:
|
170
178
|
rdoc_options: []
|
171
|
-
|
172
|
-
require_paths:
|
179
|
+
require_paths:
|
173
180
|
- lib
|
174
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
181
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
175
182
|
none: false
|
176
|
-
requirements:
|
177
|
-
- -
|
178
|
-
- !ruby/object:Gem::Version
|
179
|
-
|
180
|
-
|
181
|
-
- 0
|
182
|
-
version: "0"
|
183
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ! '>='
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0'
|
187
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
188
|
none: false
|
185
|
-
requirements:
|
186
|
-
- -
|
187
|
-
- !ruby/object:Gem::Version
|
188
|
-
|
189
|
-
segments:
|
190
|
-
- 0
|
191
|
-
version: "0"
|
189
|
+
requirements:
|
190
|
+
- - ! '>='
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
192
193
|
requirements: []
|
193
|
-
|
194
194
|
rubyforge_project:
|
195
|
-
rubygems_version: 1.
|
195
|
+
rubygems_version: 1.8.23
|
196
196
|
signing_key:
|
197
197
|
specification_version: 3
|
198
198
|
summary: A small library for doing (command) lines
|
199
|
-
test_files:
|
199
|
+
test_files:
|
200
200
|
- spec/cocaine/command_line/runners/backticks_runner_spec.rb
|
201
201
|
- spec/cocaine/command_line/runners/fake_runner_spec.rb
|
202
|
+
- spec/cocaine/command_line/runners/popen_runner_spec.rb
|
202
203
|
- spec/cocaine/command_line/runners/posix_runner_spec.rb
|
203
204
|
- spec/cocaine/command_line/runners/process_runner_spec.rb
|
204
205
|
- spec/cocaine/command_line_spec.rb
|
@@ -206,4 +207,5 @@ test_files:
|
|
206
207
|
- spec/support/fake_logger.rb
|
207
208
|
- spec/support/nonblocking_examples.rb
|
208
209
|
- spec/support/stub_os.rb
|
210
|
+
- spec/support/unsetting_exitstatus.rb
|
209
211
|
- spec/support/with_exitstatus.rb
|