eac_cli 0.44.4 → 0.46.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: 5aae127a0ef22cbef93fd8299b0d691e9506fd02d3d0c2ee634f003e625ec20d
4
- data.tar.gz: a231aa71a08ef0ea12614059931cf624140062a27488a393af1d346ec0df5133
3
+ metadata.gz: 6dd5466a1f7cc65d4299531cf8a513e3b26a57180dc110f17c20688f7a06f95e
4
+ data.tar.gz: 7d877160d393954a01bd957e4b203017d07c68c4f74d1263f3c76224631da63c
5
5
  SHA512:
6
- metadata.gz: c1a82720ef8af56dc99516758bd1430ba2abf7bd37d9260d73f8e5f4b821e3e900659558cb2b544d6993982e648da7bfad9edb7fc576e6222206d32fc4faf011
7
- data.tar.gz: 53695c7a16941a0ba7de2171de89cba08977716dd60fe22d5428c8a6a576429a3878c757dbd2a10010ec0281eb5f97cc2b99a190dbb3f349ce2daf8896bbb331
6
+ metadata.gz: 9b24f3028baade9f0d8c46f7f82286daebb93ce0e8a52ef2b1ebb3a0560f6a4125a8f8da569bef7f44a092096c4d75624a36f9435d706864099fc041a9b232a9
7
+ data.tar.gz: 346e5793dfd919b3a0ec09b6083b1db66e8e64dd41b279aa82ff8d290a6d60673a4a14657eee5469222c78ab69ff1a24dd53212d173e7d023602bc1944323f9a
@@ -1,8 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'clipboard'
4
+
3
5
  module EacCli
4
6
  module RunnerWith
5
7
  module Input
8
+ CLIPBOARD_OPTION = '!'
6
9
  STDIN_OPTION = '-'
7
10
  BLANK_OPTION = '+'
8
11
  DEFAULT_DEFAULT_INPUT_OPTION = BLANK_OPTION
@@ -18,6 +21,7 @@ module EacCli
18
21
 
19
22
  def input_content
20
23
  case input_option
24
+ when CLIPBOARD_OPTION then ::Clipboard.paste
21
25
  when STDIN_OPTION then $stdin.read
22
26
  when BLANK_OPTION then ''
23
27
  else input_option.to_pathname.read
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'clipboard'
4
+
5
+ module EacCli
6
+ module RunnerWith
7
+ module Output
8
+ class ClipboardWriter
9
+ def write(content)
10
+ ::Clipboard.copy(content)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -3,6 +3,7 @@
3
3
  module EacCli
4
4
  module RunnerWith
5
5
  module Output
6
+ CLIPBOARD_OPTION = '!'
6
7
  STDOUT_OPTION = '-'
7
8
  DEFAULT_FILE_OPTION = '+'
8
9
  DEFAULT_DEFAULT_OUTPUT_OPTION = STDOUT_OPTION
@@ -21,23 +22,19 @@ module EacCli
21
22
  end
22
23
 
23
24
  def run_output
24
- file = file_to_output
25
- if file
26
- file.to_pathname.write(output_content)
27
- else
28
- $stdout.write(output_content)
29
- end
25
+ object_to_write.write(output_content)
30
26
  end
31
27
 
32
28
  def output_option
33
29
  parsed.output || default_output_option_value
34
30
  end
35
31
 
36
- def file_to_output
32
+ def object_to_write
37
33
  case output_option
38
- when STDOUT_OPTION then nil
34
+ when CLIPBOARD_OPTION then ::EacCli::RunnerWith::Output::ClipboardWriter.new
35
+ when STDOUT_OPTION then $stdout
39
36
  when DEFAULT_FILE_OPTION then default_file_to_output_value
40
- else output_option
37
+ else output_option.to_pathname
41
38
  end
42
39
  end
43
40
 
@@ -46,8 +43,9 @@ module EacCli
46
43
  default: DEFAULT_DEFAULT_OUTPUT_OPTION)
47
44
  end
48
45
 
46
+ # @return [Pathname]
49
47
  def default_file_to_output_value
50
- setting_value(:default_file_to_output, default: DEFAULT_DEFAULT_FILE_TO_OUTPUT)
48
+ setting_value(:default_file_to_output, default: DEFAULT_DEFAULT_FILE_TO_OUTPUT).to_pathname
51
49
  end
52
50
  end
53
51
  end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacCli
4
+ module RunnerWith
5
+ module OutputItem
6
+ class AsciidocFormatter < ::EacCli::RunnerWith::OutputItem::BaseFormatter
7
+ class Section
8
+ acts_as_instance_method
9
+ common_constructor :caller, :title, :content, :level
10
+
11
+ # @return [String]
12
+ def result
13
+ "#{formatted_title}#{formatted_content}"
14
+ end
15
+
16
+ protected
17
+
18
+ # @return [String]
19
+ def formatted_title
20
+ title.if_present('') { |_e| "#{'=' * level} #{title}\n\n" }
21
+ end
22
+
23
+ # @return [String]
24
+ def formatted_content
25
+ caller.send(:output_object, content, level + 1)
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -43,27 +43,7 @@ module EacCli
43
43
  "* #{string.to_s.strip}\n"
44
44
  end
45
45
 
46
- # @param title [String]
47
- # @param content [String]
48
- # @param level [Integer]
49
- # @return [String]
50
- def section(title, content, level)
51
- "#{section_title(title, level)}\n\n#{section_content(content, level)}"
52
- end
53
-
54
- # @param title [String]
55
- # @param level [Integer]
56
- # @return [String]
57
- def section_title(title, level)
58
- "#{'=' * level} #{title}"
59
- end
60
-
61
- # @param content [String]
62
- # @param level [Integer]
63
- # @return [String]
64
- def section_content(content, level)
65
- output_object(content, level)
66
- end
46
+ require_sub __FILE__, require_mode: :kernel
67
47
  end
68
48
  end
69
49
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.44.4'
4
+ VERSION = '0.46.0'
5
5
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.44.4
4
+ version: 0.46.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: 2026-01-25 00:00:00.000000000 Z
11
+ date: 2026-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: clipboard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: colorize
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -50,20 +64,14 @@ dependencies:
50
64
  requirements:
51
65
  - - "~>"
52
66
  - !ruby/object:Gem::Version
53
- version: '0.128'
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: 0.128.6
67
+ version: '0.130'
57
68
  type: :runtime
58
69
  prerelease: false
59
70
  version_requirements: !ruby/object:Gem::Requirement
60
71
  requirements:
61
72
  - - "~>"
62
73
  - !ruby/object:Gem::Version
63
- version: '0.128'
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: 0.128.6
74
+ version: '0.130'
67
75
  - !ruby/object:Gem::Dependency
68
76
  name: tty-table
69
77
  requirement: !ruby/object:Gem::Requirement
@@ -85,6 +93,9 @@ dependencies:
85
93
  - - "~>"
86
94
  - !ruby/object:Gem::Version
87
95
  version: '0.12'
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: 0.12.2
88
99
  type: :development
89
100
  prerelease: false
90
101
  version_requirements: !ruby/object:Gem::Requirement
@@ -92,6 +103,9 @@ dependencies:
92
103
  - - "~>"
93
104
  - !ruby/object:Gem::Version
94
105
  version: '0.12'
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: 0.12.2
95
109
  description:
96
110
  email:
97
111
  executables: []
@@ -157,8 +171,10 @@ files:
157
171
  - lib/eac_cli/runner_with/help/layout.rb
158
172
  - lib/eac_cli/runner_with/input.rb
159
173
  - lib/eac_cli/runner_with/output.rb
174
+ - lib/eac_cli/runner_with/output/clipboard_writer.rb
160
175
  - lib/eac_cli/runner_with/output_item.rb
161
176
  - lib/eac_cli/runner_with/output_item/asciidoc_formatter.rb
177
+ - lib/eac_cli/runner_with/output_item/asciidoc_formatter/section.rb
162
178
  - lib/eac_cli/runner_with/output_item/base_formatter.rb
163
179
  - lib/eac_cli/runner_with/output_item/csv_formatter.rb
164
180
  - lib/eac_cli/runner_with/output_item/yaml_formatter.rb