openils-mapper 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/openils/mapper.rb +7 -4
  2. metadata +4 -4
@@ -3,7 +3,7 @@ require 'edi/mapper'
3
3
  module OpenILS
4
4
 
5
5
  class Mapper < EDI::E::Mapper
6
- VERSION = '0.9.5'
6
+ VERSION = '0.9.6'
7
7
  end
8
8
 
9
9
  end
@@ -69,9 +69,12 @@ OpenILS::Mapper.map 'item' do |mapper,key,value|
69
69
  value['desc'].each { |desc| mapper.add('desc',desc) }
70
70
  mapper.add('QTY', { 'C186' => { '6060' => value['quantity'] } })
71
71
  if value.has_key?('free-text')
72
- chunked_text = value['free-text'].chunk_and_group(512,5)
73
- chunked_text.each { |data|
74
- mapper.add('FTX', { '4451' => 'LIN', 'C108' => { '4440' => data } })
72
+ freetexts = value['free-text'].is_a?(Enumerable) ? value['free-text'] : [value['free-text']]
73
+ freetexts.each { |ftx|
74
+ chunked_text = ftx.chunk_and_group(512,5)
75
+ chunked_text.each { |data|
76
+ mapper.add('FTX', { '4451' => 'LIN', 'C108' => { '4440' => data } })
77
+ }
75
78
  }
76
79
  end
77
80
  mapper.add('PRI', { 'C509' => { '5118' => value['price'] } })
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: 49
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 5
10
- version: 0.9.5
9
+ - 6
10
+ version: 0.9.6
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-08-23 00:00:00 -07:00
18
+ date: 2010-09-01 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency