Module: Corrupt::ClientHelpers
- Included in:
- Client
- Defined in:
- lib/corrupt/client/helpers.rb
Instance Method Summary collapse
-
#error(message, stream = $stderr) ⇒ Object
Output an error message to
stream(defaults to $stderr). -
#output(string, opts = {}) ⇒ Object
Output
stringtoopts[:stream]usingopts[:method]. - #take_action! ⇒ Object
Instance Method Details
#error(message, stream = $stderr) ⇒ Object
Output an error message to stream (defaults to $stderr).
5 6 7 |
# File 'lib/corrupt/client/helpers.rb', line 5 def error(, stream = $stderr) stream.puts end |
#output(string, opts = {}) ⇒ Object
Output string to opts[:stream] using opts[:method].
10 11 12 13 14 |
# File 'lib/corrupt/client/helpers.rb', line 10 def output(string, opts = {}) opts[:method] ||= 'puts' opts[:stream] ||= $stdout opts[:stream].send(opts[:method], string) end |
#take_action! ⇒ Object
16 17 18 |
# File 'lib/corrupt/client/helpers.rb', line 16 def take_action! Corrupt::Generators::App.new(@options[:path]) if @options[:path] end |