class Bump::CLI::Definition

Attributes

content[R]
external_references[R]
import_external_references[R]
path[R]

Public Class Methods

new(path, import_external_references: false) click to toggle source
# File lib/bump/cli/definition.rb, line 9
def initialize(path, import_external_references: false)
  @path = path
  @import_external_references = import_external_references
  @external_references = References.new(root_path: find_base_path(path))
end

Public Instance Methods

prepare!() click to toggle source
# File lib/bump/cli/definition.rb, line 15
def prepare!
  @content = Resource.read(path)

  if import_external_references
    external_references.load(Resource.parse(content))
  end
end

Private Instance Methods

find_base_path(path) click to toggle source
# File lib/bump/cli/definition.rb, line 27
def find_base_path(path)
  Pathname.new(path.to_s).dirname.to_s + Pathname::SEPARATOR_LIST
end