9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/ordlite/cache.rb', line 9
def import_all
paths = _find_meta
puts " #{paths.size} inscribe metaddatafile(s) found"
paths.each_with_index do |path, i|
data = _read_inscribe( path )
id = data['id']
rec = Inscribe.find_by( id: id )
if rec
print '.'
else
print " #{id}" rec = Inscribe.create_from_cache( data )
end
end
puts
paths = _find_blobs
puts " #{paths.size} inscribe blob(s) found"
paths.each_with_index do |path, i|
content = read_blob( path )
id = File.basename( File.dirname(path)) +
File.basename( path, File.extname( path ))
rec = Blob.find_by( id: id )
if rec
print '.'
else
print " #{id}" rec = Blob.create( id: id,
content: content )
end
end
puts
end
|