Class: Papa::Helper::Output
- Inherits:
-
Object
- Object
- Papa::Helper::Output
- Defined in:
- lib/papa/helper/output.rb
Constant Summary collapse
- REDIRECT_TO_NULL =
'> /dev/null 2>&1'
Class Method Summary collapse
- .build_output(message) ⇒ Object
- .error(message) ⇒ Object
- .failure(message) ⇒ Object
- .failure_info(message) ⇒ Object
- .info(message) ⇒ Object
- .stderr(message, options = {}) ⇒ Object
- .stdout(message, options = {}) ⇒ Object
- .success(message) ⇒ Object
- .success_info(message) ⇒ Object
- .timestamp ⇒ Object
Class Method Details
.build_output(message) ⇒ Object
55 56 57 |
# File 'lib/papa/helper/output.rb', line 55 def self.build_output() "[#{}] - #{}" end |
.error(message) ⇒ Object
20 21 22 23 24 |
# File 'lib/papa/helper/output.rb', line 20 def self.error() = "ERROR: #{}" stderr() Helper::Logger.log() end |
.failure(message) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/papa/helper/output.rb', line 33 def self.failure() .strip! STDERR.puts STDERR.puts .red Helper::Logger.log() end |
.failure_info(message) ⇒ Object
45 46 47 48 |
# File 'lib/papa/helper/output.rb', line 45 def self.failure_info() STDERR.puts Helper::Logger.log() end |
.info(message) ⇒ Object
50 51 52 53 |
# File 'lib/papa/helper/output.rb', line 50 def self.info() puts Helper::Logger.log() end |
.stderr(message, options = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/papa/helper/output.rb', line 14 def self.stderr(, = {}) = build_output() STDERR.puts Helper::Logger.log() end |
.stdout(message, options = {}) ⇒ Object
8 9 10 11 12 |
# File 'lib/papa/helper/output.rb', line 8 def self.stdout(, = {}) = build_output() puts Helper::Logger.log() end |
.success(message) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/papa/helper/output.rb', line 26 def self.success() .strip! puts puts .green Helper::Logger.log() end |
.success_info(message) ⇒ Object
40 41 42 43 |
# File 'lib/papa/helper/output.rb', line 40 def self.success_info() puts Helper::Logger.log() end |
.timestamp ⇒ Object
59 60 61 |
# File 'lib/papa/helper/output.rb', line 59 def self. Time.now.strftime('%I:%M:%S %p') end |