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: 5ad8bc5524c7a5a892a367e2fe2a0173688afa05799590aa3c9364ddf8c87034
4
- data.tar.gz: 04a2b83c83718d7de6f7a23e885778acc2dcf93778eaf03b79e0d9855a54df24
3
+ metadata.gz: 884925b5545fdce598cc740b36d02803ec9d1caf08d9962be132d41ccf4c01ec
4
+ data.tar.gz: b8d0b62cce06851ed131f0c0d1f4c6a2cb37c21676d02c20fd9ff5ad408fefa8
5
5
  SHA512:
6
- metadata.gz: 2c77a3d7f5adba2effcd1bd023f0458feb9077d73e8c87f31e7e36079d72f660f51dc89007e7cc84a0463f0e7df3f617d2c63a275df5ebccbcc87c8f0a6533de
7
- data.tar.gz: b7f7c86079c6ecbaae2862330759d0a96f942025febcae14e73989196570c301f71f84117b3e784b078b82454706d6cb56a60a1cad3a95cc2f023717f2192316
6
+ metadata.gz: e75700fec5d167a0e89b186b79ea01440816ba498cdfa29aff6aa8e880586d3ad42ddef656062e1f09bac23d1fc377d8b571bdb6d754dbf985bb9e54e412a40d
7
+ data.tar.gz: cb6e05b4007d44e8489e9d9e0dbc473ac99a89cbb0becaa7981f3dc4e78a964d69526288bf83b1ce3497b28af27a930e59fe2bb774916cfd1b141cc6ca2f8cb1
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+ require 'eac_ruby_base0/patches'
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyBase0
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  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.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/confirmable.rb
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