wikipedia-client 1.5.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.textile +5 -1
- data/lib/wikipedia/page.rb +4 -0
- data/lib/wikipedia/version.rb +1 -1
- data/spec/lib/client_spec.rb +16 -1
- data/wikipedia-client.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 090668f5915b9abd761c0fe9d56c78fbe0256ce2
|
4
|
+
data.tar.gz: 1dd3784a3b1037bd339276aeaeca838cbc173706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17c3a86c983353487bd6a6b8b03ef8f77977c8c33b7637da09c277019e13c32132560bb688b46fb64a777b901406ea85b652b34df103665e432fd94afc897898
|
7
|
+
data.tar.gz: 7b01485a0265a17092e0f4215772206db97b9cb73760d8b040e8be29cde7ed646f3154c57e1cf8bd5d0057e695290768c153797e6c86f58c9b1bfdb1bcde22af
|
data/Gemfile.lock
CHANGED
data/README.textile
CHANGED
@@ -36,6 +36,10 @@ page.content
|
|
36
36
|
|
37
37
|
=> # all the wiki markup appears here...
|
38
38
|
|
39
|
+
page.summary
|
40
|
+
|
41
|
+
=> # only the wiki summary appears here...
|
42
|
+
|
39
43
|
page.categories
|
40
44
|
|
41
45
|
=> [..., "Category:Self-help books", ...]
|
@@ -117,7 +121,7 @@ Build the gem: <code>bundle exec gem build wikipedia-client.gemspec</code>
|
|
117
121
|
|
118
122
|
Commit the changes: <code>git commit -a -m 'Version bump to 1.4.0' && git push</code>
|
119
123
|
|
120
|
-
Publish the
|
124
|
+
Publish the result to RubyGems: <code>bundle exec gem push wikipedia-client-1.4.0.gem</code>
|
121
125
|
|
122
126
|
h2. Thanks!
|
123
127
|
|
data/lib/wikipedia/page.rb
CHANGED
data/lib/wikipedia/version.rb
CHANGED
data/spec/lib/client_spec.rb
CHANGED
@@ -113,7 +113,7 @@ describe Wikipedia::Client, ".find page (Edsger_Dijkstra)" do
|
|
113
113
|
it "should collect the image urls" do
|
114
114
|
@client.follow_redirects = true
|
115
115
|
@page = @client.find('Edsger Dijkstra')
|
116
|
-
@page.image_urls.should == ["https://upload.wikimedia.org/wikipedia/en/4/4a/Commons-logo.svg", "https://upload.wikimedia.org/wikipedia/commons/c/c9/Edsger_Dijkstra_1994.jpg", "https://upload.wikimedia.org/wikipedia/commons/d/d9/Edsger_Wybe_Dijkstra.jpg", "https://upload.wikimedia.org/wikipedia/en/4/48/Folder_Hexagonal_Icon.svg", "https://upload.wikimedia.org/wikipedia/commons/2/21/Speaker_Icon.svg", "https://upload.wikimedia.org/wikipedia/commons/f/fa/Wikiquote-logo.svg"]
|
116
|
+
@page.image_urls.should == ["https://upload.wikimedia.org/wikipedia/en/4/4a/Commons-logo.svg", "https://upload.wikimedia.org/wikipedia/commons/5/57/Dijkstra_Animation.gif", "https://upload.wikimedia.org/wikipedia/commons/6/6a/Dining_philosophers.png", "https://upload.wikimedia.org/wikipedia/commons/c/c9/Edsger_Dijkstra_1994.jpg", "https://upload.wikimedia.org/wikipedia/commons/d/d9/Edsger_Wybe_Dijkstra.jpg", "https://upload.wikimedia.org/wikipedia/en/4/48/Folder_Hexagonal_Icon.svg", "https://upload.wikimedia.org/wikipedia/commons/7/7b/Rail-semaphore-signal-Dave-F.jpg", "https://upload.wikimedia.org/wikipedia/commons/2/21/Speaker_Icon.svg", "https://upload.wikimedia.org/wikipedia/commons/f/fa/Wikiquote-logo.svg"]
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
@@ -147,3 +147,18 @@ describe Wikipedia::Client, ".find random page" do
|
|
147
147
|
@page1.should_not == @page2
|
148
148
|
end
|
149
149
|
end
|
150
|
+
|
151
|
+
describe Wikipedia::Client, "page.summary (mocked)" do
|
152
|
+
before(:each) do
|
153
|
+
@client = Wikipedia::Client.new
|
154
|
+
@edsger_dijkstra = File.read(File.dirname(__FILE__) + '/../fixtures/Edsger_Dijkstra.json')
|
155
|
+
@edsger_content = JSON::load(File.read(File.dirname(__FILE__) + '/../fixtures/Edsger_content.txt'))['content']
|
156
|
+
@client.should_receive(:request).and_return(@edsger_dijkstra)
|
157
|
+
end
|
158
|
+
|
159
|
+
it "should return only the summary" do
|
160
|
+
@page = @client.find('Edsger_Dijkstra')
|
161
|
+
@page.summary.should == 'Edsger Wybe Dijkstra (Dutch pronunciation: [ˈɛtsxər ˈʋibə ˈdɛikstra] ( ); 11 May 1930 – 6 August 2002) was a Dutch computer scientist. He received the 1972 Turing Award for fundamental contributions to developing programming languages, and was the Schlumberger Centennial Chair of Computer Sciences at The University of Texas at Austin from 1984 until 2000.
|
162
|
+
Shortly before his death in 2002, he received the ACM PODC Influential Paper Award in distributed computing for his work on self-stabilization of program computation. This annual award was renamed the Dijkstra Prize the following year, in his honor.'
|
163
|
+
end
|
164
|
+
end
|
data/wikipedia-client.gemspec
CHANGED
@@ -10,7 +10,7 @@ spec = Gem::Specification.new do |s|
|
|
10
10
|
|
11
11
|
s.license = 'MIT'
|
12
12
|
s.authors = ["Cyril David", "Ken Pratt", "Mike Haugland", "Aishwarya Subramanian", "Pietro Menna", "Sophie Rapoport"]
|
13
|
-
s.date = "
|
13
|
+
s.date = "2016-01-03"
|
14
14
|
s.description = "Ruby client for the Wikipedia API"
|
15
15
|
s.email = "ken@kenpratt.net"
|
16
16
|
|
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.
|
4
|
+
version: 1.6.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:
|
16
|
+
date: 2016-01-03 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: rake
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
version: '0'
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.4.
|
173
|
+
rubygems_version: 2.4.5.1
|
174
174
|
signing_key:
|
175
175
|
specification_version: 3
|
176
176
|
summary: Ruby client for the Wikipedia API
|