filentory-cli 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -7
- data/Gemfile.lock +56 -42
- data/features/step_definitions/filentory-cli_steps.rb +1 -1
- data/filentory-cli.gemspec +5 -3
- data/filentory.yaml.template +4 -0
- data/lib/filentory/exifextractor.rb +23 -6
- data/lib/filentory/version.rb +1 -1
- data/results.html +1 -1
- data/test/integration/special/.gitignore +1 -0
- data/test/integration/special/exif.jpg +0 -0
- data/test/tc_logging.rb +45 -0
- data/test/tc_special_cases.rb +45 -0
- metadata +34 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8f9a1009ee774281cd518697359ce73b90af49b
|
4
|
+
data.tar.gz: ea7368238fb810c1d1f63b48adbc489eed3b4829
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 768e1102552618c60f91c7642cd84d396615c751f600b6b57961d3aed77da19efaddf793bf77c9d9815edead20697618b3636452b2e69c3aea75df7db33aac13
|
7
|
+
data.tar.gz: 20b651a104470a1f881dc15c783518430eb3fce2f5210ce0c06324df975131041254c5238411ec34af6caa184128f7378073125ba3d34556b7693bec463fd128
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
filentory-cli (0.
|
4
|
+
filentory-cli (0.5.0)
|
5
5
|
exifr (~> 1.2.0)
|
6
6
|
json_spec (~> 1.1.1)
|
7
7
|
methadone (~> 1.7)
|
@@ -13,62 +13,72 @@ PATH
|
|
13
13
|
GEM
|
14
14
|
remote: https://rubygems.org/
|
15
15
|
specs:
|
16
|
-
aruba (0.
|
17
|
-
childprocess (
|
18
|
-
|
19
|
-
|
16
|
+
aruba (0.11.2)
|
17
|
+
childprocess (~> 0.5.6)
|
18
|
+
contracts (~> 0.9)
|
19
|
+
cucumber (>= 1.3.19)
|
20
|
+
event-bus (~> 0.2)
|
21
|
+
ffi (~> 1.9.10)
|
22
|
+
rspec-expectations (>= 2.99)
|
23
|
+
thor (~> 0.19)
|
20
24
|
builder (3.2.2)
|
21
|
-
childprocess (0.5.
|
25
|
+
childprocess (0.5.8)
|
22
26
|
ffi (~> 1.0, >= 1.0.11)
|
23
|
-
|
27
|
+
contracts (0.12.0)
|
28
|
+
cucumber (2.1.0)
|
24
29
|
builder (>= 2.1.2)
|
30
|
+
cucumber-core (~> 1.3.0)
|
25
31
|
diff-lcs (>= 1.1.3)
|
26
|
-
|
32
|
+
gherkin3 (~> 3.1.0)
|
27
33
|
multi_json (>= 1.7.5, < 2.0)
|
28
|
-
multi_test (>= 0.1.
|
34
|
+
multi_test (>= 0.1.2)
|
35
|
+
cucumber-core (1.3.0)
|
36
|
+
gherkin3 (~> 3.1.0)
|
29
37
|
diff-lcs (1.2.5)
|
30
38
|
docile (1.1.5)
|
31
|
-
|
39
|
+
event-bus (0.2.1)
|
40
|
+
exifr (1.2.3.1)
|
32
41
|
fakeweb (1.3.0)
|
33
|
-
ffi (1.9.
|
34
|
-
|
35
|
-
|
36
|
-
json (1.8.1)
|
42
|
+
ffi (1.9.10)
|
43
|
+
gherkin3 (3.1.2)
|
44
|
+
json (1.8.3)
|
37
45
|
json_spec (1.1.4)
|
38
46
|
multi_json (~> 1.0)
|
39
47
|
rspec (>= 2.0, < 4.0)
|
40
|
-
methadone (1.
|
48
|
+
methadone (1.9.2)
|
41
49
|
bundler
|
42
|
-
minitest (5.
|
43
|
-
|
44
|
-
|
50
|
+
minitest (5.8.3)
|
51
|
+
mkfifo (0.1.1)
|
52
|
+
multi_json (1.11.2)
|
53
|
+
multi_test (0.1.2)
|
45
54
|
nokogiri (1.5.11)
|
46
|
-
oj (2.
|
47
|
-
rack (1.
|
48
|
-
rack-test (0.6.
|
55
|
+
oj (2.14.0)
|
56
|
+
rack (1.6.4)
|
57
|
+
rack-test (0.6.3)
|
49
58
|
rack (>= 1.0)
|
50
|
-
rake (10.
|
51
|
-
rdoc (4.
|
52
|
-
|
53
|
-
|
54
|
-
rspec-
|
55
|
-
rspec-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
rspec-expectations (3.1.2)
|
59
|
+
rake (10.4.2)
|
60
|
+
rdoc (4.2.0)
|
61
|
+
rspec (3.4.0)
|
62
|
+
rspec-core (~> 3.4.0)
|
63
|
+
rspec-expectations (~> 3.4.0)
|
64
|
+
rspec-mocks (~> 3.4.0)
|
65
|
+
rspec-core (3.4.1)
|
66
|
+
rspec-support (~> 3.4.0)
|
67
|
+
rspec-expectations (3.4.0)
|
60
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
61
|
-
rspec-support (~> 3.
|
62
|
-
rspec-mocks (3.
|
63
|
-
|
64
|
-
|
65
|
-
|
69
|
+
rspec-support (~> 3.4.0)
|
70
|
+
rspec-mocks (3.4.0)
|
71
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
72
|
+
rspec-support (~> 3.4.0)
|
73
|
+
rspec-support (3.4.1)
|
74
|
+
simplecov (0.10.0)
|
66
75
|
docile (~> 1.1.0)
|
67
|
-
|
68
|
-
simplecov-html (~> 0.
|
69
|
-
simplecov-html (0.
|
76
|
+
json (~> 1.8)
|
77
|
+
simplecov-html (~> 0.10.0)
|
78
|
+
simplecov-html (0.10.0)
|
70
79
|
streamio-ffmpeg (1.0.0)
|
71
80
|
string-scrub (0.0.5)
|
81
|
+
thor (0.19.1)
|
72
82
|
xmp (0.2.0)
|
73
83
|
nokogiri (~> 1.5.0)
|
74
84
|
|
@@ -80,8 +90,12 @@ DEPENDENCIES
|
|
80
90
|
fakeweb (~> 1.3)
|
81
91
|
filentory-cli!
|
82
92
|
minitest
|
83
|
-
|
84
|
-
rack
|
93
|
+
mkfifo
|
94
|
+
rack (~> 1.6.1)
|
95
|
+
rack-test (~> 0.6)
|
85
96
|
rake (~> 10.3)
|
86
97
|
rdoc
|
87
|
-
simplecov (~> 0.
|
98
|
+
simplecov (~> 0.10.0)
|
99
|
+
|
100
|
+
BUNDLED WITH
|
101
|
+
1.10.6
|
@@ -34,7 +34,7 @@ end
|
|
34
34
|
Then(/^the image file should have metadata$/) do
|
35
35
|
steps %Q{
|
36
36
|
And the JSON at "files/0/2/metadata" should be a hash
|
37
|
-
And the JSON at "files/0/2/metadata" should have
|
37
|
+
And the JSON at "files/0/2/metadata" should have 7 entries
|
38
38
|
And the JSON at "files/0/2/metadata/exif.artist" should be "Johnny Graber"
|
39
39
|
And the JSON at "files/0/2/metadata/exif.date_time" should be "2013-11-02T18:10:43+00:00"
|
40
40
|
}
|
data/filentory-cli.gemspec
CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |gem|
|
|
11
11
|
gem.description = "A tool to create an inventory of a storage medium"
|
12
12
|
gem.summary = "Filentory-cli is a first step to get order in a chaotic collection of storage medias."
|
13
13
|
gem.homepage = "https://github.com/jgraber/filentory-cli"
|
14
|
+
gem.license = 'Apache License, Version 2.0'
|
14
15
|
|
15
16
|
gem.files = `git ls-files`.split($/)
|
16
17
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
@@ -20,9 +21,10 @@ Gem::Specification.new do |gem|
|
|
20
21
|
gem.add_development_dependency('aruba')
|
21
22
|
gem.add_development_dependency('rake', '~> 10.3')
|
22
23
|
gem.add_development_dependency('fakeweb', '~> 1.3')
|
23
|
-
gem.add_development_dependency('rack', '~>1.
|
24
|
-
gem.add_development_dependency('rack-test', '~> 0.6
|
24
|
+
gem.add_development_dependency('rack', '~>1.6.1')
|
25
|
+
gem.add_development_dependency('rack-test', '~> 0.6')
|
25
26
|
gem.add_development_dependency('minitest')
|
27
|
+
gem.add_development_dependency('mkfifo')
|
26
28
|
gem.add_dependency('methadone', '~> 1.7')
|
27
29
|
gem.add_dependency('oj', '~> 2.11')
|
28
30
|
gem.add_dependency('json_spec', '~> 1.1.1')
|
@@ -30,5 +32,5 @@ Gem::Specification.new do |gem|
|
|
30
32
|
gem.add_dependency('xmp', '~> 0.2.0')
|
31
33
|
gem.add_dependency('streamio-ffmpeg', '~> 1.0.0')
|
32
34
|
gem.add_dependency('string-scrub')
|
33
|
-
gem.add_development_dependency('simplecov', '~> 0.
|
35
|
+
gem.add_development_dependency('simplecov', '~> 0.10.0')
|
34
36
|
end
|
@@ -36,7 +36,7 @@ class ExifExtractor
|
|
36
36
|
returnval = namespace.send(attr)#.inspect
|
37
37
|
#puts "returnval: #{returnval}"
|
38
38
|
answer = returnval.scrub("*")
|
39
|
-
xmpValues["#{namespace_name}.#{attr}"] = answer.strip.to_s[0
|
39
|
+
xmpValues["#{namespace_name}.#{attr}"] = answer.strip.to_s[0...250]
|
40
40
|
rescue => error
|
41
41
|
#puts error
|
42
42
|
end
|
@@ -47,8 +47,9 @@ class ExifExtractor
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def extract_exif_main_meta_data(img, xmpValues)
|
50
|
-
xmpValues["exif.model"] =
|
51
|
-
xmpValues["exif.
|
50
|
+
xmpValues["exif.model"] = cleanup_description(img.model)
|
51
|
+
xmpValues["exif.make"] = cleanup_description(img.make)
|
52
|
+
xmpValues["exif.artist"] = cleanup_description(img.artist)
|
52
53
|
xmpValues["exif.date_time"] = format_date(img.date_time)
|
53
54
|
xmpValues["exif.date_time_original"] = format_date(img.date_time_original)
|
54
55
|
xmpValues["exif.width"] = img.width
|
@@ -57,12 +58,28 @@ class ExifExtractor
|
|
57
58
|
#puts error
|
58
59
|
end
|
59
60
|
|
61
|
+
def cleanup_metadata(value)
|
62
|
+
value.scrub("*").strip unless value.nil?
|
63
|
+
end
|
64
|
+
|
65
|
+
def cleanup_description(value)
|
66
|
+
cleanup_metadata(value.force_encoding('UTF-8')).to_s[0...250] unless value.nil?
|
67
|
+
end
|
60
68
|
|
61
69
|
def extract_gps_infos(img, xmpValues)
|
62
70
|
if img.gps
|
63
|
-
|
64
|
-
|
65
|
-
|
71
|
+
|
72
|
+
if !img.gps.latitude.nil? && !img.gps.latitude.nan? then
|
73
|
+
xmpValues["exif.gps.latitude"] = img.gps.latitude
|
74
|
+
end
|
75
|
+
|
76
|
+
if !img.gps.longitude.nil? && !img.gps.longitude.nan? then
|
77
|
+
xmpValues["exif.gps.longitude"] = img.gps.longitude
|
78
|
+
end
|
79
|
+
|
80
|
+
if !img.gps.altitude.nil? && !img.gps.altitude.nan? then
|
81
|
+
xmpValues["exif.gps.altitude"] = img.gps.altitude
|
82
|
+
end
|
66
83
|
end
|
67
84
|
end
|
68
85
|
|
data/lib/filentory/version.rb
CHANGED
data/results.html
CHANGED
@@ -469,4 +469,4 @@ e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["
|
|
469
469
|
$('#'+element_id).css('color', '#000000');
|
470
470
|
}
|
471
471
|
|
472
|
-
</script></head><body><!-- Step count 23--><div class="cucumber"><div id="cucumber-header"><div id="label"><h1>Cucumber Features</h1></div><div id="summary"><p id="totals"></p><p id="duration"></p><div id="expand-collapse"><p id="expander">Expand All</p><p id="collapser">Collapse All</p></div></div></div><div class="feature"><h2><span class="val">Feature: Filentory-cli works</span></h2><p class="narrative"></p><div class='scenario'><span class="scenario_file">features/filentory-cli.feature:3</span><h3 id="scenario_1"><span class="keyword">Scenario:</span> <span class="val">App just runs</span></h3><ol><li id='features_filentory-cli_feature_4' class='step passed'><div class="step_name"><span class="keyword">When </span><span class="step val">I get help for "<span class="param">filentory-cli</span>"</span></div><div class="step_file"><span>methadone-1.8.0/lib/methadone/cucumber.rb:58</span></div></li> <script type="text/javascript">moveProgressBar('4.3');</script><li id='features_filentory-cli_feature_5' class='step passed'><div class="step_name"><span class="keyword">Then </span><span class="step val">the exit status should be <span class="param">0</span></span></div><div class="step_file"><span>aruba-0.6.1/lib/aruba/cucumber.rb:197</span></div></li> <script type="text/javascript">moveProgressBar('8.6');</script><li id='features_filentory-cli_feature_6' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the banner should be present</span></div><div class="step_file"><span>methadone-1.8.0/lib/methadone/cucumber.rb:78</span></div></li> <script type="text/javascript">moveProgressBar('13.0');</script><li id='features_filentory-cli_feature_7' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">there should be a one line summary of what the app does</span></div><div class="step_file"><span>methadone-1.8.0/lib/methadone/cucumber.rb:109</span></div></li> <script type="text/javascript">moveProgressBar('17.3');</script><li id='features_filentory-cli_feature_8' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the banner should document that this app takes options</span></div><div class="step_file"><span>methadone-1.8.0/lib/methadone/cucumber.rb:82</span></div></li> <script type="text/javascript">moveProgressBar('21.7');</script><li id='features_filentory-cli_feature_9' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the following options should be documented:</span></div><div class="step_file"><span>methadone-1.8.0/lib/methadone/cucumber.rb:63</span></div><table><tr class='step' id='row_-1'><td class="step" id="row_-1_0"><div><span class="step param">--version</span></div></td></tr> <script type="text/javascript">moveProgressBar('30.4');</script><tr class='step' id='row_-1'><td class="step" id="row_-1_0"><div><span class="step param">--type</span></div></td></tr> <script type="text/javascript">moveProgressBar('34.7');</script><tr class='step' id='row_-1'><td class="step" id="row_-1_0"><div><span class="step param">--auth</span></div></td></tr> <script type="text/javascript">moveProgressBar('39.1');</script></table></li> <script type="text/javascript">moveProgressBar('39.1');</script><li id='features_filentory-cli_feature_13' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the banner should document that this app's arguments are:</span></div><div class="step_file"><span>methadone-1.8.0/lib/methadone/cucumber.rb:87</span></div><table><tr class='step' id='row_-1'><td class="step" id="row_-1_0"><div><span class="step param">name</span></div></td><td class="step" id="row_-1_1"><div><span class="step param"></span></div></td></tr> <script type="text/javascript">moveProgressBar('47.8');</script><tr class='step' id='row_-1'><td class="step" id="row_-1_0"><div><span class="step param">path</span></div></td><td class="step" id="row_-1_1"><div><span class="step param"></span></div></td></tr> <script type="text/javascript">moveProgressBar('52.1');</script><tr class='step' id='row_-1'><td class="step" id="row_-1_0"><div><span class="step param">server</span></div></td><td class="step" id="row_-1_1"><div><span class="step param">optional</span></div></td></tr> <script type="text/javascript">moveProgressBar('56.5');</script></table></li> <script type="text/javascript">moveProgressBar('56.5');</script></ol></div><div class='scenario'><span class="scenario_file">features/filentory-cli.feature:18</span><h3 id="scenario_2"><span class="keyword">Scenario:</span> <span class="val">App prints JSON</span></h3><ol><li id='features_filentory-cli_feature_19' class='step passed'><div class="step_name"><span class="keyword">When </span><span class="step val">I run "<span class="param">filentory-cli</span>" for the test data</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:2</span></div></li> <script type="text/javascript">moveProgressBar('60.8');</script><li id='features_filentory-cli_feature_20' class='step passed'><div class="step_name"><span class="keyword">Then </span><span class="step val">I should get JSON as output</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:6</span></div></li> <script type="text/javascript">moveProgressBar('65.2');</script><li id='features_filentory-cli_feature_21' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the "<span class="param">name</span>" should be "<span class="param">testrun</span>"</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:12</span></div></li> <script type="text/javascript">moveProgressBar('69.5');</script><li id='features_filentory-cli_feature_22' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the "<span class="param">mediatype</span>" should be "<span class="param">DVD</span>"</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:12</span></div></li> <script type="text/javascript">moveProgressBar('73.9');</script><li id='features_filentory-cli_feature_23' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">there should be <span class="param">4</span> entries in "<span class="param">files</span>"</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:16</span></div></li> <script type="text/javascript">moveProgressBar('78.2');</script><li id='features_filentory-cli_feature_24' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the first file should be placed in the root folder</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:20</span></div></li> <script type="text/javascript">moveProgressBar('82.6');</script><li id='features_filentory-cli_feature_25' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the second file should be in the "<span class="param">folder</span>"</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:27</span></div></li> <script type="text/javascript">moveProgressBar('86.9');</script><li id='features_filentory-cli_feature_26' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the image file should have metadata</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:34</span></div></li> <script type="text/javascript">moveProgressBar('91.3');</script><li id='features_filentory-cli_feature_27' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the video file should have metadata</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:43</span></div></li> <script type="text/javascript">moveProgressBar('95.6');</script></ol></div><div class='scenario'><span class="scenario_file">features/filentory-cli.feature:29</span><h3 id="scenario_3"><span class="keyword">Scenario:</span> <span class="val">Sending data to server</span></h3><ol><li id='features_filentory-cli_feature_30' class='step passed'><div class="step_name"><span class="keyword">When </span><span class="step val">I run "<span class="param">filentory-cli</span>" with a server parameter</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:51</span></div></li> <script type="text/javascript">moveProgressBar('100.0');</script><li id='features_filentory-cli_feature_31' class='step passed'><div class="step_name"><span class="keyword">Then </span><span class="step val">I should get a message that the data was send successfully</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:55</span></div></li> <script type="text/javascript">moveProgressBar('104.3');</script></ol></div><div class='scenario'><span class="scenario_file">features/filentory-cli.feature:33</span><h3 id="scenario_4"><span class="keyword">Scenario:</span> <span class="val">YAML file present while sending data to server</span></h3><ol><li id='features_filentory-cli_feature_34' class='step passed'><div class="step_name"><span class="keyword">When </span><span class="step val">I run "<span class="param">filentory-cli</span>" with a server parameter and a yaml file</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:67</span></div></li> <script type="text/javascript">moveProgressBar('108.6');</script><li id='features_filentory-cli_feature_35' class='step passed'><div class="step_name"><span class="keyword">Then </span><span class="step val">I should get a message that the data was send successfully</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:55</span></div></li> <script type="text/javascript">moveProgressBar('113.0');</script><li id='features_filentory-cli_feature_36' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">I should get a message that "<span class="param">mykey</span>" was send with the JSON data</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:71</span></div></li> <script type="text/javascript">moveProgressBar('117.3');</script></ol></div><div class='scenario'><span class="scenario_file">features/filentory-cli.feature:38</span><h3 id="scenario_5"><span class="keyword">Scenario:</span> <span class="val">Server does not exist</span></h3><ol><li id='features_filentory-cli_feature_39' class='step passed'><div class="step_name"><span class="keyword">When </span><span class="step val">I run "<span class="param">filentory-cli</span>" with the wrong server parameter</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:59</span></div></li> <script type="text/javascript">moveProgressBar('121.7');</script><li id='features_filentory-cli_feature_40' class='step passed'><div class="step_name"><span class="keyword">Then </span><span class="step val">I should get a message that the data could not be sent</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:63</span></div></li> <script type="text/javascript">moveProgressBar('126.0');</script></ol></div></div><script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>0m0.855s seconds</strong>";</script><script type="text/javascript">document.getElementById('totals').innerHTML = "5 scenarios (5 passed)<br />23 steps (23 passed)";</script></div></body></html>
|
472
|
+
</script></head><body><!-- Step count 23--><div class="cucumber"><div id="cucumber-header"><div id="label"><h1>Cucumber Features</h1></div><div id="summary"><p id="totals"></p><p id="duration"></p><div id="expand-collapse"><p id="expander">Expand All</p><p id="collapser">Collapse All</p></div></div></div><div class="feature"><h2><span class="val">Feature: Filentory-cli works</span></h2><p class="narrative"></p><div class='scenario'><span class="scenario_file">features/filentory-cli.feature:3</span><h3 id="scenario_1"><span class="keyword">Scenario:</span> <span class="val">App just runs</span></h3><ol><li id='features_filentory-cli_feature_4' class='step passed'><div class="step_name"><span class="keyword">When </span><span class="step val">I get help for "<span class="param">filentory-cli</span>"</span></div><div class="step_file"><span>methadone-1.8.0/lib/methadone/cucumber.rb:58</span></div></li> <script type="text/javascript">moveProgressBar('4.3');</script><li id='features_filentory-cli_feature_5' class='step passed'><div class="step_name"><span class="keyword">Then </span><span class="step val">the exit status should be <span class="param">0</span></span></div><div class="step_file"><span>aruba-0.6.1/lib/aruba/cucumber.rb:197</span></div></li> <script type="text/javascript">moveProgressBar('8.6');</script><li id='features_filentory-cli_feature_6' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the banner should be present</span></div><div class="step_file"><span>methadone-1.8.0/lib/methadone/cucumber.rb:78</span></div></li> <script type="text/javascript">moveProgressBar('13.0');</script><li id='features_filentory-cli_feature_7' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">there should be a one line summary of what the app does</span></div><div class="step_file"><span>methadone-1.8.0/lib/methadone/cucumber.rb:109</span></div></li> <script type="text/javascript">moveProgressBar('17.3');</script><li id='features_filentory-cli_feature_8' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the banner should document that this app takes options</span></div><div class="step_file"><span>methadone-1.8.0/lib/methadone/cucumber.rb:82</span></div></li> <script type="text/javascript">moveProgressBar('21.7');</script><li id='features_filentory-cli_feature_9' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the following options should be documented:</span></div><div class="step_file"><span>methadone-1.8.0/lib/methadone/cucumber.rb:63</span></div><table><tr class='step' id='row_-1'><td class="step" id="row_-1_0"><div><span class="step param">--version</span></div></td></tr> <script type="text/javascript">moveProgressBar('30.4');</script><tr class='step' id='row_-1'><td class="step" id="row_-1_0"><div><span class="step param">--type</span></div></td></tr> <script type="text/javascript">moveProgressBar('34.7');</script><tr class='step' id='row_-1'><td class="step" id="row_-1_0"><div><span class="step param">--auth</span></div></td></tr> <script type="text/javascript">moveProgressBar('39.1');</script></table></li> <script type="text/javascript">moveProgressBar('39.1');</script><li id='features_filentory-cli_feature_13' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the banner should document that this app's arguments are:</span></div><div class="step_file"><span>methadone-1.8.0/lib/methadone/cucumber.rb:87</span></div><table><tr class='step' id='row_-1'><td class="step" id="row_-1_0"><div><span class="step param">name</span></div></td><td class="step" id="row_-1_1"><div><span class="step param"></span></div></td></tr> <script type="text/javascript">moveProgressBar('47.8');</script><tr class='step' id='row_-1'><td class="step" id="row_-1_0"><div><span class="step param">path</span></div></td><td class="step" id="row_-1_1"><div><span class="step param"></span></div></td></tr> <script type="text/javascript">moveProgressBar('52.1');</script><tr class='step' id='row_-1'><td class="step" id="row_-1_0"><div><span class="step param">server</span></div></td><td class="step" id="row_-1_1"><div><span class="step param">optional</span></div></td></tr> <script type="text/javascript">moveProgressBar('56.5');</script></table></li> <script type="text/javascript">moveProgressBar('56.5');</script></ol></div><div class='scenario'><span class="scenario_file">features/filentory-cli.feature:18</span><h3 id="scenario_2"><span class="keyword">Scenario:</span> <span class="val">App prints JSON</span></h3><ol><li id='features_filentory-cli_feature_19' class='step passed'><div class="step_name"><span class="keyword">When </span><span class="step val">I run "<span class="param">filentory-cli</span>" for the test data</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:2</span></div></li> <script type="text/javascript">moveProgressBar('60.8');</script><li id='features_filentory-cli_feature_20' class='step passed'><div class="step_name"><span class="keyword">Then </span><span class="step val">I should get JSON as output</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:6</span></div></li> <script type="text/javascript">moveProgressBar('65.2');</script><li id='features_filentory-cli_feature_21' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the "<span class="param">name</span>" should be "<span class="param">testrun</span>"</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:12</span></div></li> <script type="text/javascript">moveProgressBar('69.5');</script><li id='features_filentory-cli_feature_22' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the "<span class="param">mediatype</span>" should be "<span class="param">DVD</span>"</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:12</span></div></li> <script type="text/javascript">moveProgressBar('73.9');</script><li id='features_filentory-cli_feature_23' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">there should be <span class="param">4</span> entries in "<span class="param">files</span>"</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:16</span></div></li> <script type="text/javascript">moveProgressBar('78.2');</script><li id='features_filentory-cli_feature_24' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the first file should be placed in the root folder</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:20</span></div></li> <script type="text/javascript">moveProgressBar('82.6');</script><li id='features_filentory-cli_feature_25' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the second file should be in the "<span class="param">folder</span>"</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:27</span></div></li> <script type="text/javascript">moveProgressBar('86.9');</script><li id='features_filentory-cli_feature_26' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the image file should have metadata</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:34</span></div></li> <script type="text/javascript">moveProgressBar('91.3');</script><li id='features_filentory-cli_feature_27' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">the video file should have metadata</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:43</span></div></li> <script type="text/javascript">moveProgressBar('95.6');</script></ol></div><div class='scenario'><span class="scenario_file">features/filentory-cli.feature:29</span><h3 id="scenario_3"><span class="keyword">Scenario:</span> <span class="val">Sending data to server</span></h3><ol><li id='features_filentory-cli_feature_30' class='step passed'><div class="step_name"><span class="keyword">When </span><span class="step val">I run "<span class="param">filentory-cli</span>" with a server parameter</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:51</span></div></li> <script type="text/javascript">moveProgressBar('100.0');</script><li id='features_filentory-cli_feature_31' class='step passed'><div class="step_name"><span class="keyword">Then </span><span class="step val">I should get a message that the data was send successfully</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:55</span></div></li> <script type="text/javascript">moveProgressBar('104.3');</script></ol></div><div class='scenario'><span class="scenario_file">features/filentory-cli.feature:33</span><h3 id="scenario_4"><span class="keyword">Scenario:</span> <span class="val">YAML file present while sending data to server</span></h3><ol><li id='features_filentory-cli_feature_34' class='step passed'><div class="step_name"><span class="keyword">When </span><span class="step val">I run "<span class="param">filentory-cli</span>" with a server parameter and a yaml file</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:67</span></div></li> <script type="text/javascript">moveProgressBar('108.6');</script><li id='features_filentory-cli_feature_35' class='step passed'><div class="step_name"><span class="keyword">Then </span><span class="step val">I should get a message that the data was send successfully</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:55</span></div></li> <script type="text/javascript">moveProgressBar('113.0');</script><li id='features_filentory-cli_feature_36' class='step passed'><div class="step_name"><span class="keyword">And </span><span class="step val">I should get a message that "<span class="param">mykey</span>" was send with the JSON data</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:71</span></div></li> <script type="text/javascript">moveProgressBar('117.3');</script></ol></div><div class='scenario'><span class="scenario_file">features/filentory-cli.feature:38</span><h3 id="scenario_5"><span class="keyword">Scenario:</span> <span class="val">Server does not exist</span></h3><ol><li id='features_filentory-cli_feature_39' class='step passed'><div class="step_name"><span class="keyword">When </span><span class="step val">I run "<span class="param">filentory-cli</span>" with the wrong server parameter</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:59</span></div></li> <script type="text/javascript">moveProgressBar('121.7');</script><li id='features_filentory-cli_feature_40' class='step passed'><div class="step_name"><span class="keyword">Then </span><span class="step val">I should get a message that the data could not be sent</span></div><div class="step_file"><span>features/step_definitions/filentory-cli_steps.rb:63</span></div></li> <script type="text/javascript">moveProgressBar('126.0');</script></ol></div></div><script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>0m0.852s seconds</strong>";</script><script type="text/javascript">document.getElementById('totals').innerHTML = "5 scenarios (5 passed)<br />23 steps (23 passed)";</script></div></body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
# for tests only
|
Binary file
|
data/test/tc_logging.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.expand_path '../test_helper.rb', __FILE__
|
2
|
+
require 'minitest/autorun'
|
3
|
+
require 'filentory/collector'
|
4
|
+
require 'filentory'
|
5
|
+
require 'mkfifo'
|
6
|
+
require 'methadone'
|
7
|
+
require 'stringio'
|
8
|
+
|
9
|
+
class TestLogging < Minitest::Test
|
10
|
+
def setup
|
11
|
+
@pipe_path = File.dirname(__FILE__)+"/integration/special/pipe"
|
12
|
+
@real_stderr = $stderr
|
13
|
+
@real_stdout = $stdout
|
14
|
+
$stderr = StringIO.new
|
15
|
+
$stderr.sync = true
|
16
|
+
$stdout = StringIO.new
|
17
|
+
$stdout.sync = true
|
18
|
+
end
|
19
|
+
|
20
|
+
def teardown
|
21
|
+
$stderr = @real_stderr
|
22
|
+
$stdout = @real_stdout
|
23
|
+
|
24
|
+
if(File.exist?(@pipe_path))
|
25
|
+
FileUtils.rm(@pipe_path)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_pipes_are_logged
|
30
|
+
File.mkfifo(@pipe_path) unless File.exist?(@pipe_path)
|
31
|
+
|
32
|
+
col = Collector.new
|
33
|
+
col.logger = Logger.new($stdout)
|
34
|
+
col.logger.level = Logger::DEBUG
|
35
|
+
result = col.collect(File.dirname(__FILE__)+"/integration/special/")
|
36
|
+
|
37
|
+
assert_equal(2, result.length)
|
38
|
+
|
39
|
+
#assert_equal(Logger::DEBUG, col.logger.level)
|
40
|
+
#puts "STDERR: #{$stderr.string}"
|
41
|
+
#puts "STDOUT: #{$stdout.string}"
|
42
|
+
assert_includes($stdout.string, "skippking pipe")
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.expand_path '../test_helper.rb', __FILE__
|
2
|
+
require 'minitest/autorun'
|
3
|
+
require 'filentory/collector'
|
4
|
+
require 'filentory'
|
5
|
+
require 'mkfifo'
|
6
|
+
|
7
|
+
class TestSpecialCases < Minitest::Test
|
8
|
+
|
9
|
+
def test_pipes_are_ignored
|
10
|
+
cleanup()
|
11
|
+
|
12
|
+
File.mkfifo(File.dirname(__FILE__)+"/integration/special/pipe")
|
13
|
+
|
14
|
+
col = Collector.new
|
15
|
+
result = col.collect(File.dirname(__FILE__)+"/integration/special/")
|
16
|
+
#puts "The result is: #{result}"
|
17
|
+
assert_equal(2, result.length)
|
18
|
+
assert_equal(".gitignore", result[0].name)
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_exif_fields_are_filled_up
|
22
|
+
col = Collector.new
|
23
|
+
result = col.collect(File.dirname(__FILE__)+"/integration/special/")
|
24
|
+
#puts "The result is: #{result}"
|
25
|
+
|
26
|
+
assert_equal(2, result.length)
|
27
|
+
assert_equal("exif.jpg", result[1].name)
|
28
|
+
assert_equal(250, result[1].metadata['exif.artist'].length)
|
29
|
+
assert_equal(250, result[1].metadata['dc.description'].length)
|
30
|
+
|
31
|
+
|
32
|
+
assert_equal("Cannon", result[1].metadata['exif.make'])
|
33
|
+
assert_equal("EOS 6D", result[1].metadata['exif.model'])
|
34
|
+
assert_equal("2015-01-06T21:58:08+00:00", result[1].metadata['exif.date_time'])
|
35
|
+
assert_equal("2015-01-06T09:11:18+00:00", result[1].metadata['exif.date_time_original'])
|
36
|
+
assert_equal("Ipsach, Switzerland", result[1].metadata['Iptc4xmpCore.Location'])
|
37
|
+
end
|
38
|
+
|
39
|
+
def cleanup
|
40
|
+
if(File.exist?(File.dirname(__FILE__)+"/integration/special/pipe"))
|
41
|
+
FileUtils.rm(File.dirname(__FILE__)+"/integration/special/pipe")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filentory-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johnny Graber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -72,28 +72,28 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: 1.6.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: 1.6.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rack-test
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.6
|
89
|
+
version: '0.6'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.6
|
96
|
+
version: '0.6'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: minitest
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: mkfifo
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: methadone
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,14 +226,14 @@ dependencies:
|
|
212
226
|
requirements:
|
213
227
|
- - "~>"
|
214
228
|
- !ruby/object:Gem::Version
|
215
|
-
version: 0.
|
229
|
+
version: 0.10.0
|
216
230
|
type: :development
|
217
231
|
prerelease: false
|
218
232
|
version_requirements: !ruby/object:Gem::Requirement
|
219
233
|
requirements:
|
220
234
|
- - "~>"
|
221
235
|
- !ruby/object:Gem::Version
|
222
|
-
version: 0.
|
236
|
+
version: 0.10.0
|
223
237
|
description: A tool to create an inventory of a storage medium
|
224
238
|
email:
|
225
239
|
- jg@jgraber.ch
|
@@ -245,6 +259,7 @@ files:
|
|
245
259
|
- features/support/demoserver.rb
|
246
260
|
- features/support/env.rb
|
247
261
|
- filentory-cli.gemspec
|
262
|
+
- filentory.yaml.template
|
248
263
|
- lib/filentory.rb
|
249
264
|
- lib/filentory/collector.rb
|
250
265
|
- lib/filentory/datastore.rb
|
@@ -258,16 +273,21 @@ files:
|
|
258
273
|
- test/integration/data/folder/fileB.txt
|
259
274
|
- test/integration/data/image_with_exif_and_xmp_infos.jpg
|
260
275
|
- test/integration/data/video.mov
|
276
|
+
- test/integration/special/.gitignore
|
277
|
+
- test/integration/special/exif.jpg
|
261
278
|
- test/tc_collector.rb
|
262
279
|
- test/tc_datastore.rb
|
263
280
|
- test/tc_exifextractor.rb
|
264
281
|
- test/tc_fileentry.rb
|
282
|
+
- test/tc_logging.rb
|
265
283
|
- test/tc_sender.rb
|
266
284
|
- test/tc_something.rb
|
285
|
+
- test/tc_special_cases.rb
|
267
286
|
- test/tc_videoextractor.rb
|
268
287
|
- test/test_helper.rb
|
269
288
|
homepage: https://github.com/jgraber/filentory-cli
|
270
|
-
licenses:
|
289
|
+
licenses:
|
290
|
+
- Apache License, Version 2.0
|
271
291
|
metadata: {}
|
272
292
|
post_install_message:
|
273
293
|
rdoc_options: []
|
@@ -285,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
305
|
version: '0'
|
286
306
|
requirements: []
|
287
307
|
rubyforge_project:
|
288
|
-
rubygems_version: 2.
|
308
|
+
rubygems_version: 2.4.5.1
|
289
309
|
signing_key:
|
290
310
|
specification_version: 4
|
291
311
|
summary: Filentory-cli is a first step to get order in a chaotic collection of storage
|
@@ -301,11 +321,15 @@ test_files:
|
|
301
321
|
- test/integration/data/folder/fileB.txt
|
302
322
|
- test/integration/data/image_with_exif_and_xmp_infos.jpg
|
303
323
|
- test/integration/data/video.mov
|
324
|
+
- test/integration/special/.gitignore
|
325
|
+
- test/integration/special/exif.jpg
|
304
326
|
- test/tc_collector.rb
|
305
327
|
- test/tc_datastore.rb
|
306
328
|
- test/tc_exifextractor.rb
|
307
329
|
- test/tc_fileentry.rb
|
330
|
+
- test/tc_logging.rb
|
308
331
|
- test/tc_sender.rb
|
309
332
|
- test/tc_something.rb
|
333
|
+
- test/tc_special_cases.rb
|
310
334
|
- test/tc_videoextractor.rb
|
311
335
|
- test/test_helper.rb
|