Skip to content

Commit

Permalink
[#2433] Resource print materials with ai in position 06 and 07 is a d…
Browse files Browse the repository at this point in the history
…atabases format (#2479)

add byebug in the gemfile
  • Loading branch information
christinach authored Sep 3, 2024
1 parent b870a98 commit 27e85df
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ end

group :development, :test do
# bundler and rake come in from the voyager_helpers gemspec
gem 'byebug'
gem 'coveralls_reborn'
gem "dotenv-rails"
gem "factory_bot_rails"
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ GEM
autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0)
builder (3.3.0)
byebug (11.1.3)
capistrano (3.19.1)
airbrussh (>= 1.0.0)
i18n
Expand Down Expand Up @@ -684,6 +685,7 @@ DEPENDENCIES
bcrypt_pbkdf
bixby (~> 5.0)
bootstrap-sass (~> 3.4.1)
byebug
capistrano-passenger
capistrano-rails
capistrano-rails-console
Expand Down
5 changes: 5 additions & 0 deletions marc_to_solr/lib/format/bib_format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@ def determine_bib_code(type, lev)
format << "MP" if bibformat_mp(type, lev) # map
format << "MW" if bibformat_mw(type, lev) # manuscript
format << "BK" if bibformat_bk(type, lev) # book
format << "DB" if bibformat_db(type, lev) # databases
format
end

def bibformat_bk(type, lev)
(type == 't') || ((type == 'a') && %w[a b c d i m].include?(lev))
end

def bibformat_db(type, lev)
(type == 'a') && (lev == 'i')
end

def bibformat_jn(type, lev)
(type == 'a') && (lev == 's')
end
Expand Down
1 change: 1 addition & 0 deletions marc_to_solr/translation_maps/format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"CF" => "Data file",
"CR" => "CDROM",
"CS" => "Software",
"DB" => "Databases",
"DI" => "Dictionaries",
"DR" => "Directories",
"EN" => "Encyclopedias",
Expand Down
3 changes: 2 additions & 1 deletion spec/marc_to_solr/lib/format_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
describe 'From format.rb' do
let(:marc) { MARC::Record.new }

{ 'Book' => ['aa', 'ab', 'ac', 'ad', 'ai', 'am'],
{ 'Book' => ['aa', 'ab', 'ac', 'ad', 'am'],
'Journal' => ['as'],
'Data file' => ['m '],
'Databases' => ['ai'],
'Visual material' => ['k ', 'o ', 'r '],
'Video/Projected medium' => ['g '],
'Musical score' => ['c ', 'd '],
Expand Down

0 comments on commit 27e85df

Please sign in to comment.