module Toys::StandardMixins::Highline
A mixin that provides access to the capabilities of the highline gem.
This mixin requires the highline gem, version 2.0 or later. It will attempt to install the gem if it is not available.
You may make these methods available to your tool by including the following directive in your tool configuration:
include :highline
A HighLine object will then be available by calling the {#highline} method. For information on using this object, see the [Highline documentation](www.rubydoc.info/gems/highline). Some of the most common HighLine methods, such as `say`, are also mixed into the tool and can be called directly.
You can configure the HighLine object by passing options to the `include` directive. For example:
include :highline, my_stdin, my_stdout
The arguments will be passed on to the [HighLine constructor](www.rubydoc.info/gems/highline/HighLine:initialize).
Constants
- KEY
Context
key for the highline object. @return [Object]
Public Instance Methods
Calls [HighLine#agree](www.rubydoc.info/gems/highline/HighLine:agree)
# File lib/toys/standard_mixins/highline.rb, line 59 def agree(*args, &block) highline.agree(*args, &block) end
Calls [HighLine#ask](www.rubydoc.info/gems/highline/HighLine:ask)
# File lib/toys/standard_mixins/highline.rb, line 66 def ask(*args, &block) highline.ask(*args, &block) end
Calls [HighLine#choose](www.rubydoc.info/gems/highline/HighLine:choose)
# File lib/toys/standard_mixins/highline.rb, line 73 def choose(*args, &block) highline.choose(*args, &block) end
Calls [HighLine#color](www.rubydoc.info/gems/highline/HighLine:color)
# File lib/toys/standard_mixins/highline.rb, line 115 def color(*args) highline.color(*args) end
Calls [HighLine#color_code](www.rubydoc.info/gems/highline/HighLine:color_code)
# File lib/toys/standard_mixins/highline.rb, line 122 def color_code(*args) highline.color_code(*args) end
A tool-wide [HighLine](www.rubydoc.info/gems/highline/HighLine) instance @return [::HighLine]
# File lib/toys/standard_mixins/highline.rb, line 52 def highline self[KEY] end
Calls [HighLine#indent](www.rubydoc.info/gems/highline/HighLine:indent)
# File lib/toys/standard_mixins/highline.rb, line 94 def indent(*args, &block) highline.indent(*args, &block) end
Calls [HighLine#list](www.rubydoc.info/gems/highline/HighLine:list)
# File lib/toys/standard_mixins/highline.rb, line 80 def list(*args, &block) highline.list(*args, &block) end
Calls [HighLine#new_scope](www.rubydoc.info/gems/highline/HighLine:new_scope)
# File lib/toys/standard_mixins/highline.rb, line 136 def new_scope highline.new_scope end
Calls [HighLine#newline](www.rubydoc.info/gems/highline/HighLine:newline)
# File lib/toys/standard_mixins/highline.rb, line 101 def newline highline.newline end
Calls [HighLine#puts](www.rubydoc.info/gems/highline/HighLine:puts)
# File lib/toys/standard_mixins/highline.rb, line 108 def puts(*args) highline.puts(*args) end
Calls [HighLine#say](www.rubydoc.info/gems/highline/HighLine:say)
# File lib/toys/standard_mixins/highline.rb, line 87 def say(*args, &block) highline.say(*args, &block) end
Calls [HighLine#uncolor](www.rubydoc.info/gems/highline/HighLine:uncolor)
# File lib/toys/standard_mixins/highline.rb, line 129 def uncolor(*args) highline.uncolor(*args) end