Module: Tapioca::CliHelper
- Extended by:
- T::Sig
- Included in:
- Cli, Tapioca::Commands::Command, Loaders::Loader
- Defined in:
- lib/tapioca/helpers/cli_helper.rb
Overview
@requires_ancestor: Thor::Shell
Instance Method Summary collapse
-
#netrc_file(options) ⇒ Object
: (Hash[Symbol, untyped] options) -> String?.
-
#rbi_formatter(options) ⇒ Object
: (Hash[Symbol, untyped] options) -> RBIFormatter.
-
#say_error(message = "", *color) ⇒ Object
: (?String message, *(Symbol | Array) color) -> void.
Instance Method Details
#netrc_file(options) ⇒ Object
: (Hash[Symbol, untyped] options) -> String?
30 31 32 33 34 35 |
# File 'lib/tapioca/helpers/cli_helper.rb', line 30 def netrc_file() return if [:auth] return unless [:netrc] [:netrc_file] || ENV["TAPIOCA_NETRC_FILE"] || File.join(ENV["HOME"].to_s, ".netrc") end |
#rbi_formatter(options) ⇒ Object
: (Hash[Symbol, untyped] options) -> RBIFormatter
23 24 25 26 27 |
# File 'lib/tapioca/helpers/cli_helper.rb', line 23 def rbi_formatter() rbi_formatter = DEFAULT_RBI_FORMATTER rbi_formatter.max_line_length = [:rbi_max_line_length] rbi_formatter end |
#say_error(message = "", *color) ⇒ Object
: (?String message, *(Symbol | Array) color) -> void
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/tapioca/helpers/cli_helper.rb', line 9 def say_error( = "", *color) # Thor has its own `say_error` now, but it has two problems: # 1. it adds the padding around all the messages, even if they continue on # the same line, and # 2. it accepts a last parameter which breaks the ability to pass color values # as splats. # # So we implement our own version here to work around those problems. shell.indent(-shell.padding) do super(, color) end end |