Class: Rails::Hyperdrive::InstallLayout::Kind

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

Overview

One kind's whole contract: how a companion ships it, how it is identified and validated, and where each target tool installs it.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#collision_rewrites_nameObject

Returns the value of attribute collision_rewrites_name

Returns:

  • (Object)

    the current value of collision_rewrites_name



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def collision_rewrites_name
  @collision_rewrites_name
end

#convention_rootsObject

Returns the value of attribute convention_roots

Returns:

  • (Object)

    the current value of convention_roots



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def convention_roots
  @convention_roots
end

#destsObject

Returns the value of attribute dests

Returns:

  • (Object)

    the current value of dests



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def dests
  @dests
end

#dir_keyObject

Returns the value of attribute dir_key

Returns:

  • (Object)

    the current value of dir_key



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def dir_key
  @dir_key
end

#eagerObject

Returns the value of attribute eager

Returns:

  • (Object)

    the current value of eager



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def eager
  @eager
end

#erbObject

Returns the value of attribute erb

Returns:

  • (Object)

    the current value of erb



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def erb
  @erb
end

#frontmatterObject

Returns the value of attribute frontmatter

Returns:

  • (Object)

    the current value of frontmatter



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def frontmatter
  @frontmatter
end

#identityObject

Returns the value of attribute identity

Returns:

  • (Object)

    the current value of identity



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def identity
  @identity
end

#install_bodyObject

Returns the value of attribute install_body

Returns:

  • (Object)

    the current value of install_body



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def install_body
  @install_body
end

#key_labelObject

Returns the value of attribute key_label

Returns:

  • (Object)

    the current value of key_label



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def key_label
  @key_label
end

#name_from_destObject

Returns the value of attribute name_from_dest

Returns:

  • (Object)

    the current value of name_from_dest



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def name_from_dest
  @name_from_dest
end

#prefix_keyObject

Returns the value of attribute prefix_key

Returns:

  • (Object)

    the current value of prefix_key



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def prefix_key
  @prefix_key
end

#sectionObject

Returns the value of attribute section

Returns:

  • (Object)

    the current value of section



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def section
  @section
end

#shapeObject

Returns the value of attribute shape

Returns:

  • (Object)

    the current value of shape



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def shape
  @shape
end

#shipped_labelObject

Returns the value of attribute shipped_label

Returns:

  • (Object)

    the current value of shipped_label



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def shipped_label
  @shipped_label
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



23
24
25
# File 'lib/rails/hyperdrive/install_layout.rb', line 23

def type
  @type
end

Instance Method Details

#dest_for(final_name, target: DEFAULT_TARGET) ⇒ Object



39
40
41
# File 'lib/rails/hyperdrive/install_layout.rb', line 39

def dest_for(final_name, target: DEFAULT_TARGET)
  dests[target]&.path&.call(final_name)
end

#dir_shaped?Boolean

Only a directory-shaped kind ships supporting files, so it is the only one a manifest entry may gate per file.

Returns:

  • (Boolean)


35
36
37
# File 'lib/rails/hyperdrive/install_layout.rb', line 35

def dir_shaped?
  shape == :dir
end

#installed_name(dest) ⇒ Object



43
44
45
# File 'lib/rails/hyperdrive/install_layout.rb', line 43

def installed_name(dest)
  name_from_dest.call(dest)
end

#lock_kindObject



29
30
31
# File 'lib/rails/hyperdrive/install_layout.rb', line 29

def lock_kind
  type.to_s
end

#roots_for(gem_name) ⇒ Object

Relative to the gem root; searched in the order given.



48
49
50
# File 'lib/rails/hyperdrive/install_layout.rb', line 48

def roots_for(gem_name)
  convention_roots ? convention_roots.call(gem_name) : []
end