Class: Rgot::Common
- Inherits:
-
Object
- Object
- Rgot::Common
- Defined in:
- lib/rgot/common.rb
Instance Attribute Summary collapse
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
- #error(*args) ⇒ Object
- #errorf(*args) ⇒ Object
- #fail! ⇒ Object
- #fail_now ⇒ Object
- #failed? ⇒ Boolean
- #fatal(*args) ⇒ Object
- #fatalf(*args) ⇒ Object
- #finish! ⇒ Object
- #finished? ⇒ Boolean
-
#initialize ⇒ Common
constructor
A new instance of Common.
- #log(*args) ⇒ Object
- #logf(*args) ⇒ Object
- #skip(*args) ⇒ Object
- #skip! ⇒ Object
- #skip_now ⇒ Object
- #skipf(*args) ⇒ Object
- #skipped? ⇒ Boolean
Constructor Details
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
9 10 11 |
# File 'lib/rgot/common.rb', line 9 def output @output end |
Instance Method Details
#error(*args) ⇒ Object
54 55 56 57 58 |
# File 'lib/rgot/common.rb', line 54 def error(*args) internal_log(args.map(&:to_s).join(' ')) fail! nil end |
#errorf(*args) ⇒ Object
60 61 62 63 64 |
# File 'lib/rgot/common.rb', line 60 def errorf(*args) internal_log(sprintf(*args)) fail! nil end |
#fail! ⇒ Object
32 33 34 |
# File 'lib/rgot/common.rb', line 32 def fail! @mutex.synchronize { @failed = true } end |
#fail_now ⇒ Object
92 93 94 95 96 |
# File 'lib/rgot/common.rb', line 92 def fail_now fail! finish! throw :skip end |
#failed? ⇒ Boolean
20 21 22 |
# File 'lib/rgot/common.rb', line 20 def failed? @mutex.synchronize { @failed } end |
#fatal(*args) ⇒ Object
66 67 68 69 |
# File 'lib/rgot/common.rb', line 66 def fatal(*args) internal_log(args.map(&:to_s).join(' ')) fail_now end |
#fatalf(*args) ⇒ Object
71 72 73 74 |
# File 'lib/rgot/common.rb', line 71 def fatalf(*args) internal_log(sprintf(*args)) fail_now end |
#finish! ⇒ Object
40 41 42 |
# File 'lib/rgot/common.rb', line 40 def finish! @mutex.synchronize { @finished = true } end |
#finished? ⇒ Boolean
28 29 30 |
# File 'lib/rgot/common.rb', line 28 def finished? @mutex.synchronize { @finished } end |
#log(*args) ⇒ Object
44 45 46 47 |
# File 'lib/rgot/common.rb', line 44 def log(*args) internal_log(args.map(&:to_s).join(' ')) nil end |
#logf(*args) ⇒ Object
49 50 51 52 |
# File 'lib/rgot/common.rb', line 49 def logf(*args) internal_log(sprintf(*args)) nil end |
#skip(*args) ⇒ Object
76 77 78 79 |
# File 'lib/rgot/common.rb', line 76 def skip(*args) internal_log(args.map(&:to_s).join(' ')) skip_now end |
#skip! ⇒ Object
36 37 38 |
# File 'lib/rgot/common.rb', line 36 def skip! @mutex.synchronize { @skipped = true } end |
#skip_now ⇒ Object
86 87 88 89 90 |
# File 'lib/rgot/common.rb', line 86 def skip_now skip! finish! throw :skip end |
#skipf(*args) ⇒ Object
81 82 83 84 |
# File 'lib/rgot/common.rb', line 81 def skipf(*args) internal_log(sprintf(*args)) skip_now end |
#skipped? ⇒ Boolean
24 25 26 |
# File 'lib/rgot/common.rb', line 24 def skipped? @mutex.synchronize { @skipped } end |