marc 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -25,6 +25,9 @@ USAGE
25
25
  writer = MARC::XMLWriter.new('marc.xml')
26
26
  writer.write(record)
27
27
  writer.close()
28
+
29
+ # encoding a record
30
+ MARC::Writer.encode(record) # or record.to_marc
28
31
 
29
32
  INSTALLATION
30
33
 
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- RUBY_MARC_VERSION = '0.4.2'
1
+ RUBY_MARC_VERSION = '0.4.3'
2
2
 
3
3
  require 'rubygems'
4
4
  require 'rake'
@@ -116,7 +116,7 @@ module MARC
116
116
  offset = entry[7..11].to_i
117
117
  field_start = base_address + offset
118
118
  field_end = field_start + length - 1
119
- field_data = marc[field_start..field_end]
119
+ field_data = marc.bytes.to_a[field_start..field_end].pack("c*")
120
120
  end
121
121
 
122
122
  # remove end of field
@@ -0,0 +1 @@
1
+ 01378nam a22004091i 4500001001000000003000400010005001700014006001900031007001500050008004100065035002500106035002400131035002300155040001300178041001400191100003200205245009500237260003900332300002100371500002000392500004800412500011800460538003000578650006500608650004200673650004200715650004500757852003400802970001300836970002100849971000800870972001300878973001700891973001900908974002700927998001400954000039829MiU20011011000000.0m d cr bn ---auaua880715q19701979th 00010 chi  a(RLIN)MIUG16009126-B a(CaOTULAS)159860611 a(OCoLC)ocm65664201 aMiUcMiU0 achithaeng0 aČhamlō̜ng Phitsanākha.10aPhotčhanānukrom Čhin Klāng-TǣčhiuʻAngkrit-Thai /c[dōi Čhamlō̜ng Phitsanākha. aKrungthēp :bBantānsān,c197-?] a921 p. ;c19 cm. aIn Thai script. aAuthor's name and imprint from dust jacket. aEntries in Chinese characters with Mandarin and Swatow pronunciation in Thai script and English and Thai glosses. aMode of access: Internet. 0aChinese languagexDialectszChinazShantou (Guangdong Sheng) 0aChinese languagexDialectszThailand. 0aChinese languagexDictionariesxThai. 0aChinese languagexDictionariesxEnglish.0 aMiUbBUHRcGRADhPL 2127 .C42 aBKbBook aDIbDictionaries aMiU c20040625 aHTbavail_ht aACbavail_circ umdp.39015058645139ric cJKMs9114
@@ -30,6 +30,11 @@ class ReaderTest < Test::Unit::TestCase
30
30
  assert_equal('1', record['LOC']['9'])
31
31
  end
32
32
 
33
+ def test_unicode_load
34
+ reader = MARC::Reader.new('test/000039829.marc')
35
+ assert_nothing_raised { reader.first }
36
+ end
37
+
33
38
  def test_bad_marc
34
39
  reader = MARC::Reader.new('test/tc_reader.rb')
35
40
  assert_raises(MARC::Exception) {reader.entries[0]}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
5
- prerelease: false
4
+ hash: 9
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 2
10
- version: 0.4.2
9
+ - 3
10
+ version: 0.4.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kevin Clarke
@@ -19,8 +19,7 @@ autorequire: marc
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2011-05-03 00:00:00 -04:00
23
- default_executable:
22
+ date: 2011-06-01 00:00:00 Z
24
23
  dependencies: []
25
24
 
26
25
  description:
@@ -45,6 +44,7 @@ files:
45
44
  - lib/marc/xmlreader.rb
46
45
  - lib/marc/xmlwriter.rb
47
46
  - lib/marc.rb
47
+ - test/000039829.marc
48
48
  - test/batch.dat
49
49
  - test/batch.xml
50
50
  - test/no-leading-zero.xml
@@ -70,7 +70,6 @@ files:
70
70
  - README
71
71
  - Changes
72
72
  - LICENSE
73
- has_rdoc: true
74
73
  homepage: http://marc.rubyforge.org/
75
74
  licenses: []
76
75
 
@@ -102,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
101
  requirements: []
103
102
 
104
103
  rubyforge_project:
105
- rubygems_version: 1.3.7
104
+ rubygems_version: 1.8.1
106
105
  signing_key:
107
106
  specification_version: 3
108
107
  summary: A ruby library for working with Machine Readable Cataloging