Skip to content

Commit

Permalink
Merge pull request #90 from collectionspace/ruby-2.7.2
Browse files Browse the repository at this point in the history
use ruby 2.7.2
  • Loading branch information
kspurgin authored Jan 16, 2021
2 parents 4bba11b + f347e1d commit 98d2139
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.6
2.7.2
2 changes: 2 additions & 0 deletions collectionspace-mapper.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Gem::Specification.new do |spec|
spec.homepage = 'https://github.com/lyrasis/collectionspace-mapper'
spec.license = 'MIT'

spec.required_ruby_version = '>= 2.7.2'

# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
# to allow pushing to a single host or delete this section to allow pushing to any host.
if spec.respond_to?(:metadata)
Expand Down
2 changes: 1 addition & 1 deletion doc/setup_for_development.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Setting up for development work

- You will need Ruby 2.6.6 in your development environment. (I recommend using https://rvm.io/[Ruby Version Manager (rvm)] to manage your Ruby development environment.)
- You will need Ruby 2.7.2 in your development environment. (I recommend using https://rvm.io/[Ruby Version Manager (rvm)] to manage your Ruby development environment.)
- Do `bundle --version`
- If the version of Bundler is lower than 2.1.2, do `gem update bundler`
** Bundler should come standard with Ruby 2.6.6, but I believe it comes by default with an older version. If you get an error that you don't have Bundler installed when you try to check the version, do `gem install bundler`
Expand Down
10 changes: 8 additions & 2 deletions lib/collectionspace/mapper/tools/dates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def initialize(date_string, client, cache, config)
'^\d{1,2}[-\/]\d{4}$'
].map{ |f| Regexp.new(f) }

if date_formats.any?{ |re| @date_string.match?(re) }
if date_string == '%NULLVALUE%'

elsif
date_formats.any?{ |re| @date_string.match?(re) }
try_chronic_parse(@date_string)
@timestamp ? create_mappable_date : try_services_query
elsif two_digit_year_date_formats.any?{ |re| @date_string.match?(re) }
Expand Down Expand Up @@ -90,6 +93,10 @@ def try_chronic_parse(string)
@timestamp = Chronic.parse(string)
end
end

def create_mappable_passthrough
@mappable['dateDisplayDate'] = @date_string
end

def create_mappable_date
date = @timestamp.to_date
Expand Down Expand Up @@ -157,7 +164,6 @@ def try_services_query
end

def fix_services_scalars(services_result)
# binding.pry
new_hash = {}
services_result.each do |k, v|
if k.end_with?('ScalarValue')
Expand Down
2 changes: 1 addition & 1 deletion lib/collectionspace/mapper/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module CollectionSpace
module Mapper
VERSION = "2.0.1"
VERSION = "2.1.0"
end
end

0 comments on commit 98d2139

Please sign in to comment.