Class: PuppetGenerator::Importers::File

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_generator/importers/file.rb

Instance Method Summary collapse

Instance Method Details

#read(filename) ⇒ Object



5
6
7
8
9
# File 'lib/puppet_generator/importers/file.rb', line 5

def read(filename)
  ::File.open(filename).readlines.collect { |l| l.chomp }
rescue Exception => e
  raise Exceptions::FileDoesNotExist, e.message
end

#reads_from?(source) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/puppet_generator/importers/file.rb', line 11

def reads_from?(source)
  FileTest.file? source
end