cskit 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/cskit/parsers/parser.rb +6 -9
- data/lib/cskit/version.rb +1 -1
- data/spec/parsers/bible/bible_parser_spec.rb +16 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9109df8cb0edfb82c26f8a1c152c4929728a778f0d952ab56d405da50efb9f93
|
4
|
+
data.tar.gz: 95f7b20939b42f0c276c80e3346eb156adadc03f5bf058174b7413e53dab7b2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94fcfe19d32b76cdf046f9627d74417f7a8870771530f8848c7f924dd80ffe3b518893458da85ccedc6524422fb14929e5283ec75b6b28e915cb89af19190ab3
|
7
|
+
data.tar.gz: fa8b8b7a0cf3b577eaa3cb54f8ad4dd665240ec06945d514c2f0723c6f506072ac503c80b3cb96406fbe5500f367bd7786ff1885916e1dd85b1afe19c313a5d0
|
data/lib/cskit/parsers/parser.rb
CHANGED
@@ -37,10 +37,7 @@ module CSKit
|
|
37
37
|
attr_reader :citation_text, :token_stream, :current
|
38
38
|
|
39
39
|
def eos?
|
40
|
-
|
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
|
-
|
58
|
-
|
59
|
-
|
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
|
data/lib/cskit/version.rb
CHANGED
@@ -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.
|
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:
|
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.
|
96
|
+
rubygems_version: 2.7.3
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: Christian Science citation library for Ruby.
|