pipe_to 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/pipe_to.rb +16 -0
  2. metadata +46 -0
@@ -0,0 +1,16 @@
1
+
2
+ require 'open3'
3
+
4
+ class String
5
+ def pipe_to cmd
6
+ Open3.popen2 cmd do |i, o|
7
+ i.print self
8
+ i.close
9
+ o.read
10
+ end
11
+ end
12
+
13
+ def | cmd
14
+ pipe_to "#{cmd}"
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pipe_to
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - David Kendal
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-11-01 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Adds methods to String for piping a string to the standard input of a
15
+ Unix program and retrieving the standard output.
16
+ email: dpkendal@dpk.org.uk
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - lib/pipe_to.rb
22
+ homepage: http://github.com/dpkendal/pipe_to/
23
+ licenses: []
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 1.8.6
43
+ signing_key:
44
+ specification_version: 3
45
+ summary: pipe_to
46
+ test_files: []