Class: PrefetchRspec::Base
- Inherits:
-
Object
- Object
- PrefetchRspec::Base
- Defined in:
- lib/prefetch_rspec.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #color(str, col = 37) ⇒ Object
- #cwarn(str, col = 37) ⇒ Object
- #drb_uri ⇒ Object
-
#initialize(args) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(args) ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/prefetch_rspec.rb', line 9 def initialize(args) optparse(args.to_a) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/prefetch_rspec.rb', line 7 def @options end |
Instance Method Details
#color(str, col = 37) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/prefetch_rspec.rb', line 17 def color(str, col = 37) if STDOUT.tty? "\033[1;#{col}m%s\033[0m" % str else str end end |
#cwarn(str, col = 37) ⇒ Object
13 14 15 |
# File 'lib/prefetch_rspec.rb', line 13 def cwarn(str, col = 37) warn color(str, col) end |
#drb_uri ⇒ Object
25 26 27 |
# File 'lib/prefetch_rspec.rb', line 25 def drb_uri "druby://127.0.0.1:#{[:port] || DEFAULT_PORT }" end |