Class: CiderCI::RspecSupport::Task
- Inherits:
-
Object
- Object
- CiderCI::RspecSupport::Task
- Defined in:
- lib/cider_ci/rspec_support/task.rb
Instance Attribute Summary collapse
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(properties) ⇒ Task
constructor
A new instance of Task.
- #rspec_path ⇒ Object (also: #key)
- #spec_properties(script_main_body_template) ⇒ Object
Constructor Details
#initialize(properties) ⇒ Task
Returns a new instance of Task.
9 10 11 |
# File 'lib/cider_ci/rspec_support/task.rb', line 9 def initialize(properties) @properties = properties.freeze end |
Instance Attribute Details
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
7 8 9 |
# File 'lib/cider_ci/rspec_support/task.rb', line 7 def properties @properties end |
Instance Method Details
#eql?(other) ⇒ Boolean
17 18 19 |
# File 'lib/cider_ci/rspec_support/task.rb', line 17 def eql?(other) rspec_path == other.rspec_path end |
#hash ⇒ Object
13 14 15 |
# File 'lib/cider_ci/rspec_support/task.rb', line 13 def hash Digest.hexencode(Digest::MD5.digest(rspec_path)).to_i(36) end |
#rspec_path ⇒ Object Also known as: key
21 22 23 |
# File 'lib/cider_ci/rspec_support/task.rb', line 21 def rspec_path [@properties[:file_path], @properties[:line_number]].compact.join(":") end |
#spec_properties(script_main_body_template) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/cider_ci/rspec_support/task.rb', line 27 def spec_properties(script_main_body_template) { name: @properties[:description], scripts: { main: { body: eval(script_main_body_template) } } } end |