Method: Atom::Tools#dir_to_entries

Defined in:
lib/atom/tools.rb

#dir_to_entries(path) ⇒ Object

parse a directory of entries

Raises:

  • (ArgumentError)


20
21
22
23
24
25
26
# File 'lib/atom/tools.rb', line 20

def dir_to_entries path
  raise ArgumentError, "#{path} is not a directory" unless File.directory? path

  Dir[path+'/*.atom'].map do |e|
    Atom::Entry.parse(File.read(e))
  end
end