wikipedia-client 1.9.0 → 1.9.1

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: 806d743adba4ad0839bbc288a7167e4b15ef7524c0ab9d6dabeaa463cb0960e6
4
- data.tar.gz: 9e0a592a25a19f1581ecb2840bffffe17616e2fa01d7ba3ad66a9dc636f9cc8e
3
+ metadata.gz: 718a9f989e3e18694e4e8fb8fce03059fb946f3ddc0ef840605ccd277719efad
4
+ data.tar.gz: f067e92c80d44a8e86de2c92b97b21b4b5a50b8a7eee1330c0506dd23b558ab8
5
5
  SHA512:
6
- metadata.gz: 0aea030eca0258d932a780d0c9608f6e0d0dbdf0f1290b5b9d88e818888c04b06a994c077b30ec3b4d3f8d395f9b40b99df66f01c5e57db24fd9cba055ad1f45
7
- data.tar.gz: 1b05e6e5908b44cf5955288c5222fe12716c3955b51ba24d0cec3504c2d9a2a04a65732d5d27ad6043ae6b2b464ab2732b1937544a6f94aaf96e66d6461ede09
6
+ metadata.gz: ecdaba7629a485706d95b43e2c99496a0ad93e579f4be8cf528e756ffd96f9d1e29a0e9c274069bb5e35aad7cfb61ba33b5dff4e368f28aa8c60ec48789559c9
7
+ data.tar.gz: d6ffd55fd345ed1f0c52973125efcb14ec1913c29e6b5d046373d8c18bbe18b11220766ce3a6dffe32d2d0feab9248673de5f7566b6d7ad77362fd18cf3a8cba
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wikipedia-client (1.9.0)
4
+ wikipedia-client (1.9.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -8,7 +8,7 @@ module Wikipedia
8
8
  return @title if @title
9
9
 
10
10
  uri = URI.parse( @wiki_url )
11
- @title = URI.decode( uri.path.split('/').last )
11
+ @title = URI.decode( uri.path.sub(/\/wiki\//, '') )
12
12
  end
13
13
  end
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module Wikipedia
2
- VERSION = '1.9.0'.freeze
2
+ VERSION = '1.9.1'.freeze
3
3
  end
@@ -91,12 +91,27 @@ describe Wikipedia::Client, '.find page with one section (mocked)' do
91
91
  end
92
92
 
93
93
  describe Wikipedia::Client, '.find page with special characters in title' do
94
- it 'should properly escaped the special characters' do
94
+ before(:each) do
95
95
  @client = Wikipedia::Client.new
96
+ end
97
+
98
+ it 'should properly escape all special characters' do
96
99
  @page = @client.find('A +&%=?:/ B')
97
100
  expect(@page.title).to eq('A +&%=?:/ B')
98
101
  expect(@page.fullurl).to eq('https://en.wikipedia.org/wiki/A_%2B%26%25%3D%3F:/_B')
99
102
  end
103
+
104
+ it 'should handle pluses in article titles' do
105
+ @page = @client.find('C++')
106
+ expect(@page.title).to eq('C++')
107
+ expect(@page.fullurl).to eq('https://en.wikipedia.org/wiki/C%2B%2B')
108
+ end
109
+
110
+ it 'should handle slashes in article titles' do
111
+ @page = @client.find('PL/SQL')
112
+ expect(@page.title).to eq('PL/SQL')
113
+ expect(@page.fullurl).to eq('https://en.wikipedia.org/wiki/PL/SQL')
114
+ end
100
115
  end
101
116
 
102
117
  describe Wikipedia::Client, '.find image (mocked)' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wikipedia-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril David
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2018-02-28 00:00:00.000000000 Z
16
+ date: 2018-03-01 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: rake