oddb2xml 2.1.1 → 2.1.2

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
  SHA1:
3
- metadata.gz: ec7329a09ad1bb1583d274d1d482e453eef3c37f
4
- data.tar.gz: 181017c8c0b5508cf2e8951ae9c90184d9cfcf4f
3
+ metadata.gz: fcd2bcecb959ae01393d121cc9df70f8f6edacea
4
+ data.tar.gz: c7c703884fd6a15a85482e121f9bb754f7798b2e
5
5
  SHA512:
6
- metadata.gz: 7d818fe51aedc2c48e90d081fe21c620e5c311446a0e6c7a9cd62654272f41a0d6ad9df27f13e9beb3bb3ea70569f0957080fb97f9670646e49b4abefad2f8c0
7
- data.tar.gz: f1d1a4eccc9ee8c35e3f1d5f42b0d4ec3fd9f089e194ab2b0e7c7bc644b21898a71dd606d4fafb578ebd9125cd159002ab195375dc7804c9e81aff82e243aa79
6
+ metadata.gz: 29158f982e6bb02096eaad7c05fb1928338df4d7aef0db02336baca454486d661c062caf4e15338cf0ee8ddb559d9886255999dd0b87a44da068d551bb372720
7
+ data.tar.gz: b55dcb60e96a34f0c8bd8911fb27b20d035d2299c4fe2d2f4ad1eed042fcadeabeb646934c49af8db8516d184c95392dedb4d2c577db56060430699e39465774
@@ -1,3 +1,7 @@
1
+ === 2.1.2 / 13.05.2015
2
+
3
+ * Fix parslet_spec.rb
4
+
1
5
  === 2.1.1 / 13.05.2015
2
6
 
3
7
  * --calc classifies now all E-xxx nutritional additions
@@ -190,19 +190,17 @@ class CompositionTransformer < Parslet::Transform
190
190
  info[:more_info] or
191
191
  CompositionTransformer.get_ratio(dictionary)
192
192
  CompositionTransformer.add_excipiens(info)
193
+ info
193
194
  end
194
195
  nil
195
196
  }
196
197
  rule(:composition => subtree(:composition),
197
198
  ) {
198
199
  |dictionary|
199
- puts "#{File.basename(__FILE__)}:#{__LINE__}: dictionary #{dictionary}" if VERBOSE_MESSAGES
200
+ puts "#{File.basename(__FILE__)}:#{__LINE__}: dictionary #{dictionary}" if VERBOSE_MESSAGES
200
201
  info = dictionary[:composition].is_a?(Hash) ? dictionary[:composition] : dictionary[:composition].first
201
- if info.is_a?(Hash)
202
- CompositionTransformer.add_excipiens(info)
203
- else
204
- info
205
- end
202
+ CompositionTransformer.add_excipiens(info) if info.is_a?(Hash)
203
+ info
206
204
  }
207
205
  rule(:substance => simple(:substance),
208
206
  :chemical_substance => simple(:chemical_substance),
@@ -453,7 +451,6 @@ class GalenicFormTransformer < CompositionTransformer
453
451
  ) {
454
452
  |dictionary|
455
453
  puts "#{File.basename(__FILE__)}:#{__LINE__}: dictionary #{dictionary}" if VERBOSE_MESSAGES
456
- binding.pry
457
454
  name = dictionary[:preparation_name] ? dictionary[:preparation_name].to_s : nil
458
455
  form = dictionary[:galenic_form] ? dictionary[:galenic_form].to_s : nil
459
456
  # name, form
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
@@ -26,7 +26,7 @@ to_add = %(
26
26
 
27
27
  context "should handle failed" do
28
28
  strings = [
29
- ]
29
+ ]
30
30
  strings.each{ |string|
31
31
  composition = ParseComposition.from_string(string)
32
32
  binding.pry if composition.substances.size == 0
@@ -196,10 +196,10 @@ describe ParseComposition do
196
196
  end
197
197
 
198
198
  context 'find unit for aqua q.s. ad emulsionem pro 250 ml' do
199
- string = "q.s. ad emulsionem pro 250 ml."
199
+ string = "natrii oleas, aqua q.s. ad emulsionem pro 250 ml."
200
200
  composition = ParseComposition.from_string(string)
201
201
  specify { expect(composition.source).to eq string}
202
- specify { expect(composition.substances.size).to eq 0}
202
+ specify { expect(composition.substances.size).to eq 1}
203
203
  specify { expect( composition.excipiens.dose.to_s).to eq "250 ml" }
204
204
  specify { expect( composition.excipiens.name).to match /emulsionem/i }
205
205
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oddb2xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuhiro Asaka, Zeno R.R. Davatz