wip-runner 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wip/runner/shell/handlers/script.rb +17 -3
- data/lib/wip/runner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8f7fdd233900ac935e1492c5ef16ef340d756fe
|
4
|
+
data.tar.gz: 756bd8a5e381d1f900a84fd55d73938dfe3af8d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37196795a5842d7ce08156966f06ec70a7bc1ce58f24ea63fc0a71c395d6785f28b1c793f255bae6710c22712c6b7951242bb10619b347d9dedd39fb5a037079
|
7
|
+
data.tar.gz: 68888b0d5f1219e261b5f7665a9f77d4af3f0796ac3b74f4695f5598678be3ca6c3a1da0626e2e9f40b999f76457b2ab97deb8e92eb9ed360d9b5d3429887593
|
@@ -9,6 +9,8 @@ module WIP
|
|
9
9
|
attr_reader :prompts
|
10
10
|
|
11
11
|
def initialize(*)
|
12
|
+
@name = 'script'
|
13
|
+
@args = []
|
12
14
|
@prompts = []
|
13
15
|
super
|
14
16
|
end
|
@@ -22,14 +24,26 @@ module WIP
|
|
22
24
|
prompts.empty? ? simplex!(io, env, &block) : complex!(io, env, &block)
|
23
25
|
end
|
24
26
|
|
27
|
+
def name(value)
|
28
|
+
@name = value
|
29
|
+
end
|
30
|
+
|
31
|
+
def args(array)
|
32
|
+
@args = array
|
33
|
+
end
|
34
|
+
|
25
35
|
def prompt(term, options = {})
|
26
|
-
@prompts << [term, options]
|
36
|
+
@prompts << [term, options] # Prompt.new(...)
|
27
37
|
end
|
28
38
|
|
29
39
|
private
|
30
40
|
|
41
|
+
def arguments
|
42
|
+
([@name] + @args).join(' ')
|
43
|
+
end
|
44
|
+
|
31
45
|
def simplex!(io, env, &block)
|
32
|
-
Open3.popen2e(env, executable) do |stdin, stdoe, thread|
|
46
|
+
Open3.popen2e(env, "#{executable} #{arguments}") do |stdin, stdoe, thread|
|
33
47
|
while line = stdoe.gets
|
34
48
|
block.call(line)
|
35
49
|
end
|
@@ -39,7 +53,7 @@ module WIP
|
|
39
53
|
end
|
40
54
|
|
41
55
|
def complex!(io, env, &block)
|
42
|
-
Open3.popen2e(env, executable) do |stdin, stdoe, thread|
|
56
|
+
Open3.popen2e(env, "#{executable} #{arguments}") do |stdin, stdoe, thread|
|
43
57
|
prompts.each do |term, options|
|
44
58
|
stdoe.expect(term) do |result|
|
45
59
|
stdin.puts io.ask(term) do |q|
|
data/lib/wip/runner/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wip-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Innis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|