cocaine 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 750b34929d7740b3106549975bb0700c807130f1
4
- data.tar.gz: a063b0294e34258351f5b1bfe792cec481004e5e
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NmY5NWQ4N2NiMDRiZjU4NDExMzU5Y2M0YzU3YzZlMDdkYzcyZDgzMA==
5
+ data.tar.gz: !binary |-
6
+ ODg5YjRhZDEzMmI0NWUxOWMxN2ZjZTkwNjdlNGVjOWMwMGIwNTIyYg==
5
7
  SHA512:
6
- metadata.gz: c83f8e5119643be599f791f60051a208cd07549a63088f3b6700949b834a79d8cc82285281f4a94aa71a232fd642f22c4a328b19cc7ac7444558247f54091fce
7
- data.tar.gz: 1912dd9fe81df0f2ceb52378b0f95df326747ba1f6f831af9ae5a7c4f74aa83237e5ceddf40885b23de3eb9c2d61dc831cc8289cf2b8af0d562060502aef9dc3
8
+ metadata.gz: !binary |-
9
+ MGZkM2I3YmI2YmE5ODZjZGIzZDVmOWQwZTJkYjMwOGMwN2MzNmI5YmM5OTZl
10
+ MmQ3YWZiYTY3M2I2MWJkNDgxOGE5ZTI0NGY5ZTYwZTdkZDlkNDg0MWMxOTdj
11
+ ZGIzOGIxNmUzYzJkYWY5OTUyOGI1ZDZjZGQ2NzczNTc4MGJkMDg=
12
+ data.tar.gz: !binary |-
13
+ MjFmNTZhMjA5NWI4MjUyNWI2NzM3YjI3MmI0NzIzODJmM2UyNWRjOTg4NDky
14
+ OTU4NzY4ZTg3OTc3OTFiMTc0OGVjZDNiYmUyYTdmNTBlMjVkYmIxNzgxYzQz
15
+ MzIxYzc1MmIzMWExNGMzNTEwYzM1YzE2NTQ4N2Q4NGYwYmVmMzg=
@@ -1,7 +1,5 @@
1
1
  rvm:
2
2
  - 1.9.3
3
3
  - 2.0.0
4
- - 2.1.0
5
- - 2.1.1
6
- - 2.1.2
4
+ - 2.1.5
7
5
  - jruby-19mode
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
data/README.md CHANGED
@@ -18,9 +18,9 @@ Interpolated arguments:
18
18
 
19
19
  ```ruby
20
20
  line = Cocaine::CommandLine.new("convert", ":in -scale :resolution :out")
21
- line.command(:in => "omg.jpg",
22
- :resolution => "32x32",
23
- :out => "omg_thumb.jpg")
21
+ line.command(in: "omg.jpg",
22
+ resolution: "32x32",
23
+ out: "omg_thumb.jpg")
24
24
  # => "convert 'omg.jpg' -scale '32x32' 'omg_thumb.jpg'"
25
25
  ```
26
26
 
@@ -28,10 +28,10 @@ It prevents attempts at being bad:
28
28
 
29
29
  ```ruby
30
30
  line = Cocaine::CommandLine.new("cat", ":file")
31
- line.command(:file => "haha`rm -rf /`.txt") # => "cat 'haha`rm -rf /`.txt'"
31
+ line.command(file: "haha`rm -rf /`.txt") # => "cat 'haha`rm -rf /`.txt'"
32
32
 
33
33
  line = Cocaine::CommandLine.new("cat", ":file")
34
- line.command(:file => "ohyeah?'`rm -rf /`.ha!") # => "cat 'ohyeah?'\\''`rm -rf /`.ha!'"
34
+ line.command(file: "ohyeah?'`rm -rf /`.ha!") # => "cat 'ohyeah?'\\''`rm -rf /`.ha!'"
35
35
  ```
36
36
 
37
37
  NOTE: It only does that for arguments interpolated via `run`, NOT arguments
@@ -46,7 +46,7 @@ line.run # => "hahawebserver"
46
46
  You can ignore the result:
47
47
 
48
48
  ```ruby
49
- line = Cocaine::CommandLine.new("noisy", "--extra-verbose", :swallow_stderr => true)
49
+ line = Cocaine::CommandLine.new("noisy", "--extra-verbose", swallow_stderr: true)
50
50
  line.command # => "noisy --extra-verbose 2>/dev/null"
51
51
 
52
52
  # ... and on Windows...
@@ -67,7 +67,7 @@ end
67
67
  If your command might return something non-zero, and you expect that, it's cool:
68
68
 
69
69
  ```ruby
70
- line = Cocaine::CommandLine.new("/usr/bin/false", "", :expected_outcodes => [0, 1])
70
+ line = Cocaine::CommandLine.new("/usr/bin/false", "", expected_outcodes: [0, 1])
71
71
  begin
72
72
  line.run
73
73
  rescue Cocaine::ExitStatusError => e
@@ -114,8 +114,8 @@ line.command # => "/opt/bin/lolwut"
114
114
  You can see what's getting run. The 'Command' part it logs is in green for visibility!
115
115
 
116
116
  ```ruby
117
- line = Cocaine::CommandLine.new("echo", ":var", :logger => Logger.new(STDOUT))
118
- line.run(:var => "LOL!") # => Logs this with #info -> Command :: echo 'LOL!'
117
+ line = Cocaine::CommandLine.new("echo", ":var", logger: Logger.new(STDOUT))
118
+ line.run(var: "LOL!") # => Logs this with #info -> Command :: echo 'LOL!'
119
119
  ```
120
120
 
121
121
  Or log every command:
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.author = "Jon Yurek"
9
9
  s.email = "jyurek@thoughtbot.com"
10
- s.homepage = "http://github.com/thoughtbot/cocaine"
10
+ s.homepage = "https://github.com/thoughtbot/cocaine"
11
11
  s.summary = "A small library for doing (command) lines"
12
12
  s.description = "A small library for doing (command) lines"
13
13
  s.license = "MIT"
@@ -125,7 +125,7 @@ module Cocaine
125
125
  end
126
126
 
127
127
  def unix_path_prefix
128
- "PATH=#{self.class.path}#{OS.path_separator}$PATH"
128
+ "PATH=#{self.class.path}#{OS.path_separator}$PATH;"
129
129
  end
130
130
 
131
131
  def windows_path_prefix
@@ -4,10 +4,9 @@ module Cocaine
4
4
  class CommandLine
5
5
  class PosixRunner
6
6
  def self.available?
7
- require 'posix/spawn'
8
- true
9
- rescue LoadError
10
- false
7
+ return @available unless @available.nil?
8
+
9
+ @available = posix_spawn_gem_available?
11
10
  end
12
11
 
13
12
  def self.supported?
@@ -42,6 +41,14 @@ module Cocaine
42
41
  Process.waitpid(pid)
43
42
  end
44
43
 
44
+ def self.posix_spawn_gem_available?
45
+ require 'posix/spawn'
46
+ true
47
+ rescue
48
+ false
49
+ end
50
+
51
+ private_class_method :posix_spawn_gem_available?
45
52
  end
46
53
  end
47
54
  end
@@ -1,5 +1,5 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  module Cocaine
4
- VERSION = "0.5.5".freeze
4
+ VERSION = "0.5.6".freeze
5
5
  end
@@ -14,7 +14,7 @@ describe Cocaine::CommandLine do
14
14
  it "specifies the $PATH where the command can be found on unix" do
15
15
  Cocaine::CommandLine.path = ["/path/to/command/dir", "/"]
16
16
  cmd = Cocaine::CommandLine.new("ls")
17
- cmd.command.should == "PATH=/path/to/command/dir:/:$PATH ls"
17
+ cmd.command.should == "PATH=/path/to/command/dir:/:$PATH; ls"
18
18
  end
19
19
 
20
20
  it "specifies the %PATH% where the command can be found on windows" do
metadata CHANGED
@@ -1,123 +1,123 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocaine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Yurek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-09 00:00:00.000000000 Z
11
+ date: 2015-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.0.3
20
- - - "<"
20
+ - - <
21
21
  - !ruby/object:Gem::Version
22
22
  version: '1.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ">="
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: 0.0.3
30
- - - "<"
30
+ - - <
31
31
  - !ruby/object:Gem::Version
32
32
  version: '1.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rspec
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
37
+ - - ! '>='
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ">="
44
+ - - ! '>='
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bourne
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
51
+ - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ">="
58
+ - - ! '>='
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: mocha
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ">="
65
+ - - ! '>='
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ">="
72
+ - - ! '>='
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rake
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ">="
79
+ - - ! '>='
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ">="
86
+ - - ! '>='
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: activesupport
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ">="
93
+ - - ! '>='
94
94
  - !ruby/object:Gem::Version
95
95
  version: 3.0.0
96
- - - "<"
96
+ - - <
97
97
  - !ruby/object:Gem::Version
98
98
  version: '5.0'
99
99
  type: :development
100
100
  prerelease: false
101
101
  version_requirements: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ">="
103
+ - - ! '>='
104
104
  - !ruby/object:Gem::Version
105
105
  version: 3.0.0
106
- - - "<"
106
+ - - <
107
107
  - !ruby/object:Gem::Version
108
108
  version: '5.0'
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: pry
111
111
  requirement: !ruby/object:Gem::Requirement
112
112
  requirements:
113
- - - ">="
113
+ - - ! '>='
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  type: :development
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - ">="
120
+ - - ! '>='
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  description: A small library for doing (command) lines
@@ -126,8 +126,8 @@ executables: []
126
126
  extensions: []
127
127
  extra_rdoc_files: []
128
128
  files:
129
- - ".gitignore"
130
- - ".travis.yml"
129
+ - .gitignore
130
+ - .travis.yml
131
131
  - GOALS
132
132
  - Gemfile
133
133
  - LICENSE
@@ -161,7 +161,7 @@ files:
161
161
  - spec/support/stub_os.rb
162
162
  - spec/support/unsetting_exitstatus.rb
163
163
  - spec/support/with_exitstatus.rb
164
- homepage: http://github.com/thoughtbot/cocaine
164
+ homepage: https://github.com/thoughtbot/cocaine
165
165
  licenses:
166
166
  - MIT
167
167
  metadata: {}
@@ -171,17 +171,17 @@ require_paths:
171
171
  - lib
172
172
  required_ruby_version: !ruby/object:Gem::Requirement
173
173
  requirements:
174
- - - ">="
174
+ - - ! '>='
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0'
177
177
  required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  requirements:
179
- - - ">="
179
+ - - ! '>='
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  requirements: []
183
183
  rubyforge_project:
184
- rubygems_version: 2.2.2
184
+ rubygems_version: 2.4.5
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: A small library for doing (command) lines