wikipedia-client 1.6.4 → 1.7.0

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
  SHA1:
3
- metadata.gz: e089650b23ba504667789874fd323f5b1d390748
4
- data.tar.gz: dca70f883ac007d84802bb7a60ddae8139683f93
3
+ metadata.gz: 4d6ed4bb192a667887ef04c277ad4eaf97df8c17
4
+ data.tar.gz: fbe125b740c244cbfa3e6331173d010e297561bc
5
5
  SHA512:
6
- metadata.gz: 3493584b84a4c54b164a0cc97c9499574394bb50014b4ab88764c569a20520daf0666cb9878c3dafab6d8225b6c4c196af73697ae3f6ed7f9ef85f704a3da060
7
- data.tar.gz: 1606ba0242ff30cbd0ff9ad405ab3efa734c2d22c1f51764b1e93b6140b578d65f61e2e7810e347b95200dfe4d082314b350b5a986def757e8cc7b94639ecfc6
6
+ metadata.gz: 55c76474579183cabf2723533472b40bf49fdb8f1265a7f3b001a2b6546defe2c776e6e28001e96607bd314847c8e04fdecc2e68b2709487e8e040e1a11a63c8
7
+ data.tar.gz: 9277b3ebf017c75ec101df7d8b03afedf5235b02b2c7e7f223216e95fc445cd5cc4ce01c11587568ca0acf3f9dd9d8db9acce8b427ea664cff65c40691b3079b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wikipedia-client (1.6.4)
4
+ wikipedia-client (1.7.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -9,7 +9,7 @@ GEM
9
9
  addressable (2.3.5)
10
10
  ast (2.3.0)
11
11
  builder (3.2.2)
12
- diff-lcs (1.2.4)
12
+ diff-lcs (1.3)
13
13
  faraday (0.8.8)
14
14
  multipart-post (~> 1.2.0)
15
15
  git (1.2.6)
@@ -32,7 +32,7 @@ GEM
32
32
  nokogiri (= 1.5.10)
33
33
  rake
34
34
  rdoc
35
- json (1.8.3)
35
+ json (1.8.6)
36
36
  jwt (0.1.8)
37
37
  multi_json (>= 1.5)
38
38
  multi_json (1.8.1)
@@ -55,14 +55,18 @@ GEM
55
55
  rake (10.1.0)
56
56
  rdoc (4.0.1)
57
57
  json (~> 1.4)
58
- rspec (2.14.1)
59
- rspec-core (~> 2.14.0)
60
- rspec-expectations (~> 2.14.0)
61
- rspec-mocks (~> 2.14.0)
62
- rspec-core (2.14.5)
63
- rspec-expectations (2.14.3)
64
- diff-lcs (>= 1.1.3, < 2.0)
65
- rspec-mocks (2.14.3)
58
+ rspec (3.0.0)
59
+ rspec-core (~> 3.0.0)
60
+ rspec-expectations (~> 3.0.0)
61
+ rspec-mocks (~> 3.0.0)
62
+ rspec-core (3.0.4)
63
+ rspec-support (~> 3.0.0)
64
+ rspec-expectations (3.0.4)
65
+ diff-lcs (>= 1.2.0, < 2.0)
66
+ rspec-support (~> 3.0.0)
67
+ rspec-mocks (3.0.4)
68
+ rspec-support (~> 3.0.0)
69
+ rspec-support (3.0.4)
66
70
  rubocop (0.48.1)
67
71
  parser (>= 2.3.3.1, < 3.0)
68
72
  powerpack (~> 0.1)
@@ -77,13 +81,13 @@ PLATFORMS
77
81
  ruby
78
82
 
79
83
  DEPENDENCIES
80
- jeweler
81
- rake
82
- rdoc
83
- rspec
84
- rubocop
85
- thoughtbot-shoulda
84
+ jeweler (~> 1.8)
85
+ rake (~> 10.1)
86
+ rdoc (~> 4.0)
87
+ rspec (~> 3.0)
88
+ rubocop (~> 0.48)
89
+ thoughtbot-shoulda (~> 2.11, >= 2.11)
86
90
  wikipedia-client!
87
91
 
88
92
  BUNDLED WITH
89
- 1.15.0
93
+ 1.15.1
@@ -39,7 +39,7 @@ module Wikipedia
39
39
  domain 'en.wikipedia.org'
40
40
  path 'w/api.php'
41
41
  user_agent(
42
- 'wikipedia-client/1.3 (https://github.com/kenpratt/wikipedia-client)'
42
+ 'wikipedia-client/1.7 (https://github.com/kenpratt/wikipedia-client)'
43
43
  )
44
44
  end
45
45
 
@@ -1,3 +1,3 @@
1
1
  module Wikipedia
2
- VERSION = '1.6.4'.freeze
2
+ VERSION = '1.7.0'.freeze
3
3
  end
@@ -7,7 +7,7 @@ describe Wikipedia::Client, '.find page (mocked)' do
7
7
  @client = Wikipedia::Client.new
8
8
  @edsger_dijkstra = File.read(File.dirname(__FILE__) + '/../fixtures/Edsger_Dijkstra.json')
9
9
  @edsger_content = JSON.parse(File.read(File.dirname(__FILE__) + '/../fixtures/Edsger_content.txt'))['content']
10
- @client.should_receive(:request).and_return(@edsger_dijkstra)
10
+ expect(@client).to receive(:request).and_return(@edsger_dijkstra)
11
11
  end
12
12
 
13
13
  it 'should execute a request for the page' do
@@ -15,27 +15,27 @@ describe Wikipedia::Client, '.find page (mocked)' do
15
15
  end
16
16
 
17
17
  it 'should return a page object' do
18
- @client.find('Edsger_Dijkstra').should be_an_instance_of(Wikipedia::Page)
18
+ expect(@client.find('Edsger_Dijkstra')).to be_an_instance_of(Wikipedia::Page)
19
19
  end
20
20
 
21
21
  it 'should return a page with the correct content' do
22
22
  @page = @client.find('Edsger_Dijkstra')
23
- @page.content.should == @edsger_content
23
+ expect(@page.content).to eq(@edsger_content)
24
24
  end
25
25
 
26
26
  it 'should return a page with a title of Edsger W. Dijkstra' do
27
27
  @page = @client.find('Edsger_Dijkstra')
28
- @page.title.should == 'Edsger W. Dijkstra'
28
+ expect(@page.title).to eq('Edsger W. Dijkstra')
29
29
  end
30
30
 
31
31
  it 'should return a page with the correct URL' do
32
32
  @page = @client.find('Edsger_Dijkstra')
33
- @page.fullurl.should == 'http://en.wikipedia.org/wiki/Edsger_W._Dijkstra'
33
+ expect(@page.fullurl).to eq('http://en.wikipedia.org/wiki/Edsger_W._Dijkstra')
34
34
  end
35
35
 
36
36
  it 'should return a page with the correct plain text extract' do
37
37
  @page = @client.find('Edsger_Dijkstra')
38
- @page.text.should start_with 'Edsger Wybe Dijkstra (Dutch pronunciation: '
38
+ expect(@page.text).to start_with 'Edsger Wybe Dijkstra (Dutch pronunciation: '
39
39
  end
40
40
 
41
41
  it 'should return a page with categories' do
@@ -47,7 +47,7 @@ describe Wikipedia::Client, '.find page (mocked)' do
47
47
  'Category:Dutch physicists', 'Category:Articles needing cleanup from April 2009',
48
48
  'Category:All pages needing cleanup', 'Category:Dutch computer scientists'
49
49
  ].each do |category|
50
- @page.categories.should include(category)
50
+ expect(@page.categories).to include(category)
51
51
  end
52
52
  end
53
53
 
@@ -57,7 +57,7 @@ describe Wikipedia::Client, '.find page (mocked)' do
57
57
  'ALGOL', 'Alan Kay', 'ALGOL 60', 'Agile software development', 'ACM Turing Award',
58
58
  'Algorithm', 'Adi Shamir', 'Alan Perlis', 'Allen Newell', 'Adriaan van Wijngaarden'
59
59
  ].each do |link|
60
- @page.links.should include(link)
60
+ expect(@page.links).to include(link)
61
61
  end
62
62
  end
63
63
 
@@ -70,7 +70,7 @@ describe Wikipedia::Client, '.find page (mocked)' do
70
70
  'File:Copyright-problem.svg',
71
71
  'File:Edsger Wybe Dijkstra.jpg'
72
72
  ].each do |file|
73
- @page.images.should include(file)
73
+ expect(@page.images).to include(file)
74
74
  end
75
75
  end
76
76
  end
@@ -81,12 +81,12 @@ describe Wikipedia::Client, '.find page with one section (mocked)' do
81
81
  dir_name = File.dirname(__FILE__)
82
82
  @edsger_dijkstra = File.read(dir_name + '/../fixtures/Edsger_Dijkstra_section_0.json')
83
83
  @edsger_content = File.read(dir_name + '/../fixtures/sanitization_samples/Edsger_W_Dijkstra-sanitized.txt').strip
84
- @client.should_receive(:request).and_return(@edsger_dijkstra)
84
+ expect(@client).to receive(:request).and_return(@edsger_dijkstra)
85
85
  end
86
86
 
87
87
  it 'should have the correct sanitized intro' do
88
88
  @page = @client.find('Edsger_Dijkstra', rvsection: 0)
89
- @page.sanitized_content.should == @edsger_content
89
+ expect(@page.sanitized_content).to eq(@edsger_content)
90
90
  end
91
91
  end
92
92
 
@@ -94,7 +94,7 @@ describe Wikipedia::Client, '.find image (mocked)' do
94
94
  before(:each) do
95
95
  @client = Wikipedia::Client.new
96
96
  @edsger_dijkstra = File.read(File.dirname(__FILE__) + '/../fixtures/File_Edsger_Wybe_Dijkstra_jpg.json')
97
- @client.should_receive(:request).and_return(@edsger_dijkstra)
97
+ expect(@client).to receive(:request).and_return(@edsger_dijkstra)
98
98
  end
99
99
 
100
100
  it 'should execute a request for the image' do
@@ -102,17 +102,17 @@ describe Wikipedia::Client, '.find image (mocked)' do
102
102
  end
103
103
 
104
104
  it 'should return a page object' do
105
- @client.find_image('File:Edsger Wybe Dijkstra.jpg').should be_an_instance_of(Wikipedia::Page)
105
+ expect(@client.find_image('File:Edsger Wybe Dijkstra.jpg')).to be_an_instance_of(Wikipedia::Page)
106
106
  end
107
107
 
108
108
  it 'should return a page with a title of File:Edsger Wybe Dijkstra.jpg' do
109
109
  @page = @client.find_image('File:Edsger Wybe Dijkstra.jpg')
110
- @page.title.should == 'File:Edsger Wybe Dijkstra.jpg'
110
+ expect(@page.title).to eq('File:Edsger Wybe Dijkstra.jpg')
111
111
  end
112
112
 
113
113
  it 'should return a page with an image url' do
114
114
  @page = @client.find_image('File:Edsger Wybe Dijkstra.jpg')
115
- @page.image_url.should == 'http://upload.wikimedia.org/wikipedia/commons/d/d9/Edsger_Wybe_Dijkstra.jpg'
115
+ expect(@page.image_url).to eq('http://upload.wikimedia.org/wikipedia/commons/d/d9/Edsger_Wybe_Dijkstra.jpg')
116
116
  end
117
117
  end
118
118
 
@@ -124,13 +124,13 @@ describe Wikipedia::Client, '.find page (Edsger_Dijkstra)' do
124
124
 
125
125
  it 'should get a redirect when trying Edsger Dijkstra' do
126
126
  @page = @client.find('Edsger Dijkstra')
127
- @page.should be_redirect
127
+ expect(@page).to be_redirect
128
128
  end
129
129
 
130
130
  it 'should get a final page when follow_redirects is true' do
131
131
  @client.follow_redirects = true
132
132
  @page = @client.find('Edsger Dijkstra')
133
- @page.should_not be_redirect
133
+ expect(@page).not_to be_redirect
134
134
  end
135
135
 
136
136
  it 'should collect the image urls' do
@@ -147,7 +147,7 @@ describe Wikipedia::Client, '.find page (Edsger_Dijkstra)' do
147
147
  '/commons/7/7b/An_illustration_of_the_dining_philosophers_problem.png',
148
148
  '/commons/3/37/Detail_of_a_1Kb_ferrite_core_RAM-module_of_an_1960s_Electrologica_X1_computer.jpg'
149
149
  ].each do |image|
150
- @page.image_urls.should include('https://upload.wikimedia.org/wikipedia' + image)
150
+ expect(@page.image_urls).to include('https://upload.wikimedia.org/wikipedia' + image)
151
151
  end
152
152
  end
153
153
  end
@@ -161,13 +161,13 @@ describe Wikipedia::Client, '.find page (Rails) at jp' do
161
161
 
162
162
  it 'should get a redirect when trying Rails' do
163
163
  @page = @client.find('Rails')
164
- @page.should be_redirect
164
+ expect(@page).to be_redirect
165
165
  end
166
166
 
167
167
  it 'should get a final page when follow_redirects is true' do
168
168
  @client.follow_redirects = true
169
169
  @page = @client.find('Rails')
170
- @page.should_not be_redirect
170
+ expect(@page).not_to be_redirect
171
171
  end
172
172
  end
173
173
 
@@ -179,7 +179,7 @@ describe Wikipedia::Client, '.find random page' do
179
179
  it 'should get random pages' do
180
180
  @page1 = @client.find_random.title
181
181
  @page2 = @client.find_random.title
182
- @page1.should_not == @page2
182
+ expect(@page1).not_to eq(@page2)
183
183
  end
184
184
  end
185
185
 
@@ -188,16 +188,16 @@ describe Wikipedia::Client, 'page.summary (mocked)' do
188
188
  @client = Wikipedia::Client.new
189
189
  @edsger_dijkstra = File.read(File.dirname(__FILE__) + '/../fixtures/Edsger_Dijkstra.json')
190
190
  @edsger_content = JSON.parse(File.read(File.dirname(__FILE__) + '/../fixtures/Edsger_content.txt'))['content']
191
- @client.should_receive(:request).and_return(@edsger_dijkstra)
191
+ expect(@client).to receive(:request).and_return(@edsger_dijkstra)
192
192
  end
193
193
 
194
194
  it 'should return only the summary' do
195
195
  @page = @client.find('Edsger_Dijkstra')
196
- @page.summary.should == 'Edsger Wybe Dijkstra (Dutch pronunciation: [ˈɛtsxər ˈʋibə ˈdɛikstra] ( );'\
196
+ expect(@page.summary).to eq('Edsger Wybe Dijkstra (Dutch pronunciation: [ˈɛtsxər ˈʋibə ˈdɛikstra] ( );'\
197
197
  ' 11 May 1930 – 6 August 2002) was a Dutch computer scientist. He received the 1972 Turing Award for fundamental'\
198
198
  ' contributions to developing programming languages, and was the Schlumberger Centennial Chair of Computer'\
199
199
  " Sciences at The University of Texas at Austin from 1984 until 2000.\nShortly before his death in 2002, he"\
200
200
  ' received the ACM PODC Influential Paper Award in distributed computing for his work on self-stabilization of'\
201
- ' program computation. This annual award was renamed the Dijkstra Prize the following year, in his honor.'
201
+ ' program computation. This annual award was renamed the Dijkstra Prize the following year, in his honor.')
202
202
  end
203
203
  end
@@ -8,7 +8,7 @@ describe Wikipedia::Page, '.sanitize wiki markup' do
8
8
  it "should sanitize #{name} properly" do
9
9
  @raw = File.read(raw_filename)
10
10
  @sanitized = File.read(sanitized_filename).strip
11
- Wikipedia::Page.sanitize(@raw).strip.should == @sanitized
11
+ expect(Wikipedia::Page.sanitize(@raw).strip).to eq(@sanitized)
12
12
  end
13
13
  end
14
14
  end
@@ -3,6 +3,6 @@ require File.dirname(__FILE__) + '/../spec_helper'
3
3
  describe Wikipedia::Url, 'like http://en.wikipedia.org/wiki/Getting_Things_Done' do
4
4
  it 'should have a title of Getting_Things_Done' do
5
5
  url = Wikipedia::Url.new('http://en.wikipedia.org/wiki/Getting_Things_Done')
6
- url.title.should == 'Getting_Things_Done'
6
+ expect(url.title).to eq('Getting_Things_Done')
7
7
  end
8
8
  end
@@ -3,18 +3,18 @@ require File.dirname(__FILE__) + '/../spec_helper'
3
3
  describe Wikipedia, '.find' do
4
4
  it 'should return a Wikipedia::Page instance' do
5
5
  page = Wikipedia.find('Getting_Things_Done')
6
- page.should be_an_instance_of(Wikipedia::Page)
6
+ expect(page).to be_an_instance_of(Wikipedia::Page)
7
7
  end
8
8
 
9
9
  it 'should return a Page with a title' do
10
10
  page = Wikipedia.find('Getting_Things_Done')
11
- page.title.should_not be_nil
11
+ expect(page.title).not_to be_nil
12
12
  end
13
13
 
14
14
  it 'should return a Page given a URL' do
15
15
  page1 = Wikipedia.find('Getting_Things_Done')
16
16
 
17
17
  page2 = Wikipedia.find('http://en.wikipedia.org/wiki/Getting_Things_Done')
18
- page1.title.should == page2.title
18
+ expect(page1.title).to eq(page2.title)
19
19
  end
20
20
  end
@@ -32,17 +32,17 @@ Gem::Specification.new do |s|
32
32
  s.require_paths << 'lib'
33
33
  s.rdoc_options << '--title' << 'wikipedia-client' << '--main' << '-ri'
34
34
 
35
- s.add_development_dependency('rake')
36
- s.add_development_dependency('rspec')
37
- s.add_development_dependency('rdoc')
38
- s.add_development_dependency('jeweler')
39
- s.add_development_dependency('rubocop')
35
+ s.add_development_dependency('rake', '~> 10.1')
36
+ s.add_development_dependency('rspec', '~> 3.0')
37
+ s.add_development_dependency('rdoc', '~> 4.0')
38
+ s.add_development_dependency('jeweler', '~> 1.8')
39
+ s.add_development_dependency('rubocop', '~> 0.48')
40
40
 
41
41
  if s.respond_to? :specification_version
42
42
  s.specification_version = 3
43
43
 
44
44
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0')
45
- s.add_development_dependency('thoughtbot-shoulda', ['>= 0'])
45
+ s.add_development_dependency('thoughtbot-shoulda', '~> 2.11', ['>= 2.11'])
46
46
  else
47
47
  s.add_dependency('thoughtbot-shoulda', ['>= 0'])
48
48
  end
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.6.4
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril David
@@ -13,92 +13,98 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2017-05-24 00:00:00.000000000 Z
16
+ date: 2017-06-20 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: rake
20
20
  requirement: !ruby/object:Gem::Requirement
21
21
  requirements:
22
- - - ">="
22
+ - - "~>"
23
23
  - !ruby/object:Gem::Version
24
- version: '0'
24
+ version: '10.1'
25
25
  type: :development
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
28
28
  requirements:
29
- - - ">="
29
+ - - "~>"
30
30
  - !ruby/object:Gem::Version
31
- version: '0'
31
+ version: '10.1'
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: rspec
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - ">="
36
+ - - "~>"
37
37
  - !ruby/object:Gem::Version
38
- version: '0'
38
+ version: '3.0'
39
39
  type: :development
40
40
  prerelease: false
41
41
  version_requirements: !ruby/object:Gem::Requirement
42
42
  requirements:
43
- - - ">="
43
+ - - "~>"
44
44
  - !ruby/object:Gem::Version
45
- version: '0'
45
+ version: '3.0'
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: rdoc
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  requirements:
50
- - - ">="
50
+ - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: '0'
52
+ version: '4.0'
53
53
  type: :development
54
54
  prerelease: false
55
55
  version_requirements: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - ">="
57
+ - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '0'
59
+ version: '4.0'
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: jeweler
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - ">="
64
+ - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: '0'
66
+ version: '1.8'
67
67
  type: :development
68
68
  prerelease: false
69
69
  version_requirements: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - ">="
71
+ - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '0'
73
+ version: '1.8'
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: rubocop
76
76
  requirement: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - ">="
78
+ - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: '0'
80
+ version: '0.48'
81
81
  type: :development
82
82
  prerelease: false
83
83
  version_requirements: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - ">="
85
+ - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '0'
87
+ version: '0.48'
88
88
  - !ruby/object:Gem::Dependency
89
89
  name: thoughtbot-shoulda
90
90
  requirement: !ruby/object:Gem::Requirement
91
91
  requirements:
92
+ - - "~>"
93
+ - !ruby/object:Gem::Version
94
+ version: '2.11'
92
95
  - - ">="
93
96
  - !ruby/object:Gem::Version
94
- version: '0'
97
+ version: '2.11'
95
98
  type: :development
96
99
  prerelease: false
97
100
  version_requirements: !ruby/object:Gem::Requirement
98
101
  requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '2.11'
99
105
  - - ">="
100
106
  - !ruby/object:Gem::Version
101
- version: '0'
107
+ version: '2.11'
102
108
  description: Ruby client for the Wikipedia API
103
109
  email: ken@kenpratt.net
104
110
  executables: []