openils-mapper 0.9.8 → 0.9.9
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.
- data/lib/edi/edi2json.rb +2 -7
- data/lib/edi/mapper.rb +2 -7
- data/lib/openils/mapper.rb +1 -1
- metadata +9 -9
data/lib/edi/edi2json.rb
CHANGED
@@ -1,9 +1,4 @@
|
|
1
|
-
|
2
|
-
require 'json/pure'
|
3
|
-
rescue LoadError
|
4
|
-
warn "WARNING: json-pure not found. Trying json."
|
5
|
-
require 'json'
|
6
|
-
end
|
1
|
+
require 'yajl'
|
7
2
|
|
8
3
|
module EDI
|
9
4
|
|
@@ -64,7 +59,7 @@ class Collection
|
|
64
59
|
end
|
65
60
|
|
66
61
|
def to_json(*a)
|
67
|
-
self.to_hash
|
62
|
+
Yajl::Encoder.encode(self.to_hash, *a)
|
68
63
|
end
|
69
64
|
|
70
65
|
end
|
data/lib/edi/mapper.rb
CHANGED
@@ -6,12 +6,7 @@ begin
|
|
6
6
|
rescue LoadError
|
7
7
|
warn "WARNING: edi4r-tdid not found. Only EDIFACT versions d96a and d01b will be supported!"
|
8
8
|
end
|
9
|
-
|
10
|
-
require 'json/pure'
|
11
|
-
rescue LoadError
|
12
|
-
warn "WARNING: json-pure not found. Trying json."
|
13
|
-
require 'json'
|
14
|
-
end
|
9
|
+
require 'yajl'
|
15
10
|
|
16
11
|
class String
|
17
12
|
|
@@ -103,7 +98,7 @@ module EDI::E
|
|
103
98
|
end
|
104
99
|
|
105
100
|
def self.from_json(json, ic_opts = {})
|
106
|
-
struct =
|
101
|
+
struct = Yajl::Parser.parse(json)
|
107
102
|
|
108
103
|
json_opts = {}
|
109
104
|
[:sender,:recipient].each { |party|
|
data/lib/openils/mapper.rb
CHANGED
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:
|
4
|
+
hash: 41
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 9
|
10
|
+
version: 0.9.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael B. Klein
|
@@ -51,19 +51,19 @@ dependencies:
|
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
|
-
name:
|
54
|
+
name: yajl-ruby
|
55
55
|
prerelease: false
|
56
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
61
|
+
hash: 13
|
62
62
|
segments:
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
66
|
-
version:
|
63
|
+
- 0
|
64
|
+
- 7
|
65
|
+
- 7
|
66
|
+
version: 0.7.7
|
67
67
|
type: :runtime
|
68
68
|
version_requirements: *id003
|
69
69
|
- !ruby/object:Gem::Dependency
|