cskit 1.2.1 → 1.2.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
- SHA1:
3
- metadata.gz: d3ab45f7e14fce23d015c99e0803c25134914aca
4
- data.tar.gz: d502b886c3249ab8f658aaf063522fb6fea3141a
2
+ SHA256:
3
+ metadata.gz: 9109df8cb0edfb82c26f8a1c152c4929728a778f0d952ab56d405da50efb9f93
4
+ data.tar.gz: 95f7b20939b42f0c276c80e3346eb156adadc03f5bf058174b7413e53dab7b2c
5
5
  SHA512:
6
- metadata.gz: 4d5871ae93e6a57bb2eb925048e5c93bcaf8fafe6f5c5db169fd1600bd17cfa1f8c0f738f4113c87516055625b18c789ea674bd2ec6fc3e391534e0dcd048c92
7
- data.tar.gz: c34db65a0bffe46df8779291fe1beefcbcc0287ba7936677a34d72b4cc9de07353b6cb3ffe3a1582a3e94fce92264af255f90e4b98d6bb714ef9fae0ef797150
6
+ metadata.gz: 94fcfe19d32b76cdf046f9627d74417f7a8870771530f8848c7f924dd80ffe3b518893458da85ccedc6524422fb14929e5283ec75b6b28e915cb89af19190ab3
7
+ data.tar.gz: fa8b8b7a0cf3b577eaa3cb54f8ad4dd665240ec06945d514c2f0723c6f506072ac503c80b3cb96406fbe5500f367bd7786ff1885916e1dd85b1afe19c313a5d0
@@ -37,10 +37,7 @@ module CSKit
37
37
  attr_reader :citation_text, :token_stream, :current
38
38
 
39
39
  def eos?
40
- token_stream.peek
41
- false
42
- rescue StopIteration
43
- true
40
+ current.type == :eos
44
41
  end
45
42
 
46
43
  def eos_token
@@ -54,13 +51,13 @@ module CSKit
54
51
  end
55
52
 
56
53
  if eos?
57
- if current.type == :eos
58
- raise(ParserError, 'Unexpected end of input')
59
- else
54
+ raise(ParserError, 'Unexpected end of input')
55
+ else
56
+ begin
57
+ @current = token_stream.next
58
+ rescue StopIteration
60
59
  @current = eos_token
61
60
  end
62
- else
63
- @current = token_stream.next
64
61
  end
65
62
  end
66
63
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module CSKit
4
- VERSION = '1.2.1'
4
+ VERSION = '1.2.2'
5
5
  end
@@ -63,6 +63,22 @@ describe BibleParser do
63
63
  end
64
64
  end
65
65
 
66
+ context 'single chapter, multiple verses' do
67
+ let(:citation_text) { 'I Corinthians 13:4-5, 13' }
68
+
69
+ it 'parses correctly' do
70
+ expect(parser.parse.to_hash).to eq({
71
+ book: 'I Corinthians', chapters: [{
72
+ chapter_number: 13, verses: [{
73
+ start: 4, finish: 5, starter: nil, terminator: nil
74
+ }, {
75
+ start: 13, finish: 13, starter: nil, terminator: nil
76
+ }]
77
+ }]
78
+ })
79
+ end
80
+ end
81
+
66
82
  context 'single chapter, verse range, starter fragment' do
67
83
  let(:citation_text) { 'Genesis 1:1-5 God' }
68
84
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cskit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-19 00:00:00.000000000 Z
11
+ date: 2018-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  requirements: []
95
95
  rubyforge_project:
96
- rubygems_version: 2.6.13
96
+ rubygems_version: 2.7.3
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: Christian Science citation library for Ruby.