Class: Rails::Hyperdrive::InstallPlan::Entry

Inherits:
Struct
  • Object
show all
Defined in:
lib/rails/hyperdrive/install_plan.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#artifactObject

Returns the value of attribute artifact

Returns:

  • (Object)

    the current value of artifact



9
10
11
# File 'lib/rails/hyperdrive/install_plan.rb', line 9

def artifact
  @artifact
end

#collisionObject

Returns the value of attribute collision

Returns:

  • (Object)

    the current value of collision



9
10
11
# File 'lib/rails/hyperdrive/install_plan.rb', line 9

def collision
  @collision
end

#destObject

Returns the value of attribute dest

Returns:

  • (Object)

    the current value of dest



9
10
11
# File 'lib/rails/hyperdrive/install_plan.rb', line 9

def dest
  @dest
end

#final_nameObject

Returns the value of attribute final_name

Returns:

  • (Object)

    the current value of final_name



9
10
11
# File 'lib/rails/hyperdrive/install_plan.rb', line 9

def final_name
  @final_name
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



9
10
11
# File 'lib/rails/hyperdrive/install_plan.rb', line 9

def type
  @type
end

Instance Method Details

#artifact_kindObject



38
39
40
# File 'lib/rails/hyperdrive/install_plan.rb', line 38

def artifact_kind
  type.to_s
end

#install_ready_bodyObject

The renamed name: is part of the hashed body, so a postfixed skill hashes to a stable value.



12
13
14
15
16
# File 'lib/rails/hyperdrive/install_plan.rb', line 12

def install_ready_body
  body = BundlerArtifactDiscovery.install_ready_body(artifact)
  return body unless type == :skill && final_name != artifact.name
  body.sub(/^name:\s*.+$/, "name: #{final_name}")
end

#source_gemObject



26
27
28
# File 'lib/rails/hyperdrive/install_plan.rb', line 26

def source_gem
  artifact.source_gem
end

#source_labelObject



34
35
36
# File 'lib/rails/hyperdrive/install_plan.rb', line 34

def source_label
  "#{source_gem}@#{version}"
end

#support_filesObject



18
19
20
21
22
23
24
# File 'lib/rails/hyperdrive/install_plan.rb', line 18

def support_files
  return [] unless type == :skill
  dir = File.dirname(dest)
  Array(artifact.support_files).map do |file|
    { path: file[:path], body: file[:body], dest: "#{dir}/#{file[:path]}" }
  end
end

#versionObject



30
31
32
# File 'lib/rails/hyperdrive/install_plan.rb', line 30

def version
  artifact.spec_version
end