miniharvest 0.2.1 → 0.2.2

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: e4955ba05d180433a72c0803946af7bb2491788f
4
- data.tar.gz: 4d65121fc8a42de9460d395e5e6b74fac39776e5
3
+ metadata.gz: 23d51a4e1b9fd2f688d87b51d540969b8785bb0e
4
+ data.tar.gz: 88f9acd122805ebef5276079b6b252ce844eb070
5
5
  SHA512:
6
- metadata.gz: 0c7154492c62e18d561d261477bf24ce0207f35cee1fb174bbe98dab7dd50eb74eab28e484b3e676a36133a838908671af3cde862d8a74153afcc78fe39ae6a7
7
- data.tar.gz: a818891b150915c3ae5e47d481ca330ae025eceaec2761ccff59361a8f9593f835d746054a30ad0614f9e9887b82750902388b5c4781983314efe9f32344d088
6
+ metadata.gz: 336b99bdf964509395c540bc6c700ca6a912ae66981ab0f64f3532cc811538fd899ac18bbecf8b1b3ceaf41f257e0880e95747a2eeb5602938469a3075e2b9f2
7
+ data.tar.gz: 87f6d5d112a18c906b21695b2190b6d9d0038aa2cc7988c787646dda7e6fb6f58e7b517f4ad0101fc0ba9c7cd3d4228ac31ef31b0b2bf89f0310aa422bf55209
@@ -59,6 +59,13 @@ module MiniHarvest
59
59
  end
60
60
  end
61
61
 
62
+ def dedupe_records(node)
63
+ seen = Hash.new(0)
64
+ node.traverse {|n| n.unlink if (seen[n.to_xml] += 1) > 1}
65
+ return node
66
+ end
67
+
68
+
62
69
  def get_records(token)
63
70
  params = { :verb => 'ListRecords', :resumptionToken => token[0].text }
64
71
  doc = oai_request(self.oai_base_uri,params)
@@ -67,7 +74,7 @@ module MiniHarvest
67
74
  if resumption_token != false
68
75
  get_records(resumption_token)
69
76
  else
70
- return self.marc_collection.root
77
+ return dedupe_records(self.marc_collection.root)
71
78
  end
72
79
  end
73
80
  end
@@ -1,3 +1,3 @@
1
1
  module MiniHarvest
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miniharvest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Little