sqlbible 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '095b3bc9b6735cd1df572c88d96117b96a60ebfc2bd928c01d8ef1bf5b2c5881'
4
- data.tar.gz: 2c9cd72e62e96e81bb210e1416c660e974a24fc17018edc8165b383c74e73083
3
+ metadata.gz: b8eddf93d395b8029d0de33f4f87e68c719612675e808aa135d583e7d5448f95
4
+ data.tar.gz: 5ecefd2dff29958e4dd5714a1f07385508478c05381bbed70d12317d3392cae5
5
5
  SHA512:
6
- metadata.gz: c7abadece71c1c11a3fddf7d5949e78c507ca6b74d309030d15cdd840329b08fb40af572440e3fa36430604e66ad95e952e2e46b4f3305495c5031384a869ddc
7
- data.tar.gz: 7c568ebde272045cba9b9f8b2a23a06d2d1b8ee381ca3abeb853e7b123beaeb1598ab6323ac485e8b59d5330545e9350189975f3c11d5092a97271c480f005eb
6
+ metadata.gz: 9ad3995f53208bab47b42b75007661f849664855665e066a154cc271891dc195b6aca2057d529839e86309e8da9df39300e3519eecbebe2cad50fb374d1772d6
7
+ data.tar.gz: e5b669d1610f13f753106e2dba8f530e8b715f4456eafcca974475109fe99ce80a696d6fe0fd948064dcf5e70399f04bd5b6d9ea0a85aae752635cad9b2ddc74
data/bin/sqlbible CHANGED
@@ -7,21 +7,21 @@ require 'scripref'
7
7
  require 'sqlbible'
8
8
 
9
9
  result = OptimistXL.options do
10
- synopsis 'Usage: sqlbible [options] [<command> [suboptions] <filename>]'
10
+ synopsis 'Usage: sqlbible <command> [options] [filename]?'
11
11
  subcmd :convert, 'Convert a bible from OSIS-XML to Sqlbible format' do
12
- opt :name, 'Name of the converted bible module or output filename of the generated .sqlbible file', type: String, required: true
12
+ opt :bible, 'Name of the converted bible module or output filename of the generated .sqlbible file', type: String, required: true
13
13
  opt :overwrite, 'Overwrite existing module or output file if exist', type: :Boolean, default: false
14
14
  end
15
15
  subcmd :list, 'Show a list of the names of the bibles in central directory'
16
16
  subcmd :search, 'Search with regular expressions' do
17
- opt :name, 'Name of the bible module filename of an .sqlbible file', type: String
17
+ opt :bible, 'Name of the bible module filename of an .sqlbible file', type: String
18
18
  opt :search, 'Regular expression to search (multiple allowed)', type: String, multi: true, required: true
19
19
  opt :lang, 'Language for parsing and formatting scripture references', type: String, permitted: %w(de en), default: 'en'
20
20
  opt :output, 'Output filename', type: String
21
21
  opt :range, 'Search range, example: "John 1-10"', type: String
22
22
  end
23
23
  subcmd :text, 'Show text of references' do
24
- opt :name, 'Name of the bible module filename of an .sqlbible file', type: String
24
+ opt :bible, 'Name of the bible module filename of an .sqlbible file', type: String
25
25
  opt :lang, 'Language for parsing and formatting scripture references', type: String, permitted: %w(de en), default: 'en'
26
26
  opt :output, 'Output filename', type: String
27
27
  opt :reference, 'Reference to show, example: "John 3:16; 10:27-30"', type: String, required: true
@@ -42,7 +42,7 @@ end
42
42
 
43
43
  def determine_out subopts
44
44
  if fn = subopts[:output]
45
- out = File.open(opts[:output], 'w')
45
+ out = File.open(fn, 'w')
46
46
  else
47
47
  out = $stdout
48
48
  end
@@ -62,7 +62,7 @@ when 'convert'
62
62
  $stderr.puts 'no filename given'
63
63
  exit 1
64
64
  end
65
- sqlbible_fn = Sqlbible.resolve_db_filename(subopts[:name])
65
+ sqlbible_fn = Sqlbible.resolve_db_filename(subopts[:bible])
66
66
  if !subopts[:overwrite] && File.exist?(sqlbible_fn)
67
67
  $stderr.puts format('file %s exist, conversion aborted', sqlbible_fn)
68
68
  exit 1
@@ -89,7 +89,7 @@ when 'search'
89
89
  range = nil
90
90
  end
91
91
  out = determine_out(subopts)
92
- bible = Sqlbible.new(subopts[:name])
92
+ bible = Sqlbible.new(subopts[:bible])
93
93
  regexes = searches.map {|s| Regexp.new(s)}
94
94
  f = Scripref::Formatter.new(lang_mod, bookformat: :abbrev)
95
95
  bible.search(regexes, range: range).each do |v|
@@ -100,7 +100,7 @@ when 'text'
100
100
  p = Scripref::Parser.new(lang_mod)
101
101
  f = Scripref::Formatter.new(lang_mod, bookformat: :abbrev)
102
102
  ref = p.parse(subopts[:reference])
103
- bible = Sqlbible.new(subopts[:name])
103
+ bible = Sqlbible.new(subopts[:bible])
104
104
  out = determine_out subopts
105
105
  bible.reference(ref).flatten.each do |v|
106
106
  out.puts format_verse(f, v)
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  class Sqlbible
5
- VERSION = '1.3.0'
5
+ VERSION = '1.3.2'
6
6
  end
data/lib/sqlbible.rb CHANGED
@@ -85,9 +85,7 @@ class Sqlbible
85
85
 
86
86
  # Get a list of the names of the bibles in bibles_dir
87
87
  def bible_names
88
- Dir.chdir bibles_dir do
89
- Dir['*.sqlbible'].map {|fn| fn.sub(/\.sqlbible$/, '')}.sort
90
- end
88
+ Dir[File.join(bibles_dir, '*.sqlbible')].map {|fn| File.basename(fn, '.sqlbible')}.sort
91
89
  end
92
90
 
93
91
  # Get an array of the major and minor version of the database schema of the
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqlbible
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  original_platform: ''
7
7
  authors:
8
8
  - Jan Friedrich
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-13 00:00:00.000000000 Z
11
+ date: 2024-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri