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



118
119
120
121
# File 'lib/yoda/store/objects/library/gem.rb', line 118

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

Instance Attribute Details

#objectGem (readonly)



111
112
113
# File 'lib/yoda/store/objects/library/gem.rb', line 111

def object
  @object
end

#projectProject (readonly)



114
115
116
# File 'lib/yoda/store/objects/library/gem.rb', line 114

def project
  @project
end

Instance Method Details

#create_patchObject



133
134
135
# File 'lib/yoda/store/objects/library/gem.rb', line 133

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

#registry_pathObject

Note:

Implementation for WithRegistry#registry_path



124
125
126
127
128
129
130
131
# File 'lib/yoda/store/objects/library/gem.rb', line 124

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