Class: KCommercial::Resources::FilesIndexesGenerator
Instance Attribute Summary
#asset_objects, #root_path
Instance Method Summary
collapse
#generate!, #initialize
Instance Method Details
#index_resources ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/KCommercialPipeline/core/resource/bundle/files_generator.rb', line 20
def index_resources
hash = super
asset_objects.each do |asset|
hash[asset.name] = asset.trait_rows.map do |row|
{
:traits => row.traits,
:resource => row.resource.basename.to_s
}
end
end
hash
end
|
#indexes_filename ⇒ Object
16
17
18
|
# File 'lib/KCommercialPipeline/core/resource/bundle/files_generator.rb', line 16
def indexes_filename
'files'
end
|
#write_files ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'lib/KCommercialPipeline/core/resource/bundle/files_generator.rb', line 7
def write_files
asset_objects.each do |asset|
asset.trait_rows.each do |row|
path = root_path.join(row.resource.basename)
FileUtils.cp row.resource, path
end
end
end
|