choria-colt 0.8.0 → 0.8.1

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: 5791ce130daf3f0d0300f6ca56fa07f88c6a94e08ff4979d84282526220a3eb4
4
- data.tar.gz: d4ce31439d50ba72bff357e13901c4621a1a8f79ce0a8458ed1b0c948e22f7e0
3
+ metadata.gz: '09cf08b6443654efe090590c045225192ca703516fdea84794072e4b6a8e719c'
4
+ data.tar.gz: a163ba98c06e5ea4d49f6e89fd23d466984fa8bfe8a1e8e713c87710ae943b6d
5
5
  SHA512:
6
- metadata.gz: 427751ad2b8a07a0426c74aad97c2f67c2fa27b151f63db96e63d8116c15f39615ae40dd76d6aa3c1f6ad92c95c27219eb312bdb0f43f281b05ab8bd3cd07c12
7
- data.tar.gz: bd056cdb49de93481735ba4ece34ed40c48ac7d728c31ec8d0066aa300ecb7bed055f5d541c6973e3459b292475497ce4ef5357ae5cb8e3ec681a66e29b4684f
6
+ metadata.gz: 634b6d2839fe60f98e80180321cf5e6466485c4acee04438306c23c4619dd886a88217e4f4dddcd0fd4ccaa7cf0c883db10d88c8bf128f364409253e62f065c4
7
+ data.tar.gz: 8741a7293a4d5b80a74ac0a5900d9744d3a2b7f8fdd92978a70bed026d9b139607f3d9ed9f9f6a8229477b8e6fa83da6a60dc36d0786f627fba2ee5b5158fd56
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.8.1](https://github.com/opus-codium/choria-colt/tree/v0.8.1) (2024-10-29)
4
+
5
+ [Full Changelog](https://github.com/opus-codium/choria-colt/compare/v0.8.0...v0.8.1)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - CLI: Fix `colt tasks show` when using it with long task names [\#34](https://github.com/opus-codium/choria-colt/pull/34) ([neomilium](https://github.com/neomilium))
10
+
3
11
  ## [v0.8.0](https://github.com/opus-codium/choria-colt/tree/v0.8.0) (2022-11-25)
4
12
 
5
13
  [Full Changelog](https://github.com/opus-codium/choria-colt/compare/v0.7.0...v0.8.0)
@@ -92,8 +92,7 @@ module Choria
92
92
  default: 'summary'
93
93
  define_targets_and_filters_options
94
94
  def status(task_id)
95
- supported_styles = %i[summary continous]
96
- raise Thor::Error, "Invalid style: '#{options['style']}' (available: #{supported_styles})" unless supported_styles.include? options['style'].to_sym
95
+ validate_style_option
97
96
 
98
97
  targets, targets_with_classes = extract_targets_and_filters_from_options
99
98
 
@@ -131,6 +130,11 @@ module Choria
131
130
  @formatter ||= Formatter.new(colored: $stdout.tty?)
132
131
  end
133
132
 
133
+ def validate_style_option
134
+ supported_styles = %i[summary continous]
135
+ raise Thor::Error, "Invalid style: '#{options['style']}' (available: #{supported_styles.map(&:to_s)})" unless supported_styles.include? options['style'].to_sym
136
+ end
137
+
134
138
  def extract_task_parameters_from_args(args)
135
139
  parameters = args.grep(/^\w+=/)
136
140
  args.reject! { |arg| arg =~ /^\w+=/ }
@@ -170,9 +174,12 @@ module Choria
170
174
  def show_tasks_summary(tasks)
171
175
  tasks.reject! { |_task, metadata| metadata['metadata']['private'] }
172
176
 
177
+ task_name_max_size = 0
178
+ tasks.each { |task, _metadata| task_name_max_size = [task_name_max_size, task.size].max }
179
+
173
180
  puts <<~OUTPUT
174
181
  #{pastel.title 'Tasks'}
175
- #{tasks.map { |task, metadata| "#{task}#{' ' * (60 - task.size)}#{metadata['metadata']['description']}" }.join("\n").gsub(/^/, ' ')}
182
+ #{tasks.map { |task, metadata| "#{task}#{' ' * (task_name_max_size + 4 - task.size)}#{metadata['metadata']['description']}" }.join("\n").gsub(/^/, ' ')}
176
183
  OUTPUT
177
184
  end
178
185
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Choria
4
4
  class Colt
5
- VERSION = '0.8.0'
5
+ VERSION = '0.8.1'
6
6
  end
7
7
  end
@@ -42,13 +42,13 @@ module Choria
42
42
  def run(task, targets: nil, targets_with_classes: nil, verbose: false)
43
43
  rpc_client.progress = verbose
44
44
  discover(targets: targets, targets_with_classes: targets_with_classes)
45
- raise DiscoverError, 'No requests sent, no nodes discovered' if rpc_client.discover.size.zero?
45
+ raise DiscoverError, 'No requests sent, no nodes discovered' if rpc_client.discover.empty?
46
46
 
47
47
  task.run
48
48
  end
49
49
 
50
50
  def discover(targets: nil, targets_with_classes: nil)
51
- logger.debug "Targets: #{targets.nil? ? 'all' : targets})"
51
+ logger.debug "Targets: #{targets.nil? ? 'all' : targets}"
52
52
  targets&.each { |target| rpc_client.identity_filter target }
53
53
 
54
54
  unless targets_with_classes.nil?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: choria-colt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Romuald Conty
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-25 00:00:00.000000000 Z
11
+ date: 2024-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -241,7 +241,7 @@ metadata:
241
241
  source_code_uri: https://github.com/opus-codium/choria-colt
242
242
  changelog_uri: https://github.com/opus-codium/choria-colt/CHANGELOG.md
243
243
  rubygems_mfa_required: 'true'
244
- post_install_message:
244
+ post_install_message:
245
245
  rdoc_options: []
246
246
  require_paths:
247
247
  - lib
@@ -256,8 +256,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  requirements: []
259
- rubygems_version: 3.1.2
260
- signing_key:
259
+ rubygems_version: 3.3.15
260
+ signing_key:
261
261
  specification_version: 4
262
262
  summary: Bolt-like CLI to run Bolt tasks, through Choria
263
263
  test_files: []