eac_ruby_base0 0.4.0 → 0.5.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 884925b5545fdce598cc740b36d02803ec9d1caf08d9962be132d41ccf4c01ec
|
4
|
+
data.tar.gz: b8d0b62cce06851ed131f0c0d1f4c6a2cb37c21676d02c20fd9ff5ad408fefa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e75700fec5d167a0e89b186b79ea01440816ba498cdfa29aff6aa8e880586d3ad42ddef656062e1f09bac23d1fc377d8b571bdb6d754dbf985bb9e54e412a40d
|
7
|
+
data.tar.gz: cb6e05b4007d44e8489e9d9e0dbc473ac99a89cbb0becaa7981f3dc4e78a964d69526288bf83b1ce3497b28af27a930e59fe2bb774916cfd1b141cc6ca2f8cb1
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/runner'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
require 'eac_ruby_utils/fs/traversable'
|
6
|
+
|
7
|
+
module EacRubyBase0
|
8
|
+
module RunnerWith
|
9
|
+
module Confirmation
|
10
|
+
DEFAULT_CONFIRM_QUESTION_TEXT = 'Confirm?'
|
11
|
+
|
12
|
+
common_concern do
|
13
|
+
include ::EacCli::Runner
|
14
|
+
enable_settings_provider
|
15
|
+
runner_definition do
|
16
|
+
bool_opt '--no', 'Deny confirmation without question.'
|
17
|
+
bool_opt '--yes', 'Accept confirmation without question.'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def confirm?(message = nil)
|
22
|
+
return false if parsed.no?
|
23
|
+
return true if parsed.yes?
|
24
|
+
|
25
|
+
request_input(
|
26
|
+
message || setting_value(:confirm_question_text, default: DEFAULT_CONFIRM_QUESTION_TEXT),
|
27
|
+
bool: true
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
def run_confirm(message = nil)
|
32
|
+
yield if confirm?(message)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_ruby_base0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Put here the authors
|
@@ -86,6 +86,7 @@ extra_rdoc_files: []
|
|
86
86
|
files:
|
87
87
|
- lib/eac_ruby_base0.rb
|
88
88
|
- lib/eac_ruby_base0/application.rb
|
89
|
+
- lib/eac_ruby_base0/core_ext.rb
|
89
90
|
- lib/eac_ruby_base0/jobs_runner.rb
|
90
91
|
- lib/eac_ruby_base0/patches.rb
|
91
92
|
- lib/eac_ruby_base0/patches/class.rb
|
@@ -95,7 +96,7 @@ files:
|
|
95
96
|
- lib/eac_ruby_base0/runner.rb
|
96
97
|
- lib/eac_ruby_base0/runner/test_all.rb
|
97
98
|
- lib/eac_ruby_base0/runner_with.rb
|
98
|
-
- lib/eac_ruby_base0/runner_with/
|
99
|
+
- lib/eac_ruby_base0/runner_with/confirmation.rb
|
99
100
|
- lib/eac_ruby_base0/runner_with/filesystem_traverser.rb
|
100
101
|
- lib/eac_ruby_base0/version.rb
|
101
102
|
homepage:
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/runner'
|
4
|
-
require 'eac_ruby_utils/fs/traversable'
|
5
|
-
|
6
|
-
module EacRubyBase0
|
7
|
-
module RunnerWith
|
8
|
-
module Confirmable
|
9
|
-
extend ::ActiveSupport::Concern
|
10
|
-
|
11
|
-
included do
|
12
|
-
include ::EacCli::Runner
|
13
|
-
runner_definition do
|
14
|
-
bool_opt '-c', '--confirm', 'Confirm changes.'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
delegate :confirm?, to: :parsed
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|