Class: Envandle::PathReference

Inherits:
Object
  • Object
show all
Extended by:
AsReference
Defined in:
lib/envandle/path_reference.rb

Instance Method Summary collapse

Methods included from AsReference

extended

Constructor Details

#initialize(context, name, path) ⇒ PathReference

Returns a new instance of PathReference.



5
6
7
8
9
# File 'lib/envandle/path_reference.rb', line 5

def initialize(context, name, path)
  @context = context
  @name = name
  @path = path
end

Instance Method Details

#specObject



11
12
13
# File 'lib/envandle/path_reference.rb', line 11

def spec
  @spec ||= Gemspec.new(Gemspec.find_file(@path, name: @name))
end

#to_executable_argset(base) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/envandle/path_reference.rb', line 15

def to_executable_argset(base)
  args = base.dup
  args.clear_reference
  args.args[0] = @name
  args.options[:path] = @path
  Argset.new(:gem, *args.args_and_options)
end