File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 99require 'readline'
1010require 'socket'
1111
12+ if not defined? ( OAI ::Const ::VERBS )
13+ require 'oai/constants'
14+ end
15+
1216require 'oai/client'
1317require 'oai/harvester/config'
1418require 'oai/harvester/harvest'
Original file line number Diff line number Diff line change 55module OAI
66 module Harvester
77
8- LOW_RESOLUTION = "YYYY-MM-DD"
8+ LOW_RESOLUTION = OAI :: Const :: Granularity :: LOW
99
1010 class Config < OpenStruct
1111
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ def harvest(site)
3838 harvest_time = Time . now . utc
3939 end
4040
41- if "YYYY-MM-DD" == granularity ( opts [ :url ] )
41+ if OAI :: Const :: Granularity :: LOW == granularity ( opts [ :url ] )
4242 opts [ :until ] = harvest_time . strftime ( "%Y-%m-%d" )
4343 opts [ :from ] = @from . strftime ( "%Y-%m-%d" ) if @from
4444 else
@@ -139,7 +139,7 @@ def filename(from_time, until_time)
139139 "#{ from_time . strftime ( format ) } _til_#{ until_time . strftime ( format ) } " \
140140 "_at_#{ until_time . strftime ( '%H-%M-%S' ) } "
141141 end
142-
142+
143143 def granularity ( url )
144144 client = OAI ::Client . new url
145145 client . identify . granularity
@@ -149,7 +149,7 @@ def granularity(url)
149149 def earliest ( url )
150150 client = OAI ::Client . new url
151151 identify = client . identify
152- if "YYYY-MM-DD" == identify . granularity
152+ if OAI :: Const :: Granularity :: LOW == identify . granularity
153153 Time . parse ( identify . earliest_datestamp ) . strftime ( "%Y-%m-%d" )
154154 else
155155 Time . parse ( identify . earliest_datestamp ) . xmlschema
You can’t perform that action at this time.
0 commit comments