7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/eighty/source.rb', line 7
def self.load_dir(source)
source = File.expand_path(source)
files = Dir.glob("#{source}/**/*").select { |f| File.file?(f) }
files.each do |file|
item = Item.new
item.content = File.read(file)
item.source_path = Pathname.new(file).relative_path_from(source).to_s
item.source_absolute_path = file
item.source_base = source
item.extname = File.extname(file)
item.path = item.source_path
Eighty.metadata.items.push(item)
end
end
|