bible_gateway 0.0.11 → 0.0.12

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: c6dc9855f91f7a36aab0b7027d47748177cb066100610ac56af7332f139b6108
4
- data.tar.gz: bf51a4c4c80babd3d52e18fff7d72d01e3418960cba69fe70be55f4c32a18b5c
3
+ metadata.gz: 936c48f6f63535b6b45f26270bd8f736b33547ee5143361a0ead5d3c9c9ab8f8
4
+ data.tar.gz: 93042e59fe2c1a5987337bf63f47fbda4742c0f6a365d78e0e3845ee610eb1ab
5
5
  SHA512:
6
- metadata.gz: 960ac14a45873953c527ff1018d6168865e5f8cb06638b6dac009f134f0479e3f0cdbc2fdd04cce8d72822d86b7c7aba115c24952de817df15a5af8ff834dc0e
7
- data.tar.gz: 46f8a534d8fda13b3d6bd8aceccaa8d86747824e5b5882e53d65146dead8ea80a7df534a7cba4999f3b7f4941f137365cb2823ec48b92be0d9971d5e2997aaf4
6
+ metadata.gz: '09d00df060704129a77c21eb1e3b1ad2d3576d61d420ab2d4adc155a19b479c0be19d4a648afc4a6cbf703a9c21a97fae21650b8f4bec13ff11fe7758b8036b3'
7
+ data.tar.gz: 66d98831f4cbb6243f10156ebe3c70894205351fbd50ef12dadf1c2bfc9c75ab1ff43828b25d321eadd4bd2301d17b9aee3e328365adec9e34c9d133189ddfbc
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
3
  - 1.9.3
5
4
  - 2.0.0
6
5
  - 2.1.1
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # BibleGateway
2
2
 
3
3
  Travis CI:
4
- [![Build Status](https://travis-ci.org/gdagley/bible_gateway.png?branch=master)](https://travis-ci.org/gdagley/bible_gateway)
5
- 1.9.2, 1.9.3, 2.0.0
4
+ [![Build Status](https://travis-ci.org/bibleable/bible_gateway.png?branch=master)](https://travis-ci.org/bibleable/bible_gateway)
5
+ 1.9.3, 2.0.0, 2.1.1
6
6
 
7
7
  An unofficial 'API' for BibleGateway.com.
8
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.10
1
+ 0.0.12
@@ -38,6 +38,10 @@ class BibleGateway
38
38
  :louis_segond => "LSG",
39
39
  :nouvelle_edition_de_geneve => "NEG1979",
40
40
  :segond_21 => "SG21",
41
+
42
+ #Chinese
43
+ :chinese_new_version_simplified => "CNVS",
44
+ :chinese_union_version_simplified => "CUVS",
41
45
  }
42
46
 
43
47
  def self.versions
@@ -74,16 +78,30 @@ class BibleGateway
74
78
  segment.search('sup.footnote').remove # remove footnote links
75
79
  segment.search("div.crossrefs").remove # remove cross references
76
80
  segment.search("div.footnotes").remove # remove footnotes
81
+
82
+ #scripture_text should be text
83
+ text = ""
77
84
  segment.search("span.text").each do |span|
78
- text = span.inner_html
79
- span.swap text
85
+ text += span.inner_text
80
86
  end
81
87
 
88
+ # text should be html so that text can be used above.
89
+ segment.search("span.text").each do |span|
90
+ html_content = span.inner_html
91
+ span.swap html_content
92
+ end
93
+
94
+ # text should be html so that text can be used above.
82
95
  segment.search('sup.versenum').each do |sup|
83
- text = sup.content
84
- sup.swap "<sup>#{text}</sup>"
96
+ html_content = sup.content
97
+ sup.swap "<sup>#{html_content}</sup>"
85
98
  end
99
+
86
100
  content = segment.inner_html.gsub('<p></p>', '').gsub(/<!--.*?-->/, '').strip
87
- {:title => title, :content => content }
101
+
102
+ #scripture_text should be text
103
+ {:title => title,
104
+ :content => content,
105
+ :text => text }
88
106
  end
89
107
  end
@@ -1,3 +1,3 @@
1
1
  class BibleGateway
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -27,10 +27,16 @@ describe BibleGateway do
27
27
  expect(gateway.version).to eq(:english_standard_version)
28
28
  end
29
29
 
30
+ it "should be able to set the chinese version to use" do
31
+ gateway = BibleGateway.new :chinese_new_version_simplified
32
+ expect(gateway.version).to eq(:chinese_new_version_simplified)
33
+ end
34
+
30
35
  it "should raise an exception when changing to unknown version" do
31
36
  gateway = BibleGateway.new
32
37
  expect { gateway.version = :unknown_version }.to raise_error(BibleGatewayError)
33
38
  end
39
+
34
40
  end
35
41
 
36
42
  describe "lookup" do
@@ -40,6 +46,11 @@ describe BibleGateway do
40
46
  expect(title).to eq("John 1:1")
41
47
  end
42
48
 
49
+ it "should find the passage title in chinese_new_version_simplified" do
50
+ title = BibleGateway.new(:chinese_new_version_simplified).lookup("John 1:1")[:title]
51
+ expect(title).to eq("约翰福音 1:1")
52
+ end
53
+
43
54
  it "should find and clean the passage content" do
44
55
  content = BibleGateway.new(:english_standard_version).lookup("John 1:1")[:content]
45
56
  expect(content).to include("<h3>The Word Became Flesh</h3>")
@@ -53,6 +64,11 @@ describe BibleGateway do
53
64
  expect(title).to eq("John 3")
54
65
  end
55
66
 
67
+ it "should find the passage title in chinese_new_version_simplified" do
68
+ title = BibleGateway.new(:chinese_new_version_simplified).lookup("John 3")[:title]
69
+ expect(title).to eq("约翰福音 3")
70
+ end
71
+
56
72
  it "should find and clean the passage content" do
57
73
  content = BibleGateway.new(:english_standard_version).lookup("John 3")[:content]
58
74
  expect(content).to include("<h3>You Must Be Born Again</h3>")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bible_gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoffrey Dagley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-04 00:00:00.000000000 Z
11
+ date: 2020-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri