foobara-sh-cli-connector 0.0.17 → 1.0.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: 59a7b3a60573d7c637f5526e2a6d028c48906c7b5a865f2d204d64a48a25cf1f
4
- data.tar.gz: dfc47f6db70767c09e9cab51c0c569d0ddc291f2d1abe3e29e5c7a4ecb7c9e11
3
+ metadata.gz: 7bc1365a85e052ca92e274b311de4869c81f1b8a6de2c6576a5b1c17d61045aa
4
+ data.tar.gz: 4da7ba126591ea5b5d82f57c80d22bfc60a6bee3ba3abc835fb670cb4899b45c
5
5
  SHA512:
6
- metadata.gz: 6846e7d9362da9319f52d7c281feb802511199cdd0000aa6e7f40a161dc44fabc3a7676f66aee4e7795cccd6b29795efffaa2685db4e731d3f49777a9b1b91e6
7
- data.tar.gz: 43c0b652981b6b113f92ebaaaa5f639e2915e02cb78a6e930e3e499b5524c1aa674eae9a5d7e99a603af08fff9e70c4cae1fe7c390d22db33f643acdee7cf412
6
+ metadata.gz: 23d25d6b4ea75e70dc71825ebcdc4bb106260761947d4c1cc591363874c58637558d6fc4fa11a39732e53593058df110efa993edd5f163e946160c7e068aab6c
7
+ data.tar.gz: 6e56d3c1b53ec4892e28e04846bd24ea4cee8e283350d3676c00da40d51cbe90901bb3b7c86352a2dd7315795272e582c317250023b0eaca20f4c4432c689af1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [1.0.0] - 2025-06-17
2
+
3
+ - Do not print out "nil" if the result is nil
4
+
5
+ ## [0.0.18] - 2025-06-16
6
+
7
+ - Support Time/Date/DateTime in CliResultSerializer
8
+
1
9
  ## [0.0.17] - 2025-05-03
2
10
 
3
11
  - Deal with recent CommandConnector interface changes
@@ -93,7 +93,7 @@ module Foobara
93
93
  end
94
94
 
95
95
  def supported_actions
96
- %w[run describe manifest help list]
96
+ ["run", "describe", "manifest", "help", "list"]
97
97
  end
98
98
 
99
99
  private
@@ -129,13 +129,13 @@ module Foobara
129
129
 
130
130
  # TODO: maybe move this up the hierarchy?
131
131
  def known_actions
132
- %w[
133
- run
134
- describe
135
- manifest
136
- ping
137
- query_git_commit_info
138
- help
132
+ [
133
+ "run",
134
+ "describe",
135
+ "manifest",
136
+ "ping",
137
+ "query_git_commit_info",
138
+ "help"
139
139
  ]
140
140
  end
141
141
 
@@ -70,7 +70,7 @@ module Foobara
70
70
  result.parsed[:verbose] = true
71
71
  end
72
72
 
73
- allowed_entity_depths = %w[aggregate atomic record-store]
73
+ allowed_entity_depths = ["aggregate", "atomic", "record-store"]
74
74
  parser.on("--entity-depth DEPTH", allowed_entity_depths, "Set the entity depth") do |depth|
75
75
  depth = "record_store" if depth == "record-store"
76
76
  result.parsed[:entity_depth] = depth
@@ -147,7 +147,7 @@ module Foobara
147
147
  end
148
148
 
149
149
  def validate_parse_result!
150
- if %w[help list].include?(action)
150
+ if ["help", "list"].include?(action)
151
151
  # This gives some leniency around where the global options are when there's no command
152
152
  result = globalish_parser.parse(inputs_argv)
153
153
 
@@ -5,6 +5,8 @@ module Foobara
5
5
  # Should allow either atomic or aggregate
6
6
  class CliResultSerializer < CommandConnectors::Serializers::SuccessSerializer
7
7
  def serialize(object)
8
+ return "" if object.nil?
9
+
8
10
  serializable = atomic_serializer.serialize(object)
9
11
 
10
12
  if serializable.is_a?(::String)
@@ -77,7 +79,7 @@ module Foobara
77
79
  if padding
78
80
  io.write "#{padding}}"
79
81
  end
80
- when ::String, ::Symbol, ::Numeric, ::TrueClass, ::FalseClass, ::NilClass
82
+ when ::String, ::Symbol, ::Numeric, ::TrueClass, ::FalseClass, ::NilClass, ::Time
81
83
  if after_colon
82
84
  io.write " "
83
85
  else
@@ -86,9 +88,14 @@ module Foobara
86
88
 
87
89
  io.write object.inspect
88
90
  else
89
- # :nocov:
90
- raise "Unsupported type: #{object.class}"
91
- # :nocov:
91
+ if (defined?(::Date) && object.is_a?(::Date)) || (defined?(::DateTime) && object.is_a?(::DateTime))
92
+ io.write after_colon ? " " : padding
93
+ io.write object.to_s
94
+ else
95
+ # :nocov:
96
+ raise "Unsupported type: #{object.class}"
97
+ # :nocov:
98
+ end
92
99
  end
93
100
  end
94
101
  end
metadata CHANGED
@@ -1,28 +1,34 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-sh-cli-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-03 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.0.88
18
+ version: 0.0.136
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.0
19
22
  type: :runtime
20
23
  prerelease: false
21
24
  version_requirements: !ruby/object:Gem::Requirement
22
25
  requirements:
23
- - - "~>"
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 0.0.136
29
+ - - "<"
24
30
  - !ruby/object:Gem::Version
25
- version: 0.0.88
31
+ version: 2.0.0
26
32
  email:
27
33
  - azimux@gmail.com
28
34
  executables: []
@@ -76,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
82
  - !ruby/object:Gem::Version
77
83
  version: '0'
78
84
  requirements: []
79
- rubygems_version: 3.6.2
85
+ rubygems_version: 3.6.9
80
86
  specification_version: 4
81
87
  summary: Command-line connector for Foobara
82
88
  test_files: []