diff --git a/bin/names/add_counts_to_db_and_dump_unmatched_as_solr.rb b/bin/names/add_counts_to_db_and_dump_unmatched_as_solr.rb index f42c5887..74d6c4f8 100644 --- a/bin/names/add_counts_to_db_and_dump_unmatched_as_solr.rb +++ b/bin/names/add_counts_to_db_and_dump_unmatched_as_solr.rb @@ -10,7 +10,7 @@ class DumpCountsWrapper def initialize(solr_extract, db_name, unmatched_file, logger = Logger.new($stderr)) - @db = AuthorityBrowse.db(db_name) + @db = AuthorityBrowse.db_old(db_name) @names = @db[:names] @logger = logger @unmatched_file = unmatched_file diff --git a/bin/names/skos_to_db.rb b/bin/names/skos_to_db.rb index 9b6cbbb5..5bd840aa 100644 --- a/bin/names/skos_to_db.rb +++ b/bin/names/skos_to_db.rb @@ -11,7 +11,7 @@ module SkosToDbWrapper def self.run(skosfile, dbfile, logger = Logger.new($stderr)) - db = AuthorityBrowse.db(dbfile) + db = AuthorityBrowse.db_old(dbfile) # drop old names table if db.tables.include? :names diff --git a/bin/names/unify_counts_with_xrefs_and_dump_matches_as_solr.rb b/bin/names/unify_counts_with_xrefs_and_dump_matches_as_solr.rb index 0f50e451..f55e6af1 100644 --- a/bin/names/unify_counts_with_xrefs_and_dump_matches_as_solr.rb +++ b/bin/names/unify_counts_with_xrefs_and_dump_matches_as_solr.rb @@ -27,7 +27,7 @@ # class UnifyWrapper def initialize(db_name, output_file, logger = Logger.new($stderr)) - @db = AuthorityBrowse.db(db_name) + @db = AuthorityBrowse.db_old(db_name) @names = @db[:names] @output_file = output_file @logger = logger diff --git a/lib/authority_browse/db.rb b/lib/authority_browse/db.rb index c8badaf0..5e721bd5 100644 --- a/lib/authority_browse/db.rb +++ b/lib/authority_browse/db.rb @@ -4,10 +4,8 @@ require "pathname" module AuthorityBrowse - DB_PATH = ENV["AUTHORITY_BROWSE_DB"] || "authorities.sqlite3" - # @return [Sequel::SQLite::Dataset] - def self.db(file) + def self.db_old(file) path = Pathname.new(file).realdirpath @db ||= if IS_JRUBY require "jdbc/sqlite3" diff --git a/spec/integrations/add_counts_to_db_and_dump_unmatched_as_solr_spec.rb b/spec/integrations/add_counts_to_db_and_dump_unmatched_as_solr_spec.rb index b6a18ce3..5505ff5e 100644 --- a/spec/integrations/add_counts_to_db_and_dump_unmatched_as_solr_spec.rb +++ b/spec/integrations/add_counts_to_db_and_dump_unmatched_as_solr_spec.rb @@ -11,7 +11,7 @@ @db_file = "tmp/database.db" @unmatched_file = "tmp/unmatched.json.gz" @logger = instance_double(Logger, info: nil) - @db = AuthorityBrowse.db(@db_file) + @db = AuthorityBrowse.db_old(@db_file) @db.create_table(:names) do String :id, primary_key: true String :label diff --git a/spec/integrations/skos_to_db_spec.rb b/spec/integrations/skos_to_db_spec.rb index f80aa9af..e0a63e51 100644 --- a/spec/integrations/skos_to_db_spec.rb +++ b/spec/integrations/skos_to_db_spec.rb @@ -4,7 +4,7 @@ @skos_file = "spec/fixtures/twain_skos.json.gz" @db_file = "tmp/database.db" @logger = instance_double(Logger, info: nil) - @db = AuthorityBrowse.db(@db_file) + @db = AuthorityBrowse.db_old(@db_file) end it "runs something" do described_class.run(@skos_file, @db_file) diff --git a/spec/integrations/unify_counts_with_xrefs_and_dump_matches_as_solr_spec.rb b/spec/integrations/unify_counts_with_xrefs_and_dump_matches_as_solr_spec.rb index 57c755f5..a34d8a1d 100644 --- a/spec/integrations/unify_counts_with_xrefs_and_dump_matches_as_solr_spec.rb +++ b/spec/integrations/unify_counts_with_xrefs_and_dump_matches_as_solr_spec.rb @@ -5,7 +5,7 @@ @db_file = "tmp/database.db" @matched_file = "tmp/matched.json.gz" @logger = instance_double(Logger, info: nil) - @db = AuthorityBrowse.db(@db_file) + @db = AuthorityBrowse.db_old(@db_file) @db.create_table(:names) do String :id, primary_key: true String :label