process-pipeline 1.0.1 → 1.0.2
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 +5 -5
- data/lib/process/pipeline/step.rb +1 -1
- data/lib/process/pipeline/version.rb +1 -1
- metadata +34 -28
- data/.gitignore +0 -12
- data/.rspec +0 -3
- data/.travis.yml +0 -7
- data/Gemfile +0 -12
- data/README.md +0 -128
- data/Rakefile +0 -14
- data/process-pipeline.gemspec +0 -24
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 40979b67b2c013eefea42955007da08d5cce328f38a348acf0d89e7c472d8579
|
|
4
|
+
data.tar.gz: 7267a542c944f49c519328eedd69ecc2601c4057b1aeb3727622fcd790bfda41
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 83421fca3055783c4dd2fca2b7927c4874b94cfb668abefb7fa3f0ea130d5e4e7bcfe033bea6fe37453e6373ed484b066cb665805ecda6dc025a871b042c556a
|
|
7
|
+
data.tar.gz: f6ed83b4aa99350d9fce691dc332df6508708b6cc4bf37507690ec004d893b207217443050a6ac4fd3dad5b4abb9c0f8b48061209afbc4a0502154f8a8b341d8
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: process-pipeline
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-06-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: process-group
|
|
@@ -25,33 +25,47 @@ dependencies:
|
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: bundler
|
|
28
|
+
name: bake-bundler
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '0'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - "
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
40
|
+
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: bake-modernize
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - "
|
|
45
|
+
- - ">="
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
47
|
+
version: '0'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - "
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: covered
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
53
60
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
55
69
|
- !ruby/object:Gem::Dependency
|
|
56
70
|
name: rspec
|
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,29 +80,22 @@ dependencies:
|
|
|
66
80
|
- - "~>"
|
|
67
81
|
- !ruby/object:Gem::Version
|
|
68
82
|
version: '3.0'
|
|
69
|
-
description:
|
|
83
|
+
description:
|
|
70
84
|
email:
|
|
71
|
-
- samuel.williams@oriontransfer.co.nz
|
|
72
85
|
executables: []
|
|
73
86
|
extensions: []
|
|
74
87
|
extra_rdoc_files: []
|
|
75
88
|
files:
|
|
76
|
-
- ".gitignore"
|
|
77
|
-
- ".rspec"
|
|
78
|
-
- ".travis.yml"
|
|
79
|
-
- Gemfile
|
|
80
|
-
- README.md
|
|
81
|
-
- Rakefile
|
|
82
89
|
- lib/process/pipeline.rb
|
|
83
90
|
- lib/process/pipeline/command_error.rb
|
|
84
91
|
- lib/process/pipeline/step.rb
|
|
85
92
|
- lib/process/pipeline/version.rb
|
|
86
|
-
- process-pipeline.gemspec
|
|
87
93
|
homepage: https://github.com/ioquatix/process-pipeline
|
|
88
94
|
licenses:
|
|
89
95
|
- MIT
|
|
90
|
-
metadata:
|
|
91
|
-
|
|
96
|
+
metadata:
|
|
97
|
+
funding_uri: https://github.com/sponsors/ioquatix/
|
|
98
|
+
post_install_message:
|
|
92
99
|
rdoc_options: []
|
|
93
100
|
require_paths:
|
|
94
101
|
- lib
|
|
@@ -96,16 +103,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
96
103
|
requirements:
|
|
97
104
|
- - ">="
|
|
98
105
|
- !ruby/object:Gem::Version
|
|
99
|
-
version: '
|
|
106
|
+
version: '2.5'
|
|
100
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
108
|
requirements:
|
|
102
109
|
- - ">="
|
|
103
110
|
- !ruby/object:Gem::Version
|
|
104
111
|
version: '0'
|
|
105
112
|
requirements: []
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
signing_key:
|
|
113
|
+
rubygems_version: 3.1.2
|
|
114
|
+
signing_key:
|
|
109
115
|
specification_version: 4
|
|
110
116
|
summary: Execute composable shell-like pipelines.
|
|
111
117
|
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/README.md
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
# Process::Pipeline
|
|
2
|
-
|
|
3
|
-
Provides a simple API for making composable shell pipelines.
|
|
4
|
-
|
|
5
|
-
[](https://travis-ci.org/ioquatix/graphviz)
|
|
6
|
-
[](https://coveralls.io/r/ioquatix/graphviz)
|
|
7
|
-
|
|
8
|
-
## Installation
|
|
9
|
-
|
|
10
|
-
Add this line to your application's Gemfile:
|
|
11
|
-
|
|
12
|
-
gem 'process-pipeline'
|
|
13
|
-
|
|
14
|
-
And then execute:
|
|
15
|
-
|
|
16
|
-
$ bundle
|
|
17
|
-
|
|
18
|
-
Or install it yourself as:
|
|
19
|
-
|
|
20
|
-
$ gem install process-pipeline
|
|
21
|
-
|
|
22
|
-
## Usage
|
|
23
|
-
|
|
24
|
-
You can create a basic pipeline:
|
|
25
|
-
|
|
26
|
-
```ruby
|
|
27
|
-
pipeline = Process::Pipeline.("head /dev/random").("strings").("wc -c")
|
|
28
|
-
|
|
29
|
-
puts pipeline.read.to_i
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
You can do more complex tasks:
|
|
33
|
-
|
|
34
|
-
```ruby
|
|
35
|
-
Process::Pipeline.("curl http://www.google.com").each_line.to_a
|
|
36
|
-
=> ["<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n",
|
|
37
|
-
"<TITLE>302 Moved</TITLE></HEAD><BODY>\n",
|
|
38
|
-
"<H1>302 Moved</H1>\n",
|
|
39
|
-
"The document has moved\n",
|
|
40
|
-
"<A HREF=\"http://www.google.co.nz/?gfe_rd=cr&dcr=0&ei=vcLmWdihI6bu8we2qpD4Cg\">here</A>.\r\n",
|
|
41
|
-
"</BODY></HTML>\r\n"]
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Output
|
|
45
|
-
|
|
46
|
-
You can write output to either a file or a pipe.
|
|
47
|
-
|
|
48
|
-
```ruby
|
|
49
|
-
pipeline = Process::Pipeline.("head /dev/random")
|
|
50
|
-
|
|
51
|
-
# Read all data until pipe is closed:
|
|
52
|
-
buffer = pipeline.read
|
|
53
|
-
|
|
54
|
-
# Read directly from pipe:
|
|
55
|
-
pipeline.read do |output|
|
|
56
|
-
# Read 8 bytes:
|
|
57
|
-
buffer = output.read(8)
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
# Read all data into a file:
|
|
61
|
-
pipeline.write("entropy.dat")
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Input
|
|
65
|
-
|
|
66
|
-
Input can be either a file or a pipe.
|
|
67
|
-
|
|
68
|
-
```ruby
|
|
69
|
-
pipeline = Process::Pipeline.("head")
|
|
70
|
-
|
|
71
|
-
pipeline.read(input: "/usr/share/dict/words")
|
|
72
|
-
=> "A\na\naa\naal\naalii\naam\nAani\naardvark\naardwolf\nAaron\n"
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
Using a pipe can be a bit more tricky since you need to feed data into it incrementally.
|
|
76
|
-
|
|
77
|
-
```ruby
|
|
78
|
-
pipeline = Process::Pipeline.("sort")
|
|
79
|
-
|
|
80
|
-
output, input = IO.pipe
|
|
81
|
-
|
|
82
|
-
thread = Thread.new do
|
|
83
|
-
%w{The quick brown fox jumps over the lazy dog}.each do |word|
|
|
84
|
-
input.puts word
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
input.close
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
# The input to the command is the output of the pipe
|
|
91
|
-
buffer = pipeline.read(input: output)
|
|
92
|
-
|
|
93
|
-
expect(buffer).to be == "The\nbrown\ndog\nfox\njumps\nlazy\nover\nquick\nthe\n"
|
|
94
|
-
|
|
95
|
-
thread.join
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## Contributing
|
|
99
|
-
|
|
100
|
-
1. Fork it
|
|
101
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
102
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
103
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
|
104
|
-
5. Create new Pull Request
|
|
105
|
-
|
|
106
|
-
## License
|
|
107
|
-
|
|
108
|
-
Released under the MIT license.
|
|
109
|
-
|
|
110
|
-
Copyright, 2013, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
|
|
111
|
-
|
|
112
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
113
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
114
|
-
in the Software without restriction, including without limitation the rights
|
|
115
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
116
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
117
|
-
furnished to do so, subject to the following conditions:
|
|
118
|
-
|
|
119
|
-
The above copyright notice and this permission notice shall be included in
|
|
120
|
-
all copies or substantial portions of the Software.
|
|
121
|
-
|
|
122
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
123
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
124
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
125
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
126
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
127
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
128
|
-
THE SOFTWARE.
|
data/Rakefile
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
require "bundler/gem_tasks"
|
|
2
|
-
require "rspec/core/rake_task"
|
|
3
|
-
|
|
4
|
-
RSpec::Core::RakeTask.new(:spec)
|
|
5
|
-
|
|
6
|
-
task :default => :spec
|
|
7
|
-
|
|
8
|
-
task :console do
|
|
9
|
-
require "bundler/setup"
|
|
10
|
-
require_relative "lib/process/pipeline"
|
|
11
|
-
|
|
12
|
-
require "pry"
|
|
13
|
-
Pry.start
|
|
14
|
-
end
|
data/process-pipeline.gemspec
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
require_relative "lib/process/pipeline/version"
|
|
3
|
-
|
|
4
|
-
Gem::Specification.new do |spec|
|
|
5
|
-
spec.name = "process-pipeline"
|
|
6
|
-
spec.version = Process::Pipeline::VERSION
|
|
7
|
-
spec.authors = ["Samuel Williams"]
|
|
8
|
-
spec.email = ["samuel.williams@oriontransfer.co.nz"]
|
|
9
|
-
|
|
10
|
-
spec.summary = %q{Execute composable shell-like pipelines.}
|
|
11
|
-
spec.homepage = "https://github.com/ioquatix/process-pipeline"
|
|
12
|
-
spec.license = "MIT"
|
|
13
|
-
|
|
14
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
15
|
-
f.match(%r{^(test|spec|features)/})
|
|
16
|
-
end
|
|
17
|
-
spec.require_paths = ["lib"]
|
|
18
|
-
|
|
19
|
-
spec.add_dependency "process-group"
|
|
20
|
-
|
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.15"
|
|
22
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
|
23
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
|
24
|
-
end
|