Class: Inspec::Targets::FlatDir

Inherits:
Object
  • Object
show all
Defined in:
lib/inspec/targets/dir.rb

Instance Method Summary collapse

Instance Method Details

#get_filenames(paths) ⇒ Object



137
138
139
140
141
# File 'lib/inspec/targets/dir.rb', line 137

def get_filenames(paths)
  # TODO: eventually remove the metadata.rb exception here
  # when we have fully phased out metadata.rb in 1.0
  paths.find_all { |x| x.end_with?('.rb') && !x.include?('/') && x != 'metadata.rb' }
end

#handles?(paths) ⇒ Boolean

Returns:

  • (Boolean)


133
134
135
# File 'lib/inspec/targets/dir.rb', line 133

def handles?(paths)
  get_filenames(paths).empty? == false
end