fieldhand 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49c63105b6f0895f33b4efdff65a657f4b18e7bb
4
- data.tar.gz: 824b068c57fdf22120f0f0a49d88e3cf73d1bc3d
3
+ metadata.gz: 52d3d4940c27abdd47bf06f7ad49f46e742a6e92
4
+ data.tar.gz: 22510d14c27a88f49529a36f6f6e901674073ece
5
5
  SHA512:
6
- metadata.gz: ac9af26d76794bc1a1578df816b5e69fb82f151623a28d448a9446f54d2f3536ffad6dce0b8a1d29713d5d19beefda50689093472e93663cf3f2a2ebc66c4208
7
- data.tar.gz: 2211e6803c30a037d7b5a34ba42b6005eddc50536eaa4a2bc428e245d33fb272a78f021561f1d77bc0efeb2e12d0c9eac48fbb93437775304c446d02d5105b99
6
+ metadata.gz: bd40718309d4404942fc03fe278121d3bb9bdbba21c0c632fa9e5770fe6b38dbcac55725cb121730ce851ddb03711e98996a00b0746cdc82a6747aa4b8e6708b
7
+ data.tar.gz: 665247958faacf0cf52fe06884b3642918b1a34185babf4947f527733827a18e7345b5ce273b9297d2cb1ef9791a26e52baa3c7a707e26fa47831f2f8028b6a9
data/README.md CHANGED
@@ -2,19 +2,19 @@
2
2
 
3
3
  A Ruby library for harvesting metadata from [OAI-PMH](https://www.openarchives.org/OAI/openarchivesprotocol.html) repositories.
4
4
 
5
- **Current version:** 0.6.0
5
+ **Current version:** 0.7.0
6
6
  **Supported Ruby versions:** 1.8.7, 1.9.2, 1.9.3, 2.0, 2.1, 2.2
7
7
 
8
8
  ## Installation
9
9
 
10
10
  ```
11
- gem install fieldhand -v '~> 0.6'
11
+ gem install fieldhand -v '~> 0.7'
12
12
  ```
13
13
 
14
14
  Or, in your `Gemfile`:
15
15
 
16
16
  ```ruby
17
- gem 'fieldhand', '~> 0.6'
17
+ gem 'fieldhand', '~> 0.7'
18
18
  ```
19
19
 
20
20
  ## Usage
@@ -47,14 +47,14 @@ module Fieldhand
47
47
 
48
48
  # Return this whole item as a string
49
49
  def to_xml
50
- Ox.dump(element, :encoding => 'utf-8')
50
+ Ox.dump(element, :encoding => 'utf-8', :indent => -1)
51
51
  end
52
52
 
53
53
  # Return the single manifestation of the metadata of this item as a string, if present.
54
54
  #
55
55
  # As metadata can be in any format, Fieldhand does not attempt to parse it but leave that to the user.
56
56
  def metadata
57
- @metadata ||= element.locate('metadata[0]').map { |metadata| Ox.dump(metadata, :encoding => 'utf-8') }.first
57
+ @metadata ||= element.locate('metadata[0]').map { |metadata| Ox.dump(metadata, :encoding => 'utf-8', :indent => -1) }.first
58
58
  end
59
59
 
60
60
  # Return any about elements describing the metadata of this record as an array of strings.
@@ -33,14 +33,14 @@ module Fieldhand
33
33
  element = ::Ox.parse('<record><metadata>Foo</metadata></record>')
34
34
  record = described_class.new(element)
35
35
 
36
- expect(record.metadata).to eq("\n<metadata>Foo</metadata>\n")
36
+ expect(record.metadata).to eq("<metadata>Foo</metadata>\n")
37
37
  end
38
38
 
39
39
  it 'returns the metadata with unicode characters as a string' do
40
40
  element = ::Ox.parse('<record><metadata>ψFooϨ</metadata></record>')
41
41
  record = described_class.new(element)
42
42
 
43
- expect(record.metadata).to eq("\n<metadata>ψFooϨ</metadata>\n")
43
+ expect(record.metadata).to eq("<metadata>ψFooϨ</metadata>\n")
44
44
  end
45
45
  end
46
46
 
@@ -49,31 +49,21 @@ module Fieldhand
49
49
  element = ::Ox.parse('<record/>')
50
50
  record = described_class.new(element)
51
51
 
52
- expect(record.to_xml).to eq("\n<record/>\n")
52
+ expect(record.to_xml).to eq("<record/>\n")
53
53
  end
54
54
 
55
55
  it 'returns the whole element as a string' do
56
56
  element = ::Ox.parse("<record><metadata>Foo</metadata></record>")
57
57
  record = described_class.new(element)
58
58
 
59
- expect(record.to_xml).to eq(<<-XML)
60
-
61
- <record>
62
- <metadata>Foo</metadata>
63
- </record>
64
- XML
59
+ expect(record.to_xml).to eq("<record><metadata>Foo</metadata></record>\n")
65
60
  end
66
61
 
67
62
  it 'returns the whole element with unicode characters as a string' do
68
63
  element = ::Ox.parse("<record><metadata>ψFooϨ</metadata></record>")
69
64
  record = described_class.new(element)
70
65
 
71
- expect(record.to_xml).to eq(<<-XML)
72
-
73
- <record>
74
- <metadata>ψFooϨ</metadata>
75
- </record>
76
- XML
66
+ expect(record.to_xml).to eq("<record><metadata>ψFooϨ</metadata></record>\n")
77
67
  end
78
68
  end
79
69
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fieldhand
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Mucur
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-07-26 00:00:00.000000000 Z
13
+ date: 2017-07-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ox