File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- RUBY_OAI_VERSION = '0.0.6 '
1+ RUBY_OAI_VERSION = '0.0.8 '
22
33require 'rubygems'
44require 'rake'
Original file line number Diff line number Diff line change @@ -45,10 +45,12 @@ def start
4545 else
4646 self . send ( cmd . shift , cmd . join ( " " ) )
4747 end
48- rescue
49- puts "Not a recognized command, or bad options. Type 'help' for clues."
50- puts $!
51- puts $!. backtrace . join ( "\n " )
48+ rescue NoMethodError
49+ puts "Not a recognized command. Type 'help' for clues."
50+ rescue
51+ puts "An error occurred:"
52+ puts $!
53+ puts $!. backtrace . join ( "\n " )
5254 end
5355 end
5456 end
@@ -73,7 +75,7 @@ def harvest(options)
7375 banner "Harvesting '#{ site } '"
7476 if date && !date . empty?
7577 begin
76- date = Chronic . parse ( date . join ( ' ' ) ) . utc
78+ date = Time . parse ( date . join ( ' ' ) ) . utc
7779 rescue NoMethodError
7880 puts "Couldn't parse the date supplied"
7981 return
Original file line number Diff line number Diff line change 1+ require 'test_helper'
2+
3+ class LowResolutionDatesTest < Test ::Unit ::TestCase
4+
5+ def test_low_res_date_parsing
6+ client = OAI ::Client . new 'http://caltechcstr.library.caltech.edu/perl/oai2'
7+
8+ date = Date . new 2003 , 1 , 1
9+
10+ # get a list of identifier headers
11+ assert_nothing_raised { client . list_identifiers :from => date }
12+ end
13+
14+ end
You can’t perform that action at this time.
0 commit comments