jaspermayone / greenhouse

0 stars 0 forks source link

Refactor to title (for always visible titles like search) #179

Closed github-actions[bot] closed 2 months ago

github-actions[bot] commented 2 months ago

and sections (titles that represent collapsible sections).

source://cork//lib/cork/board.rb#328

source://cork//lib/cork/text_wrapper.rb#66

source://cork//lib/cork/text_wrapper.rb#58

@param indent [Fixnum] The number of spaces to insert before the string.

@param width [Fixnum] The width to use to format the string if the terminal

is too wide.

@return [String] Wraps a formatted string (e.g. markdown) by stripping

heredoc indentation and wrapping by word to the terminal width

taking into account a maximum one, and indenting the string.

Code lines (i.e. indented by four spaces) are not wrapped.

source://cork//lib/cork/text_wrapper.rb#20

@param indent [Fixnum] The number of spaces to insert before the string.

@param width [Fixnum] The width to use when formatting the string in the terminal

@return [String] Wraps a string to the terminal width taking into

account the given indentation.

source://cork//lib/cork/text_wrapper.rb#47

source://cork//lib/cork/text_wrapper.rb#66

source://cork//lib/cork/text_wrapper.rb#58

@param indent [Fixnum] The number of spaces to insert before the string.

@param width [Fixnum] The width to use to format the string if the terminal

is too wide.

@return [String] Wraps a formatted string (e.g. markdown) by stripping

heredoc indentation and wrapping by word to the terminal width

taking into account a maximum one, and indenting the string.

Code lines (i.e. indented by four spaces) are not wrapped.

source://cork//lib/cork/text_wrapper.rb#20

@param indent [Fixnum] The number of spaces to insert before the string.

@param width [Fixnum] The width to use when formatting the string in the terminal

@return [String] Wraps a string to the terminal width taking into

account the given indentation.

source://cork//lib/cork/text_wrapper.rb#47

https://github.com/jaspermayone/greenhouse/blob/b44c6478e928fdd5ada0bd950c7340818b6e64fb/sorbet/rbi/gems/cork@0.3.0.rbi#L166


# typed: true

# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `cork` gem.
# Please instead update this file by running `bin/tapioca gem cork`.

# source://cork//lib/cork.rb#1
module Cork; end

# provides support for UI output. Cork provides support for nested
# sections of information and for a verbose mode.
#
# source://cork//lib/cork/board.rb#8
class Cork::Board
  # Initialize a new instance.
  #
  # @param verbose [Boolean] When verbose is true verbose output is printed.
  #   this defaults to true
  # @param silent [Boolean] When silent is true all output is supressed.
  #   This defaults to false.
  # @param ansi [Boolean] When ansi is true output may contain ansi
  #   color codes. This is true by default.
  # @param input [IO] The file descriptor to read the user input.
  # @param out [IO] The file descriptor to print all output to.
  # @param err [IO] The file descriptor to print all errors to.
  # @return [Board] a new instance of Board
  #
  # source://cork//lib/cork/board.rb#49
  def initialize(verbose: T.unsafe(nil), silent: T.unsafe(nil), ansi: T.unsafe(nil), input: T.unsafe(nil), out: T.unsafe(nil), err: T.unsafe(nil)); end

  # Returns the value of attribute ansi.
  #
  # source://cork//lib/cork/board.rb#31
  def ansi; end

  # Returns the value of attribute ansi.
  #
  # source://cork//lib/cork/board.rb#31
  def ansi?; end

  # @return [Bool] Whether the wrapping of the strings to the width of the
  #   terminal should be disabled.
  #
  # source://cork//lib/cork/board.rb#22
  def disable_wrap; end

  # @return [Bool] Whether the wrapping of the strings to the width of the
  #   terminal should be disabled.
  #
  # source://cork//lib/cork/board.rb#22
  def disable_wrap=(_arg0); end

  # @return [Bool] Whether the wrapping of the strings to the width of the
  #   terminal should be disabled.
  #
  # source://cork//lib/cork/board.rb#22
  def disable_wrap?; end

  # @return [error] The error specification containing the UI error.
  #
  # source://cork//lib/cork/board.rb#16
  def err; end

  # Gets input from the configured input.
  #
  # source://cork//lib/cork/board.rb#86
  def gets; end

  # Returns the value of attribute indentation_level.
  #
  # source://cork//lib/cork/board.rb#34
  def indentation_level; end

  # Prints an info to the user. The info is always displayed.
  # It respects the current indentation level only in verbose
  # mode.
  #
  # Any title printed in the optional block is treated as a message.
  #
  # @param message [String] The message to print.
  #
  # source://cork//lib/cork/board.rb#198
  def info(message); end

  # @return [input] The input specification that contains the user input
  #   for the UI.
  #
  # source://cork//lib/cork/board.rb#12
  def input; end

  # Prints a message with a label.
  #
  # @param label [String] The label to print.
  # @param value [#to_s] The value to print.
  # @param justification [FixNum] The justification of the label.
  #
  # source://cork//lib/cork/board.rb#137
  def labeled(label, value, justification = T.unsafe(nil)); end

  # Prints a verbose message taking an optional verbose prefix and
  # a relative indentation valid for the UI action in the passed
  # block.
  #
  # @todo Clean interface.
  #
  # source://cork//lib/cork/board.rb#290
  def message(message, verbose_prefix = T.unsafe(nil), relative_indentation = T.unsafe(nil)); end

  # Prints a verbose message taking an optional verbose prefix and
  # a relatvie indentation valid for the UI action in the passed block.
  #
  # source://cork//lib/cork/board.rb#243
  def notice(message); end

  # @return [output] The output specification containing the UI output.
  #
  # source://cork//lib/cork/board.rb#14
  def out; end

  # The returned path is quoted. If the argument is nil it returns an empty
  # string.
  #
  # @param pathname [#to_str, Nil] The path to return.
  # @param relative_to [Pathname]
  #
  # source://cork//lib/cork/board.rb#117
  def path(pathname, relative_to = T.unsafe(nil)); end

  # Prints a message without a new line unless silent.
  #
  # source://cork//lib/cork/board.rb#72
  def print(message); end

  # Prints the stored warnings. This method is intended to be called at the
  # end of the execution of the binary.
  #
  # @return [void]
  #
  # source://cork//lib/cork/board.rb#267
  def print_warnings; end

  # Prints a message followed by a new line unless silent.
  #
  # source://cork//lib/cork/board.rb#66
  def puts(message = T.unsafe(nil)); end

  # Prints a message respecting the current indentation level and
  # wrapping it to the terminal width if necessary.
  #
  # source://cork//lib/cork/board.rb#79
  def puts_indented(message = T.unsafe(nil)); end

  # Prints a title taking an optional verbose prefix and
  # a relative indentation valid for the UI action in the passed
  # block.
  #
  # In verbose mode titles are printed with a color according
  # to their level. In normal mode titles are printed only if
  # they have nesting level smaller than 2.
  #
  # @param title [String] The title to print
  # @param verbose_prefix [String] See #message
  # @param relative_indentation [FixNum] The indentation level relative to the current,
  #   when the message is printed.
  # @todo Refactor to title (for always visible titles like search)
  #   and sections (titles that represent collapsible sections).
  #
  # source://cork//lib/cork/board.rb#174
  def section(title, verbose_prefix = T.unsafe(nil), relative_indentation = T.unsafe(nil), titled = T.unsafe(nil)); end

  # Returns the value of attribute silent.
  #
  # source://cork//lib/cork/board.rb#28
  def silent; end

  # Returns the value of attribute silent.
  #
  # source://cork//lib/cork/board.rb#28
  def silent?; end

  # A title opposed to a section is always visible
  #
  # @param title [String] The title to print
  # @param verbose_prefix [String] See #message
  # @param relative_indentation [FixNum] The indentation level relative to the current,
  #   when the message is printed.
  #
  # source://cork//lib/cork/board.rb#224
  def title(title, verbose_prefix = T.unsafe(nil), relative_indentation = T.unsafe(nil)); end

  # Returns the value of attribute verbose.
  #
  # source://cork//lib/cork/board.rb#25
  def verbose; end

  # Returns the value of attribute verbose.
  #
  # source://cork//lib/cork/board.rb#25
  def verbose?; end

  # Stores important warning to the user optionally followed by actions that
  # the user should take. To print them use {#print_warnings}.
  #
  #  @param [String]  message The message to print.
  #  @param [Array]   actions The actions that the user should take.
  #  @param [Boolean] verbose_only When verbose_only is configured to
  #                   true, the warning will only be printed when
  #                   Board is configured to print verbose messages.
  #                   This is false by default.
  #
  #  @return [void]
  #
  # source://cork//lib/cork/board.rb#102
  def warn(message, actions = T.unsafe(nil), verbose_only = T.unsafe(nil)); end

  # @return [warnings] The warnings specification containing the UI warnings.
  #
  # source://cork//lib/cork/board.rb#18
  def warnings; end

  private

  # Sets the attribute indentation_level
  #
  # @param value the value to set the attribute indentation_level to.
  #
  # source://cork//lib/cork/board.rb#303
  def indentation_level=(_arg0); end

  # source://cork//lib/cork/board.rb#340
  def puts_title(title, verbose_prefix); end

  # Returns the value of attribute title_level.
  #
  # source://cork//lib/cork/board.rb#304
  def title_level; end

  # Sets the attribute title_level
  #
  # @param value the value to set the attribute title_level to.
  #
  # source://cork//lib/cork/board.rb#304
  def title_level=(_arg0); end

  # Prints a title taking an optional verbose prefix and
  # a relative indentation valid for the UI action in the passed
  # block.
  #
  # In verbose mode titles are printed with a color according
  # to their level. In normal mode titles are printed only if
  # they have nesting level smaller than 2.
  #
  # @param title [String] The title to print
  # @param verbose_prefix [String] See #message
  # @param relative_indentation [FixNum] The indentation level relative to the current,
  #   when the message is printed.
  # @todo Refactor to title (for always visible titles like search)
  #   and sections (titles that represent collapsible sections).
  #
  # source://cork//lib/cork/board.rb#328
  def wrap_string(string, indent = T.unsafe(nil)); end
end

# source://cork//lib/cork/text_wrapper.rb#4
module Cork::TextWrapper
  private

  # @return [String] Lifted straigth from Actionview. Thanks Guys!
  #
  # source://cork//lib/cork/text_wrapper.rb#66
  def strip_heredoc(string); end

  # @return [String] Lifted straigth from Actionview. Thanks Guys!
  #
  # source://cork//lib/cork/text_wrapper.rb#58
  def word_wrap(line, line_width); end

  # @param string [String] The string to format.
  # @param indent [Fixnum] The number of spaces to insert before the string.
  # @param width [Fixnum] The width to use to format the string if the terminal
  #   is too wide.
  # @return [String] Wraps a formatted string (e.g. markdown) by stripping
  #   heredoc indentation and wrapping by word to the terminal width
  #   taking into account a maximum one, and indenting the string.
  #   Code lines (i.e. indented by four spaces) are not wrapped.
  #
  # source://cork//lib/cork/text_wrapper.rb#20
  def wrap_formatted_text(string, indent = T.unsafe(nil), width = T.unsafe(nil)); end

  # @param string [String] The string to indent.
  # @param indent [Fixnum] The number of spaces to insert before the string.
  # @param width [Fixnum] The width to use when formatting the string in the terminal
  # @return [String] Wraps a string to the terminal width taking into
  #   account the given indentation.
  #
  # source://cork//lib/cork/text_wrapper.rb#47
  def wrap_with_indent(string, indent = T.unsafe(nil), width = T.unsafe(nil)); end

  class << self
    # @return [String] Lifted straigth from Actionview. Thanks Guys!
    #
    # source://cork//lib/cork/text_wrapper.rb#66
    def strip_heredoc(string); end

    # @return [String] Lifted straigth from Actionview. Thanks Guys!
    #
    # source://cork//lib/cork/text_wrapper.rb#58
    def word_wrap(line, line_width); end

    # @param string [String] The string to format.
    # @param indent [Fixnum] The number of spaces to insert before the string.
    # @param width [Fixnum] The width to use to format the string if the terminal
    #   is too wide.
    # @return [String] Wraps a formatted string (e.g. markdown) by stripping
    #   heredoc indentation and wrapping by word to the terminal width
    #   taking into account a maximum one, and indenting the string.
    #   Code lines (i.e. indented by four spaces) are not wrapped.
    #
    # source://cork//lib/cork/text_wrapper.rb#20
    def wrap_formatted_text(string, indent = T.unsafe(nil), width = T.unsafe(nil)); end

    # @param string [String] The string to indent.
    # @param indent [Fixnum] The number of spaces to insert before the string.
    # @param width [Fixnum] The width to use when formatting the string in the terminal
    # @return [String] Wraps a string to the terminal width taking into
    #   account the given indentation.
    #
    # source://cork//lib/cork/text_wrapper.rb#47
    def wrap_with_indent(string, indent = T.unsafe(nil), width = T.unsafe(nil)); end
  end
end

# source://cork//lib/cork/gem_version.rb#2
Cork::VERSION = T.let(T.unsafe(nil), String)