eac_ruby_base0 0.1.1 → 0.2.0

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
  SHA256:
3
- metadata.gz: 6c9f81afd0cc7948b8795dae7843b6fd74661fe81ea00c1f264c80f16ebd5675
4
- data.tar.gz: 15d135f5f478cc4c383af29cc73422a6c8d8b06b0ea69adfb672c4490f852300
3
+ metadata.gz: 48a0ec7cf52eb8b2aa5dcd93804be7bc14f03a938f74bd0b6517b4431402c459
4
+ data.tar.gz: 2d0cd06e4be834238ddc3f87bf6c39af5beaf22628fa7ca3e4014a0ceb2e5cde
5
5
  SHA512:
6
- metadata.gz: '09a8e255ab1a170f78afbf2e40b0230ec67a0b7c17b6b72fab78e3873d67ff3769f3b042be7dfc01d400a3f22bd5754cc04e7c19d2f4c48c194c8fb41cd171d4'
7
- data.tar.gz: 84c0577f7f0aad8ebbf9a17a53def8b754c80cbe2e9d5fd5b9157bba2c9b46c4ca0d7ae98df6a540c6a711d4c80488447c3f99cf24fd540111cb755aff2dc459
6
+ metadata.gz: 3d752e1245019c88e97f6845e521c750d7f17b4a30e369de49708ae9eb41434a437cd522fe69141ed69e517ee18f5cac97712bead85045a5958e59b2eec09a3d
7
+ data.tar.gz: 2acb4ffc475b300814ae09a9a44acc8aae6b82bf9034f1810db9edd6a0ca2f72f29f6387d7cc2faa2234b89644653c04dd2d71eeb770c335fbf0846ed0fa4fbb
@@ -10,6 +10,7 @@ module EacRubyBase0
10
10
  include ::EacCli::DefaultRunner
11
11
  runner_definition do
12
12
  bool_opt '-q', '--quiet', 'Quiet mode.'
13
+ bool_opt '-I', '--no-input', 'Fail if a input is requested.'
13
14
  subcommands
14
15
  alt do
15
16
  bool_opt '-V', '--version', 'Show version.'
@@ -20,6 +21,7 @@ module EacRubyBase0
20
21
  def run
21
22
  on_speaker_node do |node|
22
23
  node.stderr = ::StringIO.new if options.fetch('--quiet')
24
+ node.stdin = FailIfRequestInput.new if options.fetch('--no-input')
23
25
  if options.fetch('--version')
24
26
  show_version
25
27
  else
@@ -35,5 +37,15 @@ module EacRubyBase0
35
37
  def show_version
36
38
  out("#{application_version}\n")
37
39
  end
40
+
41
+ class FailIfRequestInput
42
+ enable_console_speaker
43
+
44
+ %w[gets noecho].each do |method|
45
+ define_method(method) do
46
+ raise "Input method requested (\"#{method}\") and option --no-input is set"
47
+ end
48
+ end
49
+ end
38
50
  end
39
51
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyBase0
4
- VERSION = '0.1.1'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_ruby_base0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-27 00:00:00.000000000 Z
11
+ date: 2020-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_cli