Class: Evergreen::Helper
- Inherits:
-
Object
- Object
- Evergreen::Helper
- Defined in:
- lib/evergreen/helper.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#suite ⇒ Object
readonly
Returns the value of attribute suite.
Instance Method Summary collapse
- #exist? ⇒ Boolean
- #full_path ⇒ Object
-
#initialize(suite, name) ⇒ Helper
constructor
A new instance of Helper.
- #read ⇒ Object (also: #contents)
- #root ⇒ Object
Constructor Details
#initialize(suite, name) ⇒ Helper
Returns a new instance of Helper.
6 7 8 9 |
# File 'lib/evergreen/helper.rb', line 6 def initialize(suite, name) @suite = suite @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/evergreen/helper.rb', line 4 def name @name end |
#suite ⇒ Object (readonly)
Returns the value of attribute suite.
4 5 6 |
# File 'lib/evergreen/helper.rb', line 4 def suite @suite end |
Instance Method Details
#exist? ⇒ Boolean
29 30 31 |
# File 'lib/evergreen/helper.rb', line 29 def exist? File.exist?(full_path) end |
#full_path ⇒ Object
15 16 17 |
# File 'lib/evergreen/helper.rb', line 15 def full_path File.join(root, Evergreen.helper_dir, name) end |
#read ⇒ Object Also known as: contents
19 20 21 22 23 24 25 26 |
# File 'lib/evergreen/helper.rb', line 19 def read if full_path =~ /\.coffee$/ require 'coffee-script' CoffeeScript.compile(File.read(full_path)) else File.read(full_path) end end |
#root ⇒ Object
11 12 13 |
# File 'lib/evergreen/helper.rb', line 11 def root suite.root end |