Class: AbideDevUtils::Ppt::CodeIntrospection::Manifest

Inherits:
Object
  • Object
show all
Defined in:
lib/abide_dev_utils/ppt/code_introspection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(manifest_file) ⇒ Manifest

Returns a new instance of Manifest.

Raises:

  • (ArgumentError)


12
13
14
15
16
# File 'lib/abide_dev_utils/ppt/code_introspection.rb', line 12

def initialize(manifest_file)
  @compiler = Puppet::Pal::Compiler.new(nil)
  @manifest_file = File.expand_path(manifest_file)
  raise ArgumentError, "File #{@manifest_file} is not a file" unless File.file?(@manifest_file)
end

Instance Attribute Details

#manifest_fileObject (readonly)

Returns the value of attribute manifest_file.



10
11
12
# File 'lib/abide_dev_utils/ppt/code_introspection.rb', line 10

def manifest_file
  @manifest_file
end

Instance Method Details

#astObject



18
19
20
# File 'lib/abide_dev_utils/ppt/code_introspection.rb', line 18

def ast
  @ast ||= non_validating_parse_file(manifest_file)
end

#declarationObject



22
23
24
# File 'lib/abide_dev_utils/ppt/code_introspection.rb', line 22

def declaration
  @declaration ||= Declaration.new(ast)
end