Skip to content

Commit

Permalink
rename AuthorityBrowse.db to AuthorityBrowse.db_old
Browse files Browse the repository at this point in the history
  • Loading branch information
niquerio committed Oct 5, 2023
1 parent ecb47c2 commit bfecd46
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bin/names/add_counts_to_db_and_dump_unmatched_as_solr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bin/names/skos_to_db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions lib/authority_browse/db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/integrations/skos_to_db_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bfecd46

Please sign in to comment.