oddb2xml 2.7.3 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dc59cd0f8ed09f2416f4ba77030ab3549618c3cbe90b3e0496e91808e51fa95
4
- data.tar.gz: 3fdbf0803a5b92b4b3af6950c0021db33ade825de3bb768ca34c54c90e0e659a
3
+ metadata.gz: af1cbeb37bf057e98955776c87dd5092fc5706af18d00ba818efccd2c52a076e
4
+ data.tar.gz: 1f4faf8f73b2cffa14bd3dda23dad4e401b524587c0f95d80e0cc9cbd4ba5d2b
5
5
  SHA512:
6
- metadata.gz: b742461c737d8409d8a6f79eba36d4a3d87458e6f211086ff8c828264d76b5c6b3216cdb9b8ce216c3bbb3caa3a38dae2a430e9dd97faa624e8c3b15ceb0a749
7
- data.tar.gz: 1b825d705594c244f34a9ff4df06e158f8fd63ebabd1bdf7c760ea52a50b816d8781eacd5b0627df394a39de62dc3572afd07261358df66e6d6f0b7cfa0846bf
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
@@ -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}"
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "2.7.3"
2
+ VERSION = "2.7.4"
3
3
  end
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.2.0"
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
@@ -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 not save into the download directory" do
281
- expect(File.exist?(File.join(Oddb2xml::DOWNLOADS, "oddb_orphan.xls"))).to eq(false)
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.3
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-29 00:00:00.000000000 Z
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.2.0
525
+ version: 2.5.0
526
526
  required_rubygems_version: !ruby/object:Gem::Requirement
527
527
  requirements:
528
528
  - - ">="