sqlbible 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sqlbible/version.rb +1 -1
- data/lib/sqlbible.rb +8 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21260f096b6235ac423d8406a10afe1b83f39765585bb3788489877da458c7d5
|
4
|
+
data.tar.gz: 747c638f0ed836cf25995b7b58659c79501bacb0b5d1e8198e5ef29d6b1aeab1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6ff9efb6a3d602bfde16a4824ef8b92fa4e19d6f71d7fac7c8e7d06365b66540f23026d4bd945c879563910734eb860b595ffc4e19faa0b9d7ed38f5e0658d7
|
7
|
+
data.tar.gz: f46ccb07c1abad4264d31fdf5189a1e0ec60f95a3649bf7b8234733662a59a45ca6e77b743622b89a217af54e5230e95bfba32b9984ce9c2a832df2b1326c52d
|
data/lib/sqlbible/version.rb
CHANGED
data/lib/sqlbible.rb
CHANGED
@@ -12,10 +12,7 @@ class Sqlbible
|
|
12
12
|
attr_reader :db_filename
|
13
13
|
|
14
14
|
def initialize db_name
|
15
|
-
@db_filename = Sqlbible.resolve_db_filename(db_name)
|
16
|
-
unless File.exist? @db_filename
|
17
|
-
fail ArgumentError, format('database %s not found, file %s does not exist', db_name, @db_filename)
|
18
|
-
end
|
15
|
+
@db_filename = Sqlbible.resolve_db_filename(db_name, check_existence: true)
|
19
16
|
@db = SQLite3::Database.new(@db_filename)
|
20
17
|
@db.enable_load_extension(true)
|
21
18
|
pcre_extension_file = ENV['SQLITE_PCRE_EXTENSION']
|
@@ -112,11 +109,11 @@ class Sqlbible
|
|
112
109
|
select_schema_major_minor(db).join('.')
|
113
110
|
end
|
114
111
|
|
115
|
-
def resolve_db_filename db_name
|
112
|
+
def resolve_db_filename db_name, check_existence: false
|
116
113
|
db_name = db_name.to_s
|
117
114
|
if File.basename(db_name, '.sqlbible') == db_name
|
118
115
|
fn = File.join(bibles_dir, format('%s.sqlbible', db_name))
|
119
|
-
|
116
|
+
if check_existence && !File.exist?(fn)
|
120
117
|
msg = format('database %s not found, file %s does not exist', db_name, fn)
|
121
118
|
sc = DidYouMean::SpellChecker.new(dictionary: bible_names)
|
122
119
|
res = sc.correct(db_name)
|
@@ -125,10 +122,13 @@ class Sqlbible
|
|
125
122
|
end
|
126
123
|
fail ArgumentError, msg
|
127
124
|
end
|
128
|
-
fn
|
129
125
|
else
|
130
|
-
db_name
|
126
|
+
fn = db_name
|
127
|
+
if check_existence && !File.exist?(fn)
|
128
|
+
fail ArgumentError, format('file %s does not exist', fn)
|
129
|
+
end
|
131
130
|
end
|
131
|
+
fn
|
132
132
|
end
|
133
133
|
|
134
134
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqlbible
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Friedrich
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2024-12-
|
10
|
+
date: 2024-12-28 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: did_you_mean
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
127
|
+
rubygems_version: 3.7.0.dev
|
128
128
|
specification_version: 4
|
129
129
|
summary: Library for bibles as SQLite databases
|
130
130
|
test_files: []
|