drugbank 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 498584a7fea48511118bfef0220a5a11647ee5b3
4
+ data.tar.gz: 742693ef51557a848c104d5240329fa7ded6c6fd
5
+ SHA512:
6
+ metadata.gz: 006c63468224ce33e695838208a83684aee7dc7bad71c91aef348feeea14de47fdda1e56a5041dfde500afd2efe378a84f275635053e13c5aae709a44ec104c9
7
+ data.tar.gz: a8da25d0bab2e77c4bec347b58375ab843f8182b982b77f5f946e7fc993982f79327875525a42fc8488933707a372eaca4836a9b2c5e3cc5360dcb4996942d47
@@ -4,8 +4,8 @@ module Drugbank
4
4
  include SaxStream::Mapper
5
5
 
6
6
  node 'drug-interaction'
7
- map :interaction_drug_id, :to => 'drug'
7
+ map :interaction_drug_id, :to => 'drugbank-id'
8
8
  map :name, :to => 'name'
9
9
  map :description, :to => 'description'
10
10
  end
11
- end
11
+ end
@@ -4,7 +4,7 @@ require 'drugbank/drug'
4
4
  module Drugbank
5
5
  class Drugs < Drugbank::Base
6
6
  include SaxStream::Mapper
7
- node 'drugs', :collect => false
7
+ node 'drugbank', :collect => false
8
8
 
9
9
  relate :drugs, :to => 'drug', :as => [Drugbank::Drug]
10
10
  end
@@ -32,7 +32,7 @@ module Drugbank
32
32
  collector.collect_batch
33
33
  end
34
34
 
35
- private
35
+ private
36
36
  def set_collector_block(block)
37
37
  collector.block = block
38
38
  end
@@ -63,11 +63,12 @@ module Drugbank
63
63
  zip_file.close()
64
64
  end
65
65
  #unzip the file first
66
- Zip::ZipInputStream::open(file_name) do |io|
66
+ Zip::ZipInputStream::open(file_name) do |io|
67
67
  while (entry = io.get_next_entry)
68
68
  if entry.name.split(/\./).last == 'xml'
69
69
  unziped_file = Tempfile.new(Digest::MD5.hexdigest(entry.name))
70
70
  add_file_for_cleanup(unziped_file)
71
+ unziped_file.binmode
71
72
  unziped_file.write(io.read)
72
73
  unziped_file.close()
73
74
  return open(unziped_file.path)
@@ -79,4 +80,4 @@ module Drugbank
79
80
  end
80
81
  end
81
82
  end
82
- end
83
+ end
@@ -1,3 +1,3 @@
1
1
  module Drugbank
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drugbank
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Eric Harrison
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-06 00:00:00.000000000 Z
11
+ date: 2014-09-19 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: sax_stream
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - '='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - '='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rubyzip
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - '='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - '='
44
39
  - !ruby/object:Gem::Version
@@ -82,26 +77,25 @@ files:
82
77
  homepage: http://github.com/smashtank/drugbank
83
78
  licenses:
84
79
  - MIT
80
+ metadata: {}
85
81
  post_install_message:
86
82
  rdoc_options: []
87
83
  require_paths:
88
84
  - lib
89
85
  required_ruby_version: !ruby/object:Gem::Requirement
90
- none: false
91
86
  requirements:
92
- - - ! '>='
87
+ - - '>='
93
88
  - !ruby/object:Gem::Version
94
89
  version: '0'
95
90
  required_rubygems_version: !ruby/object:Gem::Requirement
96
- none: false
97
91
  requirements:
98
- - - ! '>='
92
+ - - '>='
99
93
  - !ruby/object:Gem::Version
100
94
  version: '0'
101
95
  requirements: []
102
96
  rubyforge_project:
103
- rubygems_version: 1.8.23
97
+ rubygems_version: 2.2.2
104
98
  signing_key:
105
- specification_version: 3
99
+ specification_version: 4
106
100
  summary: Importer for Drugbank.ca
107
101
  test_files: []