-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
30 lines (27 loc) · 850 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'rake'
require 'csv'
require 'ruby-progressbar'
require_relative 'lib/item_fetcher'
require_relative 'lib/item_converter'
desc 'fetch files for public objects'
task :fetch do
items = CSV.parse(File.read('_data/items.csv'), headers: true)
progress = ProgressBar.create(title: 'fetch', total: items.length, format: '%t %a |%b>>%i| %e %p%%')
items.each do |row|
progress.increment
ItemFetcher.fetch(row['druid'])
end
end
desc 'convert obj files to gltf'
task :convert do
items = CSV.parse(File.read('_data/items.csv'), headers: true)
progress = ProgressBar.create(title: 'convert', total: items.length, format: '%t %a |%b>>%i| %e %p%%')
items.each do |row|
progress.increment
ItemConverter.convert(row['druid'])
end
end
desc 'build JavaScript bundle'
task :build do
system('./node_modules/.bin/webpack')
end