Class: Verto::DSL::Interpreter

Inherits:
Object
  • Object
show all
Includes:
Syntax
Defined in:
lib/verto/dsl/interpreter.rb

Constant Summary collapse

Error =

TODO: Wrap stacktrace

Class.new(Verto::ExitError)

Instance Method Summary collapse

Methods included from Syntax

#after, #after_command, #after_command_tag_up, #before, #before_command, #before_command_tag_up, #before_tag_creation, #branch, #command_options, #config, #confirm, #context, #current_branch, #env, #error, #error!, #file, #git, #git!, #latest_pre_release_version, #latest_release_version, #latest_version, #on, #sh, #sh!, #update_changelog, #verto_version

Instance Method Details

#evaluate(vertofile_content = nil, attributes: {}, &block) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/verto/dsl/interpreter.rb', line 11

def evaluate(vertofile_content = nil, attributes: {}, &block)
  with_attributes(attributes) do
    vertofile_content ? instance_eval(vertofile_content) : instance_eval(&block)
  end
rescue StandardError => e
  raise e if e.is_a?(Verto::ExitError)

  raise Error, e.message
end