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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07575a25bfbcf73e66b5bb2831d025836cf83038
4
- data.tar.gz: 1184dfc87682289495a31e89201dd8304a7b52a8
3
+ metadata.gz: a8f7fdd233900ac935e1492c5ef16ef340d756fe
4
+ data.tar.gz: 756bd8a5e381d1f900a84fd55d73938dfe3af8d8
5
5
  SHA512:
6
- metadata.gz: 0c767c4bb1f728a740a2f22714d118c471981208173fcee97b48fdda609188a364420026cc21138749dbac46e7db85d98f8896569599814d35cf6d5f185b8312
7
- data.tar.gz: 9f4139d5c4c9aa80053c808506e65c3ee61a6ceb3c64c72fdca9a6dd2baaa4c88f147d12c5a2c37781fe00bc76596eabd1e3bf80b3706d07e0aff941bf9d8b04
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] # Prompt.new(...)
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|
@@ -1,5 +1,5 @@
1
1
  module WIP
2
2
  module Runner
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
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.0
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-02 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline