pipe-run 0.2.0 → 0.2.1

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.
Files changed (5) hide show
  1. data/README.md +7 -6
  2. data/VERSION +1 -1
  3. data/lib/pipe-run.rb +4 -0
  4. data/pipe-run.gemspec +3 -3
  5. metadata +4 -4
data/README.md CHANGED
@@ -10,14 +10,14 @@ Pipe Run
10
10
 
11
11
  ### Asynchronous Use
12
12
 
13
- In case, `eventmachine` is available, non-blocking run of the command is
13
+ In case, [`eventmachine`][1] is available, non-blocking run of the command is
14
14
  possible using `#run_nonblock` or `#run` with block given, defined in
15
15
  `em-pipe-run` file. So for example:
16
16
 
17
- require "em-pipe-run"
18
-
19
- Pipe.run("date") do |output| # non-blocking
20
- puts output # will print out for example 'Thu Feb 17 17:22:18 CET 2011'
17
+ EM::run do
18
+ Pipe.run("date") do |output| # non-blocking
19
+ puts output # will print out for example 'Thu Feb 17 17:22:18 CET 2011'
20
+ end
21
21
  end
22
22
 
23
23
  Contributing
@@ -36,5 +36,6 @@ Copyright
36
36
  Copyright © 2010 – 2011 [Martin Kozák][3]. See `LICENSE.txt` for
37
37
  further details.
38
38
 
39
- [2]: http://github.com/martinkozak/qrpc/issues
39
+ [1]: http://rubyeventmachine.com/
40
+ [2]: http://github.com/martinkozak/pipe-run/issues
40
41
  [3]: http://www.martinkozak.net/
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/lib/pipe-run.rb CHANGED
@@ -20,6 +20,10 @@ class Pipe
20
20
 
21
21
  def self.run(command, &block)
22
22
  if not block.nil?
23
+ if not self.respond_to? :run_nonblock
24
+ require "em-pipe-run"
25
+ end
26
+
23
27
  return self.run_nonblock(command, &block)
24
28
  end
25
29
 
data/pipe-run.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pipe-run}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Martin Kozák"]
12
- s.date = %q{2011-02-22}
12
+ s.date = %q{2011-03-09}
13
13
  s.email = %q{martinkozak@martinkozak.net}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE.txt",
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
30
30
  s.homepage = %q{https://github.com/martinkozak/pipe-run}
31
31
  s.licenses = ["MIT"]
32
32
  s.require_paths = ["lib"]
33
- s.rubygems_version = %q{1.5.2}
33
+ s.rubygems_version = %q{1.6.1}
34
34
  s.summary = %q{Runs command and returns its standard output in one call. Both synchronous and asynchronous (with eventmachine) running is supported.}
35
35
 
36
36
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: pipe-run
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - "Martin Koz\xC3\xA1k"
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-22 00:00:00 +01:00
13
+ date: 2011-03-09 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -69,7 +69,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
69
  requirements:
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- hash: -1865702309634779703
72
+ hash: 247694265029296000
73
73
  segments:
74
74
  - 0
75
75
  version: "0"
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  requirements: []
83
83
 
84
84
  rubyforge_project:
85
- rubygems_version: 1.5.2
85
+ rubygems_version: 1.6.1
86
86
  signing_key:
87
87
  specification_version: 3
88
88
  summary: Runs command and returns its standard output in one call. Both synchronous and asynchronous (with eventmachine) running is supported.