wikipedia-client 1.3.3 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7eef68a91af8a59530e3a7a06412a08acf99b477
4
+ data.tar.gz: 596966793e291ab83932c917875a477ce190fc2d
5
+ SHA512:
6
+ metadata.gz: c359c00403193503828c22a2f8f7732efa8a4ce000358a0ab410dfe8831de6ba81f45d8d7bd824a5de1f6978fc400cee79ad81ed7be7264d84826bd8470ca019
7
+ data.tar.gz: b27b765f451cf19e55e2f71192fd9ca9d788b32d77b531a6246891bf45de63541c67f777e701184df7191d398fe7e86bc2499d6fd44577f00d5cd334b3dde814
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wikipedia-client (1.3.3)
4
+ wikipedia-client (1.4.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -31,7 +31,7 @@ GEM
31
31
  nokogiri (= 1.5.10)
32
32
  rake
33
33
  rdoc
34
- json (1.8.0)
34
+ json (1.8.3)
35
35
  jwt (0.1.8)
36
36
  multi_json (>= 1.5)
37
37
  multi_json (1.8.1)
@@ -69,3 +69,6 @@ DEPENDENCIES
69
69
  rspec
70
70
  thoughtbot-shoulda
71
71
  wikipedia-client!
72
+
73
+ BUNDLED WITH
74
+ 1.10.5
data/lib/wikipedia.rb CHANGED
@@ -3,13 +3,13 @@ Dir[File.dirname(__FILE__) + '/wikipedia/**/*.rb'].each { |f| require f }
3
3
  require 'uri'
4
4
 
5
5
  module Wikipedia
6
- # Examples :
7
- # page = Wikipedia.find('Rails')
6
+ # Examples :
7
+ # page = Wikipedia.find('Rails')
8
8
  # => #<Wikipedia:0x123102>
9
9
  # page.content
10
10
  # => wiki content appears here
11
-
12
- # basically just a wrapper for doing
11
+
12
+ # basically just a wrapper for doing
13
13
  # client = Wikipedia::Client.new
14
14
  # client.find('Rails')
15
15
  #
@@ -19,15 +19,18 @@ module Wikipedia
19
19
  def self.find_image( title, options = {} )
20
20
  client.find_image( title, options )
21
21
  end
22
-
22
+
23
23
  def self.Configure(&block)
24
24
  Configuration.instance.instance_eval(&block)
25
25
  end
26
-
26
+
27
27
  Configure {
28
- protocol 'http'
28
+ protocol 'https'
29
29
  domain 'en.wikipedia.org'
30
30
  path 'w/api.php'
31
+ user_agent(
32
+ 'wikipedia-client/1.3 (https://github.com/kenpratt/wikipedia-client)'
33
+ )
31
34
  }
32
35
 
33
36
  private
@@ -46,15 +46,15 @@ module Wikipedia
46
46
 
47
47
  def request( options )
48
48
  require 'open-uri'
49
- URI.parse( url_for( options ) ).read( "User-Agent" => "Ruby/#{RUBY_VERSION}" )
49
+ URI.parse( url_for( options ) ).read( "User-Agent" => Configuration[:user_agent] )
50
50
  end
51
51
 
52
52
  protected
53
53
  def configuration_options
54
54
  {
55
- :protocol => Configuration[:protocol],
56
- :domain => Configuration[:domain],
57
- :path => Configuration[:path]
55
+ :protocol => Configuration[:protocol],
56
+ :domain => Configuration[:domain],
57
+ :path => Configuration[:path],
58
58
  }
59
59
  end
60
60
 
@@ -15,11 +15,11 @@ module Wikipedia
15
15
  end
16
16
  end
17
17
  end
18
-
18
+
19
19
  def self.[](directive)
20
20
  instance.send(directive)
21
21
  end
22
-
23
- directives :protocol, :domain, :path
22
+
23
+ directives :protocol, :domain, :path, :user_agent
24
24
  end
25
25
  end
@@ -1,3 +1,3 @@
1
1
  module Wikipedia
2
- VERSION = "1.3.3"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -103,7 +103,7 @@ describe Wikipedia::Client, ".find page (Edsger_Dijkstra)" do
103
103
  it "should collect the image urls" do
104
104
  @client.follow_redirects = true
105
105
  @page = @client.find('Edsger Dijkstra')
106
- @page.image_urls.should == ["http://upload.wikimedia.org/wikipedia/commons/c/c9/Edsger_Dijkstra_1994.jpg", "http://upload.wikimedia.org/wikipedia/commons/d/d9/Edsger_Wybe_Dijkstra.jpg"]
106
+ @page.image_urls.should == ["https://upload.wikimedia.org/wikipedia/commons/c/c9/Edsger_Dijkstra_1994.jpg", "https://upload.wikimedia.org/wikipedia/commons/d/d9/Edsger_Wybe_Dijkstra.jpg"]
107
107
  end
108
108
  end
109
109
 
@@ -9,12 +9,12 @@ spec = Gem::Specification.new do |s|
9
9
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
10
 
11
11
  s.license = 'MIT'
12
- s.authors = ["Cyril David", "Ken Pratt", "Mike Haugland"]
13
- s.date = "2014-04-16"
12
+ s.authors = ["Cyril David", "Ken Pratt", "Mike Haugland", "Aishwarya Subramanian", "Pietro Menna", "Sophie Rapoport"]
13
+ s.date = "2015-06-25"
14
14
  s.description = "Ruby client for the Wikipedia API"
15
- s.email = "mike.haugland@gmail.com"
15
+ s.email = "ken@kenpratt.net"
16
16
 
17
- s.homepage = "http://github.com/mhaugland/wikipedia-client"
17
+ s.homepage = "http://github.com/kenpratt/wikipedia-client"
18
18
  s.rubygems_version = "1.8.23"
19
19
  s.summary = "Ruby client for the Wikipedia API"
20
20
  s.platform = Gem::Platform::RUBY
@@ -33,6 +33,7 @@ spec = Gem::Specification.new do |s|
33
33
  s.add_development_dependency('rdoc')
34
34
  s.add_development_dependency('jeweler')
35
35
 
36
+
36
37
  if s.respond_to? :specification_version then
37
38
  s.specification_version = 3
38
39
 
metadata CHANGED
@@ -1,106 +1,98 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wikipedia-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
5
- prerelease:
4
+ version: 1.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Cyril David
9
8
  - Ken Pratt
10
9
  - Mike Haugland
10
+ - Aishwarya Subramanian
11
+ - Pietro Menna
12
+ - Sophie Rapoport
11
13
  autorequire:
12
14
  bindir: bin
13
15
  cert_chain: []
14
- date: 2014-04-16 00:00:00.000000000 Z
16
+ date: 2015-06-25 00:00:00.000000000 Z
15
17
  dependencies:
16
18
  - !ruby/object:Gem::Dependency
17
19
  name: rake
18
20
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
21
  requirements:
21
- - - ! '>='
22
+ - - ">="
22
23
  - !ruby/object:Gem::Version
23
24
  version: '0'
24
25
  type: :development
25
26
  prerelease: false
26
27
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
28
  requirements:
29
- - - ! '>='
29
+ - - ">="
30
30
  - !ruby/object:Gem::Version
31
31
  version: '0'
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: rspec
34
34
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
35
  requirements:
37
- - - ! '>='
36
+ - - ">="
38
37
  - !ruby/object:Gem::Version
39
38
  version: '0'
40
39
  type: :development
41
40
  prerelease: false
42
41
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
42
  requirements:
45
- - - ! '>='
43
+ - - ">="
46
44
  - !ruby/object:Gem::Version
47
45
  version: '0'
48
46
  - !ruby/object:Gem::Dependency
49
47
  name: rdoc
50
48
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
49
  requirements:
53
- - - ! '>='
50
+ - - ">="
54
51
  - !ruby/object:Gem::Version
55
52
  version: '0'
56
53
  type: :development
57
54
  prerelease: false
58
55
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
56
  requirements:
61
- - - ! '>='
57
+ - - ">="
62
58
  - !ruby/object:Gem::Version
63
59
  version: '0'
64
60
  - !ruby/object:Gem::Dependency
65
61
  name: jeweler
66
62
  requirement: !ruby/object:Gem::Requirement
67
- none: false
68
63
  requirements:
69
- - - ! '>='
64
+ - - ">="
70
65
  - !ruby/object:Gem::Version
71
66
  version: '0'
72
67
  type: :development
73
68
  prerelease: false
74
69
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
70
  requirements:
77
- - - ! '>='
71
+ - - ">="
78
72
  - !ruby/object:Gem::Version
79
73
  version: '0'
80
74
  - !ruby/object:Gem::Dependency
81
75
  name: thoughtbot-shoulda
82
76
  requirement: !ruby/object:Gem::Requirement
83
- none: false
84
77
  requirements:
85
- - - ! '>='
78
+ - - ">="
86
79
  - !ruby/object:Gem::Version
87
80
  version: '0'
88
81
  type: :development
89
82
  prerelease: false
90
83
  version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
84
  requirements:
93
- - - ! '>='
85
+ - - ">="
94
86
  - !ruby/object:Gem::Version
95
87
  version: '0'
96
88
  description: Ruby client for the Wikipedia API
97
- email: mike.haugland@gmail.com
89
+ email: ken@kenpratt.net
98
90
  executables: []
99
91
  extensions: []
100
92
  extra_rdoc_files:
101
93
  - README.textile
102
94
  files:
103
- - .gitignore
95
+ - ".gitignore"
104
96
  - Gemfile
105
97
  - Gemfile.lock
106
98
  - MIT-LICENSE
@@ -152,33 +144,32 @@ files:
152
144
  - tasks/wikipedia_tasks.rake
153
145
  - uninstall.rb
154
146
  - wikipedia-client.gemspec
155
- homepage: http://github.com/mhaugland/wikipedia-client
147
+ homepage: http://github.com/kenpratt/wikipedia-client
156
148
  licenses:
157
149
  - MIT
150
+ metadata: {}
158
151
  post_install_message:
159
152
  rdoc_options:
160
- - --title
153
+ - "--title"
161
154
  - wikipedia-client
162
- - --main
163
- - -ri
155
+ - "--main"
156
+ - "-ri"
164
157
  require_paths:
165
158
  - lib
166
159
  - lib
167
160
  required_ruby_version: !ruby/object:Gem::Requirement
168
- none: false
169
161
  requirements:
170
- - - ! '>='
162
+ - - ">="
171
163
  - !ruby/object:Gem::Version
172
164
  version: '0'
173
165
  required_rubygems_version: !ruby/object:Gem::Requirement
174
- none: false
175
166
  requirements:
176
- - - ! '>='
167
+ - - ">="
177
168
  - !ruby/object:Gem::Version
178
169
  version: '0'
179
170
  requirements: []
180
171
  rubyforge_project:
181
- rubygems_version: 1.8.23
172
+ rubygems_version: 2.4.5
182
173
  signing_key:
183
174
  specification_version: 3
184
175
  summary: Ruby client for the Wikipedia API