filentory-cli 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/support/env.rb +3 -1
- data/lib/filentory/collector.rb +2 -2
- data/lib/filentory/exifextractor.rb +10 -9
- data/lib/filentory/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 307312ea2dea8e660b841675965449e18e7ab48ed12b312069b5c76b7d055b43
|
4
|
+
data.tar.gz: 6c3021db554c8faca87162b65fce934e191635517beddbd5a85a77c17122e72d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56061f79eb77d0ece58324bd5e355c89cbd47d0ce4a57446b0fb436b7be5f52d637c20a2ce763eb90b1224bbfed959b7500f2aa313b82fba0b8168402ea4aad4
|
7
|
+
data.tar.gz: a7fea9405eaa995eaa838ab692fc985363a707aaef2dffa4c037d3f2594588cc074e6a51e6a33a1ad7b74358c096fc87e820077bef4eef618c41edbfc38bf042
|
data/features/support/env.rb
CHANGED
@@ -4,7 +4,9 @@ require 'methadone/cucumber'
|
|
4
4
|
require 'json_spec/cucumber'
|
5
5
|
|
6
6
|
PROJECT_ROOT = File.join(File.dirname(__FILE__),'..','..')
|
7
|
+
#puts PROJECT_ROOT
|
7
8
|
ENV['PATH'] = "#{File.join(PROJECT_ROOT,'bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
|
9
|
+
#puts ENV['PATH']
|
8
10
|
ARUBA_DIR = File.join(%w(tmp aruba))
|
9
11
|
Before do
|
10
12
|
@dirs = [ARUBA_DIR]
|
@@ -25,4 +27,4 @@ After do
|
|
25
27
|
# Put back how it was
|
26
28
|
ENV['RUBYLIB'] = @original_rubylib
|
27
29
|
ENV['RUBYOPT'] = @original_rubyopt
|
28
|
-
end
|
30
|
+
end
|
data/lib/filentory/collector.rb
CHANGED
@@ -22,7 +22,7 @@ class Collector
|
|
22
22
|
end
|
23
23
|
result << extract_file_infos(file)
|
24
24
|
rescue => file_error
|
25
|
-
error ("error with file '#{path}': #{file}")
|
25
|
+
error ("error with file '#{path}': #{file} => #{file_error}")
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -67,4 +67,4 @@ class Collector
|
|
67
67
|
end
|
68
68
|
|
69
69
|
end
|
70
|
-
end
|
70
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
|
-
require 'exifr'
|
1
|
+
require 'exifr/jpeg'
|
2
2
|
require 'xmp'
|
3
|
+
require 'methadone'
|
3
4
|
|
4
|
-
class ExifExtractor
|
5
|
+
class ExifExtractor include Methadone::CLILogging
|
5
6
|
|
6
7
|
# Extracts the metadata of a file at a given path in the file system.
|
7
8
|
def metadata_for_file(file_path)
|
@@ -32,8 +33,8 @@ class ExifExtractor
|
|
32
33
|
namespace = xmp.send(namespace_name)
|
33
34
|
extract_namespace_attributes(namespace_name, namespace, xmpValues)
|
34
35
|
end
|
35
|
-
rescue =>
|
36
|
-
#
|
36
|
+
rescue => error_message
|
37
|
+
error ("#{error_message}")
|
37
38
|
end
|
38
39
|
|
39
40
|
def extract_namespace_attributes(namespace_name, namespace, xmpValues)
|
@@ -43,8 +44,8 @@ class ExifExtractor
|
|
43
44
|
#puts "returnval: #{returnval}"
|
44
45
|
answer = returnval.scrub("*")
|
45
46
|
xmpValues["#{namespace_name}.#{attr}"] = answer.strip.to_s[0...250]
|
46
|
-
rescue =>
|
47
|
-
|
47
|
+
rescue => error_message
|
48
|
+
error ("#{error_message}")
|
48
49
|
end
|
49
50
|
end
|
50
51
|
end
|
@@ -57,8 +58,8 @@ class ExifExtractor
|
|
57
58
|
xmpValues["exif.date_time_original"] = format_date(img.date_time_original)
|
58
59
|
xmpValues["exif.width"] = img.width
|
59
60
|
xmpValues["exif.height"] = img.height
|
60
|
-
rescue =>
|
61
|
-
|
61
|
+
rescue => error_message
|
62
|
+
error ("#{error_message}")
|
62
63
|
end
|
63
64
|
|
64
65
|
def cleanup_metadata(value)
|
@@ -90,4 +91,4 @@ class ExifExtractor
|
|
90
91
|
rescue
|
91
92
|
nil
|
92
93
|
end
|
93
|
-
end
|
94
|
+
end
|
data/lib/filentory/version.rb
CHANGED