openils-mapper 0.9.7 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,9 @@
1
- require 'json'
1
+ begin
2
+ require 'json/pure'
3
+ rescue LoadError
4
+ warn "WARNING: json-pure not found. Trying json."
5
+ require 'json'
6
+ end
2
7
 
3
8
  module EDI
4
9
 
@@ -1,3 +1,4 @@
1
+ require 'forwardable'
1
2
  require 'edi4r'
2
3
  require 'edi4r/edifact'
3
4
  begin
@@ -5,8 +6,12 @@ begin
5
6
  rescue LoadError
6
7
  warn "WARNING: edi4r-tdid not found. Only EDIFACT versions d96a and d01b will be supported!"
7
8
  end
8
- require 'forwardable'
9
- require 'json'
9
+ begin
10
+ require 'json/pure'
11
+ rescue LoadError
12
+ warn "WARNING: json-pure not found. Trying json."
13
+ require 'json'
14
+ end
10
15
 
11
16
  class String
12
17
 
@@ -3,7 +3,7 @@ require 'edi/mapper'
3
3
  module OpenILS
4
4
 
5
5
  class Mapper < EDI::E::Mapper
6
- VERSION = '0.9.7'
6
+ VERSION = '0.9.8'
7
7
  end
8
8
 
9
9
  end
@@ -114,7 +114,7 @@ describe EDI::E::Mapper do
114
114
  }
115
115
  # Can't compare everything because of timestamping, so we'll just compare
116
116
  # the bodies for a high degree of confidence
117
- interchange.to_hash['body'].should == [{"ORDERS"=>[["UNH", {"S009"=>{"0052"=>"D", "0054"=>"96A", "0065"=>"ORDERS", "0051"=>"UN"}, "0062"=>"1"}], ["BGM", {"1225"=>"9", "C002"=>{"1001"=>"220"}, "1004"=>"2"}], ["DTM", {"C507"=>{"2379"=>"102", "2380"=>"20090331", "2005"=>"137"}}], ["NAD", {"3035"=>"BY", "SG2"=>[["RFF", {"C506"=>{"1153"=>"API", "1154"=>"3472205 0001"}}]], "C082"=>{"3039"=>"3472205", "3055"=>"91"}}], ["NAD", {"3035"=>"BY", "SG2"=>[["RFF", {"C506"=>{"1153"=>"API", "1154"=>"3472205 0001"}}]], "C082"=>{"3039"=>"3472205", "3055"=>"31B"}}], ["NAD", {"3035"=>"SU", "C082"=>{"3039"=>"1556150", "3055"=>"31B"}}], ["NAD", {"3035"=>"SU", "SG2"=>[["RFF", {"C506"=>{"1153"=>"IA", "1154"=>"1865"}}]], "C082"=>{"3039"=>"1556150", "3055"=>"91"}}], ["CUX", {"C504"=>[{"6345"=>"USD", "6347"=>"2", "6343"=>"9"}]}], ["LIN", {"SG25"=>[["PIA", {"4347"=>"5", "C212"=>[{"7140"=>"03-0010837", "7143"=>"SA"}]}], ["IMD", {"C273"=>{"7008"=>["Discernment"]}, "7077"=>"F", "7081"=>"BTI"}], ["IMD", {"C273"=>{"7008"=>["Concord Records,"]}, "7077"=>"F", "7081"=>"BPU"}], ["IMD", {"C273"=>{"7008"=>["1986."]}, "7077"=>"F", "7081"=>"BPD"}], ["IMD", {"C273"=>{"7008"=>["1 sound disc :"]}, "7077"=>"F", "7081"=>"BPH"}], ["QTY", {"C186"=>{"6060"=>2, "6063"=>"21"}}], ["PRI", {"C509"=>{"5125"=>"AAB", "5118"=>35.95}}], ["RFF", {"C506"=>{"1153"=>"LI", "1154"=>"2/1"}}]], "1082"=>1}], ["LIN", {"SG25"=>[["PIA", {"4347"=>"5", "C212"=>[{"7140"=>"03-0010840", "7143"=>"SA"}]}], ["IMD", {"C273"=>{"7008"=>["The inner source"]}, "7077"=>"F", "7081"=>"BTI"}], ["IMD", {"C273"=>{"7008"=>["Duke, George, 1946-"]}, "7077"=>"F", "7081"=>"BAU"}], ["IMD", {"C273"=>{"7008"=>["MPS Records,"]}, "7077"=>"F", "7081"=>"BPU"}], ["IMD", {"C273"=>{"7008"=>["1973."]}, "7077"=>"F", "7081"=>"BPD"}], ["IMD", {"C273"=>{"7008"=>["2 sound discs :"]}, "7077"=>"F", "7081"=>"BPH"}], ["QTY", {"C186"=>{"6060"=>1, "6063"=>"21"}}], ["PRI", {"C509"=>{"5125"=>"AAB", "5118"=>28.95}}], ["RFF", {"C506"=>{"1153"=>"LI", "1154"=>"2/2"}}]], "1082"=>2}], ["UNS", {"0081"=>"S"}], ["CNT", {"C270"=>{"6069"=>"2", "6066"=>2}}], ["UNT", {"0074"=>33, "0062"=>"1"}]]}]
117
+ interchange.to_hash['body'].should == [{"ORDERS"=>[["UNH", {"S009"=>{"0052"=>"D", "0054"=>"96A", "0065"=>"ORDERS", "0051"=>"UN"}, "0062"=>"1"}], ["BGM", {"1225"=>"9", "C002"=>{"1001"=>"220"}, "1004"=>"2"}], ["DTM", {"C507"=>{"2379"=>"102", "2380"=>"20090331", "2005"=>"137"}}], ["SG2", [["NAD", {"3035"=>"BY", "C082"=>{"3039"=>"3472205", "3055"=>"91"}}], ["SG3", [["RFF", {"C506"=>{"1153"=>"API", "1154"=>"3472205 0001"}}]]]]], ["SG2", [["NAD", {"3035"=>"BY", "C082"=>{"3039"=>"3472205", "3055"=>"31B"}}], ["SG3", [["RFF", {"C506"=>{"1153"=>"API", "1154"=>"3472205 0001"}}]]]]], ["SG2", [["NAD", {"3035"=>"SU", "C082"=>{"3039"=>"1556150", "3055"=>"31B"}}]]], ["SG2", [["NAD", {"3035"=>"SU", "C082"=>{"3039"=>"1556150", "3055"=>"91"}}], ["SG3", [["RFF", {"C506"=>{"1153"=>"IA", "1154"=>"1865"}}]]]]], ["SG7", [["CUX", {"C504"=>[{"6345"=>"USD", "6347"=>"2", "6343"=>"9"}]}]]], ["SG25", [["LIN", {"1082"=>1}], ["PIA", {"4347"=>"5", "C212"=>[{"7140"=>"03-0010837", "7143"=>"SA"}]}], ["IMD", {"C273"=>{"7008"=>["Discernment"]}, "7077"=>"F", "7081"=>"BTI"}], ["IMD", {"C273"=>{"7008"=>["Concord Records,"]}, "7077"=>"F", "7081"=>"BPU"}], ["IMD", {"C273"=>{"7008"=>["1986."]}, "7077"=>"F", "7081"=>"BPD"}], ["IMD", {"C273"=>{"7008"=>["1 sound disc :"]}, "7077"=>"F", "7081"=>"BPH"}], ["QTY", {"C186"=>{"6060"=>2, "6063"=>"21"}}], ["SG28", [["PRI", {"C509"=>{"5125"=>"AAB", "5118"=>35.95}}]]], ["SG29", [["RFF", {"C506"=>{"1153"=>"LI", "1154"=>"2/1"}}]]]]], ["SG25", [["LIN", {"1082"=>2}], ["PIA", {"4347"=>"5", "C212"=>[{"7140"=>"03-0010840", "7143"=>"SA"}]}], ["IMD", {"C273"=>{"7008"=>["The inner source"]}, "7077"=>"F", "7081"=>"BTI"}], ["IMD", {"C273"=>{"7008"=>["Duke, George, 1946-"]}, "7077"=>"F", "7081"=>"BAU"}], ["IMD", {"C273"=>{"7008"=>["MPS Records,"]}, "7077"=>"F", "7081"=>"BPU"}], ["IMD", {"C273"=>{"7008"=>["1973."]}, "7077"=>"F", "7081"=>"BPD"}], ["IMD", {"C273"=>{"7008"=>["2 sound discs :"]}, "7077"=>"F", "7081"=>"BPH"}], ["QTY", {"C186"=>{"6060"=>1, "6063"=>"21"}}], ["SG28", [["PRI", {"C509"=>{"5125"=>"AAB", "5118"=>28.95}}]]], ["SG29", [["RFF", {"C506"=>{"1153"=>"LI", "1154"=>"2/2"}}]]]]], ["UNS", {"0081"=>"S"}], ["CNT", {"C270"=>{"6069"=>"2", "6066"=>2}}], ["UNT", {"0074"=>33, "0062"=>"1"}]]}]
118
118
  end
119
119
 
120
120
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openils-mapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 43
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 7
10
- version: 0.9.7
9
+ - 8
10
+ version: 0.9.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael B. Klein
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-01 00:00:00 -07:00
18
+ date: 2010-09-21 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency