class Pantograph::Actions::PutsAction
Public Class Methods
alias_used(action_alias, params)
click to toggle source
# File pantograph/lib/pantograph/actions/puts.rb, line 42 def self.alias_used(action_alias, params) if !params.kind_of?(PantographCore::Configuration) || params[:message].nil? UI.important("#{action_alias} called, please use 'puts' instead!") end end
aliases()
click to toggle source
# File pantograph/lib/pantograph/actions/puts.rb, line 48 def self.aliases ["println", "echo"] end
available_options()
click to toggle source
# File pantograph/lib/pantograph/actions/puts.rb, line 24 def self.available_options [ PantographCore::ConfigItem.new(key: :message, env_name: 'PUTS_MESSAGE', description: 'Message to be printed out', optional: true, type: String) ] end
category()
click to toggle source
# File pantograph/lib/pantograph/actions/puts.rb, line 63 def self.category :misc end
description()
click to toggle source
@!group Documentation
# File pantograph/lib/pantograph/actions/puts.rb, line 20 def self.description "Prints out the given text" end
example_code()
click to toggle source
# File pantograph/lib/pantograph/actions/puts.rb, line 57 def self.example_code [ 'puts "Hi there"' ] end
is_supported?(platform)
click to toggle source
# File pantograph/lib/pantograph/actions/puts.rb, line 38 def self.is_supported?(platform) true end
run(params)
click to toggle source
# File pantograph/lib/pantograph/actions/puts.rb, line 4 def self.run(params) # display text from the message param # if called like `puts 'hi'` then params won't be a configuration item, so we have to check if params.kind_of?(PantographCore::Configuration) && params[:message] UI.message(params[:message]) return end # no parameter included in the call means treat this like a normal pantograph ruby call UI.message(params.join(' ')) end
step_text()
click to toggle source
We don't want to show this as step
# File pantograph/lib/pantograph/actions/puts.rb, line 53 def self.step_text nil end