Class: Packages::Conan::Metadatum

Inherits:
ApplicationRecord show all
Defined in:
app/models/packages/conan/metadatum.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Class Method Details

.full_path_from(package_username:) ⇒ Object


30
31
32
# File 'app/models/packages/conan/metadatum.rb', line 30

def self.full_path_from(package_username:)
  package_username.tr('+', '/')
end

.package_username_from(full_path:) ⇒ Object


26
27
28
# File 'app/models/packages/conan/metadatum.rb', line 26

def self.package_username_from(full_path:)
  full_path.tr('/', '+')
end

Instance Method Details

#recipeObject


18
19
20
# File 'app/models/packages/conan/metadatum.rb', line 18

def recipe
  "#{package.name}/#{package.version}@#{package_username}/#{package_channel}"
end

#recipe_pathObject


22
23
24
# File 'app/models/packages/conan/metadatum.rb', line 22

def recipe_path
  recipe.tr('@', '/')
end