Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/bolt/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,8 @@ def list_groups

# Show available guides.
#
# @param guides [Hash] A map of topics to paths to guides.
# @param outputter [Bolt::Outputter] An outputter instance.
# @return [Boolean]
#
# @return [Hash] A map of topics of guides
# Currently, the map is structured as `:topics => [Array] of guide names`
def list_guides
{ topics: load_guides.keys }
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bolt/outputter/human.rb
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def print_plans(plans:, modulepath:)
#
# @param topics [Array] The available topics.
#
def print_topics(topics:, **_kwargs)
def print_topics(topics:)
info = +"#{colorize(:cyan, 'Topics')}\n"
info << indent(2, topics.join("\n"))
info << "\n\n#{colorize(:cyan, 'Additional information')}\n"
Expand Down
4 changes: 2 additions & 2 deletions lib/bolt/outputter/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def print_result_set(result_set)
#
# @param topics [Array] The available topics.
#
def print_topics(**kwargs)
print_table(kwargs)
def print_topics(topics:)
print_table({ topics: topics })
end

# Print the guide for the specified topic.
Expand Down
6 changes: 5 additions & 1 deletion lib/bolt/outputter/rainbow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ def print_guide(guide, _topic)
@stream.puts colorize(:rainbow, guide)
end

def print_topics(topics)
# Print available guide topics.
#
# @param topics [Array] The available topics.
#
def print_topics(topics:)
content = String.new("Available topics are:\n")
content += topics.join("\n")
content += "\n\nUse `bolt guide <topic>` to view a specific guide."
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/outputter/rainbow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
CONTENT

expect(outputter).to receive(:colorize).with(:rainbow, content)
outputter.print_topics(%w[foo bar])
outputter.print_topics(topics: %w[foo bar])
end

it "colorizes a message" do
Expand Down
Loading