foobara-sh-cli-connector 0.0.9 → 0.0.12

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: 13bd07277bf5717eac15f70769b2f369b60ad3416fb46548575421ee985d1a16
4
- data.tar.gz: 0206dd49d6d3da59200263ec6aa0732d7f886a1853e9950eb6b52d101bb67f84
3
+ metadata.gz: df5c4fd103cab9693642c588edfbabbb886b72415744891b49d527777191d502
4
+ data.tar.gz: 570b3e18e965e139ef7a490c82b45a84e31f59ec5090d8b2762b57e69c94ca5e
5
5
  SHA512:
6
- metadata.gz: 637e1537ba4d4e7e23d80bee694907ad2a3ba5e3683316d398f51d2dfe7113006d14ff816492f1b4894c3790cf1816569126c195997ed0c8356943c698bd09ee
7
- data.tar.gz: ca9045f6bc124affffc31bbf635f834161c2f0c92419364db6dbfcb018448fa586f944e8cd2768bc6049f8ce4826acdb17e995b88600a86da3e0aba26b4219a7
6
+ metadata.gz: b55e725797013e2f711776d0281724ff80fc0cb9d8aa33dfbafcf629e3541e8c9530f5ecf15a115a76aea01c67ed6b6b03157a34e7a15b9b98997c9043bccf40
7
+ data.tar.gz: 7f0ca76f1e4c4c5711aa0ee20352fd13fbbab793472444b4193df0fe3506a128f0283dc6985ce50e4276372cd82a9b6bdcee558c06b6a8521f1b4ef350eedfd9
data/CHANGELOG.md CHANGED
@@ -1,28 +1,40 @@
1
+ ## [0.0.12] - 2025-03-06
2
+
3
+ - Allow passing a command or connect args to single_command_mode:
4
+
5
+ ## [0.0.11] - 2025-01-07
6
+
7
+ - Bump Ruby to 3.4.1
8
+
9
+ ## [0.0.10] - 2024-12-09
10
+
11
+ - Do not explode when serializing an empty table
12
+
1
13
  ## [0.0.9] - 2024-11-30
2
14
 
3
- * Add descriptions to available commands
4
- * Add support for indent: option
15
+ - Add descriptions to available commands
16
+ - Add support for indent: option
5
17
 
6
18
  ## [0.0.6] - 2024-10-28
7
19
 
8
- * Handle CommandConnector namespace change
20
+ - Handle CommandConnector namespace change
9
21
 
10
22
  ## [0.0.4] - 2024-10-07
11
23
 
12
- * Introduce --no- options to negate boolean flags
24
+ - Introduce --no- options to negate boolean flags
13
25
 
14
26
  ## [0.0.3]
15
27
 
16
- * Make use of single-command mode in Help command
28
+ - Make use of single-command mode in Help command
17
29
 
18
30
  ## [0.0.2]
19
31
 
20
- * Add single-command mode
32
+ - Add single-command mode
21
33
 
22
34
  ## [0.0.1]
23
35
 
24
- * Add Apache-2.0 license, resulting in a dual-licensed project
36
+ - Add Apache-2.0 license, resulting in a dual-licensed project
25
37
 
26
38
  ## [0.0.0] - 2024-01-26
27
39
 
28
- * Project birth
40
+ - Project birth
@@ -144,9 +144,9 @@ module Foobara
144
144
  end
145
145
 
146
146
  def validate_parse_result!
147
- if action == "help" || action == "list"
147
+ if %w[help list].include?(action)
148
148
  # This gives some leniency around where the global options are when there's no command
149
- result = globalish_parser.parse(inputs_argv)
149
+ result = globalish_parser.parse(inputs_argv)
150
150
 
151
151
  if result.remainder.any?
152
152
  # :nocov:
@@ -9,6 +9,8 @@ module Foobara
9
9
  PAD_SIZE = 1
10
10
 
11
11
  def serialize(table)
12
+ return "" if table.empty?
13
+
12
14
  io = StringIO.new
13
15
 
14
16
  widths = column_widths(table)
@@ -7,10 +7,22 @@ module Foobara
7
7
 
8
8
  def initialize(*, program_name: File.basename($PROGRAM_NAME), single_command_mode: false, **, &)
9
9
  self.program_name = program_name
10
- self.single_command_mode = single_command_mode
10
+
11
+ connect_args = if single_command_mode
12
+ self.single_command_mode = true
13
+
14
+ if single_command_mode.is_a?(::Array)
15
+ single_command_mode
16
+ elsif single_command_mode.is_a?(::Class) && single_command_mode < Foobara::Command
17
+ [single_command_mode]
18
+ end
19
+ end
20
+
11
21
  super(*, **, &)
12
22
 
13
- # add_default_inputs_transformer ModelsToAttributesInputsTransformer
23
+ if connect_args
24
+ connect(*connect_args)
25
+ end
14
26
  end
15
27
 
16
28
  def connect(...)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-sh-cli-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-30 00:00:00.000000000 Z
10
+ date: 2025-03-06 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: foobara
@@ -24,7 +23,6 @@ dependencies:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0'
27
- description:
28
26
  email:
29
27
  - azimux@gmail.com
30
28
  executables: []
@@ -64,7 +62,6 @@ metadata:
64
62
  source_code_uri: https://github.com/foobara/sh-cli-connector
65
63
  changelog_uri: https://github.com/foobara/sh-cli-connector/blob/main/CHANGELOG.md
66
64
  rubygems_mfa_required: 'true'
67
- post_install_message:
68
65
  rdoc_options: []
69
66
  require_paths:
70
67
  - lib
@@ -72,15 +69,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
72
69
  requirements:
73
70
  - - ">="
74
71
  - !ruby/object:Gem::Version
75
- version: 3.2.2
72
+ version: 3.4.0
76
73
  required_rubygems_version: !ruby/object:Gem::Requirement
77
74
  requirements:
78
75
  - - ">="
79
76
  - !ruby/object:Gem::Version
80
77
  version: '0'
81
78
  requirements: []
82
- rubygems_version: 3.5.23
83
- signing_key:
79
+ rubygems_version: 3.6.5
84
80
  specification_version: 4
85
81
  summary: Command-line connector for Foobara
86
82
  test_files: []