scripref 1.1.0 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18851c425f1c4a9504ede784a43a46d80a668c9059bc000d6f866b6ce3a5ffe2
4
- data.tar.gz: e7cdaa42c34785fd755dc747247ea100ca757c9fed062cca691060c8c5288c3b
3
+ metadata.gz: 307a7c3809c70de6386b29d42030f15f11500fbbcb4610eda7ce3316a10413d9
4
+ data.tar.gz: bf6c3dbe9bf855fdc9be762e5aca9e356b586276341e1b770506e0ae39aeaf69
5
5
  SHA512:
6
- metadata.gz: 01c5874544e15524587022c02e5e3002fa170f07889248f1937410671f94e03db239ec8fd5cfd47db8dee687c7b41b9ba56a4fb8fd12ebffb6f050b3a64eb2c3
7
- data.tar.gz: 1745d52b620f5b71e9f12627a9b797f668f160e914de8869ab05c692218b87567aa08ff4eae6b2d04e9cad36dd43c1d868d5c8ac4f4b47cfcfeb19e41eea1063
6
+ metadata.gz: 10045f4c2a5b3faae38ace17eab90c256ad1bfdb01ffea1dafc9bb8b0e58617c38c1eff92d8ab9f06b54efb8cd6b671e417667f6cc68efac5d994988a9561e7e
7
+ data.tar.gz: 6a5eb88141c66149b450ff9eb847475fd5f446050520bb9b7cce2dac99dd3d6a74b4e38a7a815e5a07663673435fe156e6630830e8ae47e6ae030c460d2e3a9b
data/Changelog CHANGED
@@ -1,3 +1,9 @@
1
+ 1.1.2
2
+ Fix bug in Formatter with books with only one chapter.
3
+
4
+ 1.1.1
5
+ Fix Bookname#to_s and add license to gemspec.
6
+
1
7
  1.1.0
2
8
  Adapt German abbreviations.
3
9
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2017 Jan Friedrich
1
+ Copyright (c) 2010-2018, 2020, 2024 Jan Friedrich
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -22,7 +22,7 @@ module Scripref
22
22
  end
23
23
 
24
24
  def to_s
25
- @osis_id
25
+ @osis_id.to_s
26
26
  end
27
27
 
28
28
  alias to_str to_s
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'scripref/const_reader'
4
+ require_relative 'const_reader'
5
5
 
6
6
  module Scripref
7
7
 
@@ -109,7 +109,12 @@ module Scripref
109
109
  push_sep cv_separator
110
110
  end
111
111
  else
112
- push_space
112
+ case last_token
113
+ when Verse
114
+ push_sep verse_separator
115
+ else
116
+ push_space
117
+ end
113
118
  end
114
119
  push_verse v1
115
120
  @last_v = v1
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'scripref/const_reader'
4
+ require_relative 'const_reader'
5
5
 
6
6
  module Scripref
7
7
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'scripref'
4
+ require_relative '../scripref'
5
5
 
6
6
  include Scripref
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: false
3
3
 
4
- require 'scripref/basic_methods'
4
+ require_relative 'basic_methods'
5
5
  require 'strscan'
6
6
 
7
7
  module Scripref
@@ -1,8 +1,8 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
+ require_relative 'basic_methods'
4
5
  require 'strscan'
5
- require 'scripref/basic_methods'
6
6
 
7
7
  module Scripref
8
8
 
data/lib/scripref.rb CHANGED
@@ -5,16 +5,16 @@ require 'delegate'
5
5
 
6
6
  module Scripref
7
7
 
8
- VERSION = '1.1.0'
9
-
10
- autoload :Bookname, 'scripref/bookname'
11
- autoload :Bookorder, 'scripref/bookorder'
12
- autoload :English, 'scripref/english'
13
- autoload :Formatter, 'scripref/formatter'
14
- autoload :German, 'scripref/german'
15
- autoload :Parser, 'scripref/parser'
16
- autoload :Passage, 'scripref/passage'
17
- autoload :Processor, 'scripref/processor'
8
+ VERSION = '1.1.2'
9
+
10
+ require_relative 'scripref/bookname'
11
+ require_relative 'scripref/bookorder'
12
+ require_relative 'scripref/english'
13
+ require_relative 'scripref/formatter'
14
+ require_relative 'scripref/german'
15
+ require_relative 'scripref/parser'
16
+ require_relative 'scripref/passage'
17
+ require_relative 'scripref/processor'
18
18
 
19
19
  class Token < DelegateClass(String)
20
20
  def initialize *args
data/regtest/formatter.rb CHANGED
@@ -1,6 +1,9 @@
1
+ # encoding: utf-8
2
+ # frozen_string_literal: true
3
+
1
4
  require 'ostruct'
2
5
  require 'regtest'
3
- require 'scripref'
6
+ require_relative '../lib/scripref'
4
7
 
5
8
  include Scripref
6
9
 
data/regtest/parser.rb CHANGED
@@ -1,5 +1,8 @@
1
+ # encoding: utf-8
2
+ # frozen_string_literal: true
3
+
1
4
  require 'regtest'
2
- require 'scripref'
5
+ require_relative '../lib/scripref'
3
6
 
4
7
  include Scripref
5
8
 
data/regtest/processor.rb CHANGED
@@ -1,5 +1,8 @@
1
+ # encoding: utf-8
2
+ # frozen_string_literal: true
3
+
1
4
  require 'regtest'
2
- require 'scripref'
5
+ require_relative '../lib/scripref'
3
6
 
4
7
  include Scripref
5
8
 
data/scripref.gemspec CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.version = Scripref::VERSION
8
8
  s.authors = 'Jan Friedrich'
9
9
  s.email = 'janfri26@gmail.com'
10
+ s.license = 'MIT'
10
11
 
11
12
  s.homepage = 'https://github.com/janfri/scripref'
12
13
  s.metadata = {
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'test_helper'
4
+ require_relative 'test_helper'
5
5
 
6
6
  class TestBookname < Test::Unit::TestCase
7
7
 
data/test/test_english.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'test_helper'
4
+ require_relative 'test_helper'
5
5
 
6
6
  class TestEnglish < Test::Unit::TestCase
7
7
 
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'test_helper'
4
+ require_relative 'test_helper'
5
5
 
6
6
  class TestFormatter < Test::Unit::TestCase
7
7
 
@@ -168,6 +168,11 @@ class TestFormatter < Test::Unit::TestCase
168
168
  assert_formated_text_for_ast text, [pass(text: t1, b1: :Ruth, c1: 2, v1: 5, b2: :Ruth, c2: 2, v2: 5), semi, pass(text: t2, b1: :Mark, c1: 4, b2: :Mark, c2: 4)]
169
169
  end
170
170
 
171
+ def test_two_refs_with_book_with_only_one_chapter
172
+ text = 'Obadja 3.5'
173
+ assert_formated_text_for_ast text, [pass(text: text, b1: :Obad, c1: 1, v1: 3, b2: :Obad, c2: 1, v2: 3), pass(b1: :Obad, c1: 1, v1: 5, b2: :Obad, c2: 1, v2: 5)]
174
+ end
175
+
171
176
  ######################################################################
172
177
  # mixed variants of more than one passage
173
178
  ######################################################################
data/test/test_german.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'test_helper'
4
+ require_relative 'test_helper'
5
5
 
6
6
  class TestGerman < Test::Unit::TestCase
7
7
 
@@ -32,21 +32,21 @@ class TestGerman < Test::Unit::TestCase
32
32
  assert_match book_re, 'Off'
33
33
  end
34
34
 
35
- def test_book2num
36
- assert_book_num :Gen, '1. Mose'
37
- assert_book_num :Matt, 'Matthäus'
38
- assert_book_num :Rev, 'Offenbarung'
39
- assert_book_num :Gen, '1. Mo'
40
- assert_book_num :Gen, '1.Mo'
41
- assert_book_num :Gen, '1M'
42
- assert_book_num :Matt, 'Mat'
43
- assert_book_num :Phil, 'Phil'
44
- assert_book_num :Rev, 'Off'
35
+ def test_book2osis_id
36
+ assert_osis_book_id :Gen, '1. Mose'
37
+ assert_osis_book_id :Matt, 'Matthäus'
38
+ assert_osis_book_id :Rev, 'Offenbarung'
39
+ assert_osis_book_id :Gen, '1. Mo'
40
+ assert_osis_book_id :Gen, '1.Mo'
41
+ assert_osis_book_id :Gen, '1M'
42
+ assert_osis_book_id :Matt, 'Mat'
43
+ assert_osis_book_id :Phil, 'Phil'
44
+ assert_osis_book_id :Rev, 'Off'
45
45
  end
46
46
 
47
- def assert_book_num num, str
47
+ def assert_osis_book_id id, str
48
48
  @parser ||= Scripref::Parser.new(Scripref::German)
49
- assert_equal num, @parser.parse(str).first.b1
49
+ assert_equal id, @parser.parse(str).first.b1
50
50
  end
51
51
 
52
52
  end
data/test/test_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'scripref'
4
+ require_relative '../lib/scripref'
5
5
  require 'test/unit'
6
6
 
7
7
  module Test::Helper
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'test_helper'
4
+ require_relative 'test_helper'
5
5
 
6
6
  class TestIntegration < Test::Unit::TestCase
7
7
 
data/test/test_parser.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'test_helper'
4
+ require_relative 'test_helper'
5
5
 
6
6
  class TestParser < Test::Unit::TestCase
7
7
 
data/test/test_passage.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  # encoding: utf-8
2
- require 'test_helper'
3
2
  # frozen_string_literal: true
4
3
 
4
+ require_relative 'test_helper'
5
+
5
6
  class TestPassage < Test::Unit::TestCase
6
7
 
7
8
  include Scripref
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'test_helper'
4
+ require_relative 'test_helper'
5
5
 
6
6
  class TestPipelining < Test::Unit::TestCase
7
7
 
@@ -17,7 +17,7 @@ class TestPipelining < Test::Unit::TestCase
17
17
  end
18
18
 
19
19
  def test_left_to_right
20
- require 'scripref/pipelining'
20
+ require_relative '../lib/scripref/pipelining'
21
21
  text = 'Hebräer 13,8'
22
22
  parser = Parser.new(German)
23
23
  formatter = Formatter.new(English)
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'test_helper'
4
+ require_relative 'test_helper'
5
5
 
6
6
  class TestProcessorIterators < Test::Unit::TestCase
7
7
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scripref
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
- original_platform: ''
7
6
  authors:
8
7
  - Jan Friedrich
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-14 00:00:00.000000000 Z
10
+ date: 2025-01-03 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -92,7 +91,8 @@ files:
92
91
  - test/test_pipelining.rb
93
92
  - test/test_processor.rb
94
93
  homepage: https://github.com/janfri/scripref
95
- licenses: []
94
+ licenses:
95
+ - MIT
96
96
  metadata:
97
97
  homepage_uri: https://github.com/janfri/scripref
98
98
  source_code_uri: https://github.com/janfri/scripref
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubygems_version: 3.6.0.dev
113
+ rubygems_version: 3.7.0.dev
114
114
  specification_version: 4
115
115
  summary: Library for parsing scripture references in real texts.
116
116
  test_files: []