eac_cli 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be9a0ff56cf7295f999d8fa365e9eb8b153c9f95c63f645ac0b3bb88e063912a
4
- data.tar.gz: '09e64e9fd8dc0efe62b7c237ee0bb9e960ff21b148da33afa41599e8919f16da'
3
+ metadata.gz: 2394340a91e194094ac27e21e6db64b5b6492b007ab6404843986e56f0807391
4
+ data.tar.gz: f5fc6d5e1bee5b9823de665dea129692c033b456835d6e622aa1911ee88663f8
5
5
  SHA512:
6
- metadata.gz: d35cf09f5d89dbd5243f827f3b75c95c3f26051be6b248e322f532823ff969296a3094571c8c9d91e275f6cf872ab9116fa8d27294009722df916f12508f7649
7
- data.tar.gz: 1dbb6ef81c81fcaea236339cb530cb0ed7700675c1442e040cdea3b5779ea2a33ef9472db39d7f9a43a101d204bb2b080016b5d6487a3d25ea27495a14dc6138
6
+ metadata.gz: 481e7358a387eb583e4c52543800bd00f83ebb678d56a8c9998fef2559da41dcea911c79b0fc0802b4453f56d3ca70fb11a6643da6dc2f9783207c6a465e4bb7
7
+ data.tar.gz: 6d96d7e85ab52bb5be2ac121faac418780147c5491b978a170791d087ed7a9be3dcba6bc4f1f5812d0dc45ec482ea25459c63f49ce95db1df65aff196d4e8725
@@ -1,22 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/concern'
4
- require 'eac_cli/runner'
5
- require 'eac_ruby_utils/console/speaker'
6
- require 'eac_ruby_utils/simple_cache'
3
+ require 'eac_cli/runner_with/help'
4
+ require 'eac_ruby_utils/core_ext'
7
5
 
8
6
  module EacCli
9
7
  module DefaultRunner
10
- extend ::ActiveSupport::Concern
11
-
12
- included do
13
- include ::EacCli::Runner
14
- include ::EacRubyUtils::Console::Speaker
15
- include ::EacRubyUtils::SimpleCache
16
- runner_definition.alt do
17
- options_arg false
18
- bool_opt '-h', '--help', 'Show help.', usage: true
19
- end
8
+ common_concern do
9
+ include ::EacCli::RunnerWith::Help
10
+ enable_console_speaker
11
+ enable_simple_cache
20
12
  end
21
13
  end
22
14
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacCli
6
+ module RunnerWith
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module EacCli
7
+ module RunnerWith
8
+ module Help
9
+ common_concern do
10
+ include ::EacCli::Runner
11
+
12
+ runner_definition.alt do
13
+ options_arg false
14
+ bool_opt '-h', '--help', 'Show help.', usage: true
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module EacCli
7
+ module RunnerWith
8
+ module OutputFile
9
+ common_concern do
10
+ include ::EacCli::Runner
11
+
12
+ runner_definition do
13
+ arg_opt '-o', '--output-file', 'Output to file.'
14
+ end
15
+ end
16
+
17
+ def run_output
18
+ if parsed.output_file.present?
19
+ ::File.write(parsed.output_file, output_content)
20
+ else
21
+ out output_content
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.6.1'
4
+ VERSION = '0.7.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-23 00:00:00.000000000 Z
11
+ date: 2020-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_ruby_utils
@@ -68,6 +68,9 @@ files:
68
68
  - lib/eac_cli/parser/positional_collection.rb
69
69
  - lib/eac_cli/runner.rb
70
70
  - lib/eac_cli/runner/context.rb
71
+ - lib/eac_cli/runner_with.rb
72
+ - lib/eac_cli/runner_with/help.rb
73
+ - lib/eac_cli/runner_with/output_file.rb
71
74
  - lib/eac_cli/version.rb
72
75
  homepage:
73
76
  licenses: []