Skip to content

Commit

Permalink
Improve the code documentation with indentation (#863)
Browse files Browse the repository at this point in the history
that make the balise <code> inside the generated documentation

Co-authored-by: Rafael Mendonça França <[email protected]>
  • Loading branch information
cprodhomme and rafaelfranca authored Feb 26, 2024
1 parent f9320f3 commit d264bc0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions lib/thor/shell/basic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ def indent(count = 1)
# Readline.
#
# ==== Example
# ask("What is your name?")
# ask("What is your name?")
#
# ask("What is the planet furthest from the sun?", :default => "Pluto")
# ask("What is the planet furthest from the sun?", :default => "Neptune")
#
# ask("What is your favorite Neopolitan flavor?", :limited_to => ["strawberry", "chocolate", "vanilla"])
# ask("What is your favorite Neopolitan flavor?", :limited_to => ["strawberry", "chocolate", "vanilla"])
#
# ask("What is your password?", :echo => false)
# ask("What is your password?", :echo => false)
#
# ask("Where should the file be saved?", :path => true)
# ask("Where should the file be saved?", :path => true)
#
def ask(statement, *args)
options = args.last.is_a?(Hash) ? args.pop : {}
Expand All @@ -93,7 +93,7 @@ def ask(statement, *args)
# are passed straight to puts (behavior got from Highline).
#
# ==== Example
# say("I know you knew that.")
# say("I know you knew that.")
#
def say(message = "", color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
return if quiet?
Expand All @@ -110,7 +110,7 @@ def say(message = "", color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/)
# are passed straight to puts (behavior got from Highline).
#
# ==== Example
# say_error("error: something went wrong")
# say_error("error: something went wrong")
#
def say_error(message = "", color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
return if quiet?
Expand Down
2 changes: 1 addition & 1 deletion lib/thor/shell/html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def set_color(string, *colors)
# Ask something to the user and receives a response.
#
# ==== Example
# ask("What is your name?")
# ask("What is your name?")
#
# TODO: Implement #ask for Thor::Shell::HTML
def ask(statement, color = nil)
Expand Down

0 comments on commit d264bc0

Please sign in to comment.