Class: Bricolage::SrcFileParam

Inherits:
Param
  • Object
show all
Defined in:
lib/bricolage/parameters.rb

Instance Attribute Summary

Attributes inherited from Param

#arg_spec, #description, #name

Instance Method Summary collapse

Methods inherited from Param

#have_arg?, #inspect, #option_name, #optional?, #parse_option_value, #parse_value, #publish?, #required?

Constructor Details

#initialize(name = 'src-file', arg_spec = 'PATH', description = 'Source file name.', optional: false, publish: false) ⇒ SrcFileParam

Returns a new instance of SrcFileParam.



588
589
590
591
# File 'lib/bricolage/parameters.rb', line 588

def initialize(name = 'src-file', arg_spec = 'PATH', description = 'Source file name.',
    optional: false, publish: false)
  super name, arg_spec, description, optional: optional, publish: publish
end

Instance Method Details

#default_value(ctx, vars) ⇒ Object



593
594
595
# File 'lib/bricolage/parameters.rb', line 593

def default_value(ctx, vars)
  nil
end

#materialize(path, ctx, vars) ⇒ Object



597
598
599
# File 'lib/bricolage/parameters.rb', line 597

def materialize(path, ctx, vars)
  Pathname(expand(path, vars))
end

#variables(path) ⇒ Object



601
602
603
# File 'lib/bricolage/parameters.rb', line 601

def variables(path)
  wrap_variable_value(path.to_s)
end