oddb2xml 2.7.3 → 2.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/lib/oddb2xml/downloader.rb +2 -0
- data/lib/oddb2xml/version.rb +1 -1
- data/oddb2xml.gemspec +1 -1
- data/spec/downloader_spec.rb +6 -2
- data/spec/spec_helper.rb +0 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af1cbeb37bf057e98955776c87dd5092fc5706af18d00ba818efccd2c52a076e
|
4
|
+
data.tar.gz: 1f4faf8f73b2cffa14bd3dda23dad4e401b524587c0f95d80e0cc9cbd4ba5d2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ace048c855b3711fd6b75692373318fe992a5c6529d322c13b516a7bd09390e36efec3f14edaa91ddeb223438d74c97c15ba4691077e9c77ce5063a10bdcc423
|
7
|
+
data.tar.gz: 9dcf787039edc02a56b7301f6849e76259628ac55da598a2878e4a08c63fd3c3aaef35bfea6bda8184c6e3552314fba7bb028962d81151ca98bf76f830c3303f
|
data/History.txt
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
=== 2.7.4 / 30.03.2021
|
2
|
+
* Update needed Ruby-Version to 2.5.0 in gemspec
|
3
|
+
* Ensure downloads directory is created at first run
|
4
|
+
|
1
5
|
=== 2.7.3 / 29.03.2021
|
2
6
|
* Do not delete swissmedic_package.xlsx and swissmedic_orphan.xlsx
|
3
7
|
* Save swissmedic_package.xlsx and swissmedic_orphan.xlsx under downloads
|
data/lib/oddb2xml/downloader.rb
CHANGED
@@ -16,6 +16,7 @@ module Oddb2xml
|
|
16
16
|
@file2save = File.join(DOWNLOADS, File.basename(file))
|
17
17
|
report_download(@url, @file2save)
|
18
18
|
data = nil
|
19
|
+
FileUtils.makedirs(File.dirname(file), verbose: true)
|
19
20
|
if Oddb2xml.skip_download(file)
|
20
21
|
io = File.open(file, option)
|
21
22
|
data = io.read
|
@@ -23,6 +24,7 @@ module Oddb2xml
|
|
23
24
|
begin
|
24
25
|
io = File.open(file, option)
|
25
26
|
data = Oddb2xml.uri_open(@url).read
|
27
|
+
io.sync = true
|
26
28
|
io.write(data)
|
27
29
|
rescue => error
|
28
30
|
puts "error #{error} while fetching #{@url}"
|
data/lib/oddb2xml/version.rb
CHANGED
data/oddb2xml.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ["lib"]
|
18
|
-
spec.required_ruby_version = ">= 2.
|
18
|
+
spec.required_ruby_version = ">= 2.5.0"
|
19
19
|
|
20
20
|
# We fix the version of the spec to newer versions only in the third position
|
21
21
|
# hoping that these version fix only security/severe bugs
|
data/spec/downloader_spec.rb
CHANGED
@@ -256,6 +256,7 @@ describe Oddb2xml::SwissmedicDownloader do
|
|
256
256
|
end
|
257
257
|
VCR.eject_cassette
|
258
258
|
VCR.insert_cassette("oddb2xml", tag: :swissmedic, exclusive: false)
|
259
|
+
FileUtils.rm_rf(Oddb2xml::DOWNLOADS, verbose: true)
|
259
260
|
common_before
|
260
261
|
@downloader = Oddb2xml::SwissmedicDownloader.new(:orphan)
|
261
262
|
end
|
@@ -276,9 +277,12 @@ describe Oddb2xml::SwissmedicDownloader do
|
|
276
277
|
expect { bin }.not_to raise_error
|
277
278
|
expect(File.exist?("oddb_orphan.xls")).to eq(false)
|
278
279
|
end
|
280
|
+
expect(File.dirname(bin)).to be == (Oddb2xml::DOWNLOADS)
|
281
|
+
expect(File.exist?(bin)).to eq(true)
|
279
282
|
end
|
280
|
-
it "should
|
281
|
-
expect(File.exist?(
|
283
|
+
it "should save into the download directory" do
|
284
|
+
expect(File.exist?(bin)).to eq(true)
|
285
|
+
expect(File.exist?(File.join(Oddb2xml::DOWNLOADS, "swissmedic_orphan.xlsx"))).to eq(true)
|
282
286
|
end
|
283
287
|
end
|
284
288
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -164,7 +164,6 @@ module ServerMockHelper
|
|
164
164
|
def cleanup_directories_before_run
|
165
165
|
dirs = [Oddb2xml::DOWNLOADS, Oddb2xml::WORK_DIR]
|
166
166
|
dirs.each { |dir| FileUtils.rm_rf(Dir.glob(File.join(dir, "*")), verbose: false) }
|
167
|
-
dirs.each { |dir| FileUtils.makedirs(dir, verbose: false) }
|
168
167
|
cleanup_compressor
|
169
168
|
mock_downloads
|
170
169
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oddb2xml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yasuhiro Asaka, Zeno R.R. Davatz, Niklaus Giger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -522,7 +522,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
522
522
|
requirements:
|
523
523
|
- - ">="
|
524
524
|
- !ruby/object:Gem::Version
|
525
|
-
version: 2.
|
525
|
+
version: 2.5.0
|
526
526
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
527
527
|
requirements:
|
528
528
|
- - ">="
|