miniharvest 0.1.5 → 0.1.8

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: c17fd0149e1c6e4b01280791868f0a45ebf365d6
4
- data.tar.gz: 7a666e06804b6d9593445ddea620074d1e6bd407
3
+ metadata.gz: 5487f82a2fd55c10cc459970c1da3b7e79287f37
4
+ data.tar.gz: 6a26b3fc11e17f9423bcf0d30ac454718a6593d1
5
5
  SHA512:
6
- metadata.gz: 35981f46a98f1f2c06228cad42cef538cc68e0f6d4a8b01852c0f79b24f25933e26ec199981e65941da1bb8962d435494f181300cc95f5165fc3425086dc6aaf
7
- data.tar.gz: 8e38a08ae0f3499e86cf99c873b429dffe57cd429d63507264451c03781830c19d067a1806786d5a5dcbcc4ba5310c2b93e3b2a8bfec88486d24e847243d342f
6
+ metadata.gz: e45e99872470ec95ace48e61f09cee3b9694302d1c857271d6f9a121a51f71fbb0a987f18282d785aff50e6cc70e8d5a394e5e279d358733807856357032be0c
7
+ data.tar.gz: 120fe7fd9ab4039c48057b806711f6c5aac845d222d426c18175ac1c5d1045072cafa9a058e63d92f922de896d41da0a8fd691c23edc5d7c75d26ddb58e32b50
data/exe/miniharvest CHANGED
@@ -1,8 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'miniharvest'
3
+ require 'nokogiri'
3
4
 
4
5
  mh = MiniHarvest::MiniHarvest.new
5
6
  mh.oai_base_uri = ARGV[0]
6
7
  mh.set = ARGV[1]
7
8
  mh.from = ARGV[2]
8
- mh.get_records(mh.initial_request)
9
+ mh.marc_collection = Nokogiri::XML('<collection xmlns="http://www.loc.gov/MARC21/slim">')
10
+ marc_xml = mh.get_records(mh.initial_request)
11
+ File.write(ARGV[3], marc_xml.to_xml)
@@ -1,3 +1,3 @@
1
1
  module MiniHarvest
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.8"
3
3
  end
data/lib/miniharvest.rb CHANGED
@@ -6,13 +6,11 @@ module MiniHarvest
6
6
  require 'open-uri'
7
7
 
8
8
  class MiniHarvest
9
-
10
- @@marc_collection = Nokogiri::XML('<collection xmlns="http://www.loc.gov/MARC21/slim">')
11
-
12
- attr_accessor :oai_base_uri, :set, :from
9
+
10
+ attr_accessor :oai_base_uri, :set, :from, :marc_collection
13
11
 
14
12
  def append_to_collection(records)
15
- @@marc_collection.at('collection').add_child(records)
13
+ self.marc_collection.root.add_child(records)
16
14
  end
17
15
 
18
16
  def oai_request(uri,params)
@@ -44,8 +42,7 @@ module MiniHarvest
44
42
  if resumption_token != ""
45
43
  get_records(resumption_token)
46
44
  else
47
- puts @@marc_collection.to_s
48
- return
45
+ return self.marc_collection
49
46
  end
50
47
  end
51
48
  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.1.5
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Little