foobara-sh-cli-connector 0.0.7 → 0.0.9

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: cb9d3953666b0625afed022b3d6b2af58ce99df8fea4b9338a11cb81666db14b
4
- data.tar.gz: c1b32114bcd3c4176b31bd527586c8d11b9afbc258653e079e6d52990b4f89cc
3
+ metadata.gz: 13bd07277bf5717eac15f70769b2f369b60ad3416fb46548575421ee985d1a16
4
+ data.tar.gz: 0206dd49d6d3da59200263ec6aa0732d7f886a1853e9950eb6b52d101bb67f84
5
5
  SHA512:
6
- metadata.gz: 8dd5a544763bfe3be4b66ce81e21df3ab870d117b1e2c5cd37320e393158bc6ca5931f8f627bd01c8739c8bfbbf792209299859f0e859f037b1533f811349e9d
7
- data.tar.gz: 03170c33e3742835c7564b7223fb3fe2ebbda9ef4759df07f2c611b7d9fbfa29c7902a668c2a08611aa0ffadaf103df13b6434330c172ec3d6fe51c18a07e2c5
6
+ metadata.gz: 637e1537ba4d4e7e23d80bee694907ad2a3ba5e3683316d398f51d2dfe7113006d14ff816492f1b4894c3790cf1816569126c195997ed0c8356943c698bd09ee
7
+ data.tar.gz: ca9045f6bc124affffc31bbf635f834161c2f0c92419364db6dbfcb018448fa586f944e8cd2768bc6049f8ce4826acdb17e995b88600a86da3e0aba26b4219a7
data/CHANGELOG.md CHANGED
@@ -1,6 +1,7 @@
1
- ## [0.0.7] - 2024-11-30
1
+ ## [0.0.9] - 2024-11-30
2
2
 
3
3
  * Add descriptions to available commands
4
+ * Add support for indent: option
4
5
 
5
6
  ## [0.0.6] - 2024-10-28
6
7
 
@@ -157,7 +157,7 @@ module Foobara
157
157
  [" #{command_class.full_command_name}", command_class.description]
158
158
  end
159
159
 
160
- serializer = Serializers::CliTabularSerializer.new
160
+ serializer = Serializers::CliTabularSerializer.new(indent: 2)
161
161
 
162
162
  output.puts serializer.serialize(table)
163
163
  end
@@ -40,6 +40,10 @@ module Foobara
40
40
  end
41
41
 
42
42
  lines.each do |line|
43
+ if indent > 0
44
+ line = (" " * indent) + line
45
+ end
46
+
43
47
  io.puts line.rstrip
44
48
  end
45
49
  end
@@ -104,10 +108,22 @@ module Foobara
104
108
  config.terminal_width
105
109
  # :nocov:
106
110
  end
107
- width || IO.console_size[1]
111
+
112
+ (width || IO.console_size[1]) - indent
108
113
  end
109
114
  end
110
115
 
116
+ def indent
117
+ @indent ||= if declaration_data.is_a?(::Hash)
118
+ declaration_data[:indent]
119
+ elsif declaration_data.respond_to?(:indent)
120
+ # TODO: test this
121
+ # :nocov:
122
+ declaration_data.indent
123
+ # :nocov:
124
+ end || 0
125
+ end
126
+
111
127
  def min_final_column_width
112
128
  @min_final_column_width ||= begin
113
129
  config = declaration_data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-sh-cli-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi