Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional date parsing and normalization for downstream consumer… #25

Merged
merged 2 commits into from
Dec 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ tmp
tmtags
.idea/*
to_delete
.byebug_history
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ end

# Pin to activesupport 4.x for older versions of ruby
gem 'activesupport', '~> 4.2' if RUBY_VERSION < '2.2.2'
gem 'byebug'
4 changes: 4 additions & 0 deletions lib/mods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
module Mods
require 'mods/constants'
require 'mods/nom_terminology'
require 'mods/date'
require 'mods/marc_country_codes'
require 'mods/marc_geo_area_codes'
require 'mods/marc_relator_codes'
require 'mods/name'
require 'mods/origin_info'
require 'mods/reader'
require 'mods/record'
require 'mods/subject'
require 'mods/title_info'
require 'mods/version'

ORIGIN_INFO_DATE_ELEMENTS = Mods::OriginInfo::DATE_ELEMENTS
end
13 changes: 5 additions & 8 deletions lib/mods/constants.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module Mods
# the version of MODS supported by this gem
MODS_VERSION = '3.4'

MODS_NS_V3 = "http://www.loc.gov/mods/v3"
MODS_NS = MODS_NS_V3
MODS_XSD = "http://www.loc.gov/standards/mods/mods.xsd"

DOC_URL = "http://www.loc.gov/standards/mods/"

# top level elements that cannot have subelement children
Expand Down Expand Up @@ -40,7 +40,7 @@ module Mods
# enumerated attribute values
TITLE_INFO_TYPES = ['abbreviated', 'translated', 'alternative', 'uniform']
RELATED_ITEM_TYPES = [
'preceding', 'succeeding', 'original', 'host', 'constituent', 'series',
'preceding', 'succeeding', 'original', 'host', 'constituent', 'series',
'otherVersion', 'otherFormat', 'isReferencedBy', 'references', 'reviewOf'
]

Expand All @@ -51,10 +51,7 @@ module Mods
'still image',
'moving image',
'three dimensional object',
'software',
'software',
'multimedia',
'mixed material']

ORIGIN_INFO_DATE_ELEMENTS = ['dateIssued', 'dateCreated', 'dateCaptured', 'dateValid', 'dateModified', 'copyrightDate', 'dateOther']

end
end