Class: Yoda::Store::Objects::Library::Gem::Connected

Inherits:
Object
  • Object
show all
Extended by:
ConnectedDelegation
Includes:
WithRegistry
Defined in:
lib/yoda/store/objects/library/gem.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ConnectedDelegation

delegate_to_object

Methods included from WithRegistry

#registry, #registry_exists?

Constructor Details

#initialize(object, project:) ⇒ Connected

Returns a new instance of Connected.

Parameters:



129
130
131
132
# File 'lib/yoda/store/objects/library/gem.rb', line 129

def initialize(object, project:)
  @object = object
  @project = project
end

Instance Attribute Details

#objectGem (readonly)

Returns:



122
123
124
# File 'lib/yoda/store/objects/library/gem.rb', line 122

def object
  @object
end

#projectProject (readonly)

Returns:



125
126
127
# File 'lib/yoda/store/objects/library/gem.rb', line 125

def project
  @project
end

Instance Method Details

#create_patchObject



144
145
146
# File 'lib/yoda/store/objects/library/gem.rb', line 144

def create_patch
  Actions::ImportGem.run(self)
end

#registry_pathObject

Note:

Implementation for WithRegistry#registry_path



135
136
137
138
139
140
141
142
# File 'lib/yoda/store/objects/library/gem.rb', line 135

def registry_path
  if managed_by_rubygems?
    project.library_registry_path(name: name, version: version)
  else
    # Do not persist not gems.
    nil
  end
end