tap_dance 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzExZjdiYWJkNWY0Y2Y2YmY2OTU4MmMyYzE2OTViZGI1MGExYjViOQ==
4
+ YjU3ZjE1MTliMmUxM2YyMzk3MjVlOTdiYmE2NjI3ZDhiMWYzZDNlYQ==
5
5
  data.tar.gz: !binary |-
6
- NWJhZDAyZGUzMzI2NzQ2ZjI4Y2FiYjlmNWRmMmQxOGM3YTg4ZGQ4Ng==
6
+ NDU2Y2NiZThlY2EwYTRkYjRjN2YwZTRmNmQzNThhNTZlYTQ3OGVhYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MzM2NTg3NWE4NjA3YjI2MjRkYTRlNjM3ODBmNDIyZjI2NDI0ZmM3OGZhMDMw
10
- ODAyNmVlZmY0ZmQ0ZjYzMjIxNDc3MjAzZDY5OTVhNjIyMTQ5MDEzNmM0ZmVl
11
- ZjczNzYzYzRkZjViMTI0MGM4ZDNkNmU1NzEyMzM1M2U5NGRiNjE=
9
+ YjBjNGJhN2I0NTc5MTMwZjhjODYyMGJiZDI2NmI4ZjY1YzE4NTRiYmMxYzZm
10
+ OTliZTU2MjJiYzcyM2U2MDE1YWMwYWMxOTc2MTM5YzliZmFjZDRiYjU3ZWQ5
11
+ MTRhYTZhZjZiMjhjZjIwMDljMDcyZThkOTViNTc2Yzg4ZjJmN2M=
12
12
  data.tar.gz: !binary |-
13
- YmRhODI3M2U2Y2IxZmIxYjc5YmQ1ZGFkOWYzNDRlY2Y5MWYzZTg4YWQzMzBj
14
- YTNjNTFhZmE0ODVhNTRjN2NkZDdiYWQwOTg1NTFjZmM4MGNkYWU2ZjE0OTcw
15
- ZTIzZDg3MjYwNWE5MDc5NmVkMTRjZjI2ODIxOWE5NzE0NjE4Mjk=
13
+ MTdlNjI5MjAwYjNlMmUwNTdlYmI0ZWIwOGIyMjQ2M2Y2MzkwZWZiOTMyNzM4
14
+ NjkwMzgwMGVjZDEwNDUxYzJkMjg3NGE1ZTAwMDRjMDc2NmUzMTNkMWQ1ZTll
15
+ MWUzNTJlZTg1NmUyZDc4YzgyYzhmMmVhYTE3YzU5YTE4ZjRhYjI=
@@ -1,4 +1,20 @@
1
- require 'open3'
1
+ # require 'open3'
2
+ ### Patch open4 command for cross-Ruby joy
3
+ ## Only works on >= 1.9
4
+ # out, err, sts = Open3.capture3 cmd
5
+ #
6
+ ## popen3 doesn't return exit status
7
+ #
8
+ ## Doesn't work on JRuby
9
+ # pid, stdin, stdout, stderr = open4(cmd)
10
+ if IO.respond_to?(:popen4)
11
+ def open4(*args)
12
+ IO.popen4(*args)
13
+ end
14
+ else
15
+ require 'open4'
16
+ include Open4
17
+ end
2
18
 
3
19
  module TapDance
4
20
  class ShellResult
@@ -7,7 +23,12 @@ module TapDance
7
23
  attr_reader :status
8
24
 
9
25
  def self.of(cmd)
10
- out, err, sts = Open3.capture3 cmd
26
+ out = nil
27
+ err = nil
28
+ sts = open4(cmd) do |pid, stdin, stdout, stderr|
29
+ out = stdout.read
30
+ err = stderr.read
31
+ end
11
32
  new out, err, sts.exitstatus
12
33
  end
13
34
 
@@ -1,3 +1,3 @@
1
1
  module TapDance
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/tap_dance.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://github.com/nybblr/tap_dance"
14
14
  spec.license = "MIT"
15
15
 
16
- spec.required_ruby_version = '>= 1.9.1'
16
+ spec.required_ruby_version = '>= 1.8.7'
17
17
 
18
18
  spec.files = `git ls-files`.split($/)
19
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
@@ -21,6 +21,8 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ["lib", "ext"]
22
22
 
23
23
  spec.add_dependency "thor"
24
+ spec.add_dependency "open4"
25
+
24
26
  spec.add_development_dependency "bundler"
25
27
  spec.add_development_dependency "rake"
26
28
  spec.add_development_dependency "rspec"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tap_dance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-29 00:00:00.000000000 Z
11
+ date: 2013-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: open4
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -148,7 +162,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
162
  requirements:
149
163
  - - ! '>='
150
164
  - !ruby/object:Gem::Version
151
- version: 1.9.1
165
+ version: 1.8.7
152
166
  required_rubygems_version: !ruby/object:Gem::Requirement
153
167
  requirements:
154
168
  - - ! '>='