Class: CiderCI::RspecSupport::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/cider_ci/rspec_support/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#propertiesObject (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

Returns:

  • (Boolean)


17
18
19
# File 'lib/cider_ci/rspec_support/task.rb', line 17

def eql?(other)
  rspec_path == other.rspec_path
end

#hashObject



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_pathObject 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