geo_works 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0533a41de0604673a4376d3597656459ecbbaf9
|
4
|
+
data.tar.gz: 4c0f1211b8313e5c5531d37152ce9332b9b2e50d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32233c2443c74edd7eece43f1558a399fb4444527cf7df4bac7658b0ea877257a1beb22807d10328ac54b8b672628d77472b5a7ee28174837aa6e3628fa85e5b
|
7
|
+
data.tar.gz: 37fe03c153f448b27fb28522eb98d92ffb5eea0b44e4d90b13120efcbb34510478408ca8976a9ce33582454a8f27c4f3a7ff79f825629caa1a670686f9c43d0d
|
data/.rubocop.yml
CHANGED
@@ -15,17 +15,25 @@ module GeoWorks
|
|
15
15
|
# @param out_path [String] processor output file path
|
16
16
|
# @param method_queue [Array] set of commands to run
|
17
17
|
# @param options [Hash] creation options to pass
|
18
|
+
# rubocop:disable Metrics/MethodLength
|
18
19
|
def self.run_commands(in_path, out_path, method_queue, options)
|
19
20
|
next_step = method_queue.shift
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
temp = temp_path(out_path)
|
22
|
+
begin
|
23
|
+
if method_queue.empty?
|
24
|
+
method(next_step).call(in_path, out_path, options)
|
25
|
+
else
|
26
|
+
method(next_step).call(in_path, temp, options)
|
27
|
+
run_commands(temp, out_path, method_queue, options)
|
28
|
+
FileUtils.rm_rf(temp)
|
29
|
+
end
|
30
|
+
rescue => e
|
31
|
+
FileUtils.rm_rf(in_path) if Dir.exist?(in_path)
|
32
|
+
FileUtils.rm_rf(temp) if Dir.exist?(temp)
|
33
|
+
raise e
|
27
34
|
end
|
28
35
|
end
|
36
|
+
# rubocop:enable Metrics/MethodLength
|
29
37
|
|
30
38
|
# Returns a path to an intermediate temp file or directory.
|
31
39
|
# @param path [String] input file path to base temp path on
|
@@ -12,7 +12,6 @@ module GeoWorks
|
|
12
12
|
# @param out_path [String] processor output file path.
|
13
13
|
# @param options [Hash] creation options
|
14
14
|
# @option options [String] `:output_size` as "w h" or "wxh"
|
15
|
-
# rubocop:disable Metrics/MethodLength
|
16
15
|
def self.convert(in_path, out_path, options)
|
17
16
|
size = options[:output_size].tr(' ', 'x')
|
18
17
|
convert = MiniMagick::Tool::Convert.new(whiny: false)
|
@@ -30,7 +29,6 @@ module GeoWorks
|
|
30
29
|
# suppress stderr b/c geotiffs return 'unknown field' warnings
|
31
30
|
convert.call { |_stdout, _stderr| }
|
32
31
|
end
|
33
|
-
# rubocop:enable Metrics/MethodLength
|
34
32
|
|
35
33
|
# Trims extra whitespace.
|
36
34
|
# @param in_path [String] file input path
|
data/lib/geo_works/version.rb
CHANGED
@@ -36,6 +36,18 @@ describe GeoWorks::Processors::BaseGeoProcessor do
|
|
36
36
|
expect(FileUtils).to receive(:rm_rf).twice
|
37
37
|
subject.class.run_commands(file_name, output_file, method_queue, options)
|
38
38
|
end
|
39
|
+
|
40
|
+
context 'when the processor raises an error' do
|
41
|
+
before do
|
42
|
+
allow(method_queue).to receive(:empty?).and_raise('error')
|
43
|
+
allow(Dir).to receive(:exist?).and_return(true)
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'cleans the derivative intermediates' do
|
47
|
+
expect(FileUtils).to receive(:rm_rf).twice
|
48
|
+
expect { subject.class.run_commands(file_name, output_file, method_queue, options) }.to raise_error
|
49
|
+
end
|
50
|
+
end
|
39
51
|
end
|
40
52
|
|
41
53
|
describe '#temp_path' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geo_works
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Griffin
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2017-06
|
15
|
+
date: 2017-09-06 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: hyrax
|
@@ -689,7 +689,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
689
689
|
version: '0'
|
690
690
|
requirements: []
|
691
691
|
rubyforge_project:
|
692
|
-
rubygems_version: 2.
|
692
|
+
rubygems_version: 2.6.13
|
693
693
|
signing_key:
|
694
694
|
specification_version: 4
|
695
695
|
summary: Rails engine for Hydra Geo models. Built around the Hyrax engine.
|