Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

adding protocol support to configuration

  • Loading branch information...
commit b0008cde490b4165fce211a06bf9032c7d06e4f3 1 parent 774c894
Mike Haugland authored mhaugland committed
6 Rakefile
@@ -7,9 +7,9 @@ begin
7 7 gem.name = "wikipedia-client"
8 8 gem.summary = %Q{Ruby client for the Wikipedia API}
9 9 gem.description = %Q{Ruby client for the Wikipedia API}
10   - gem.email = "christian.hellsten@gmail.com"
11   - gem.homepage = "http://github.com/christianhellsten/wikipedia-client"
12   - gem.authors = ["Cyril David", "Ken Pratt"]
  10 + gem.email = "mike.haugland@gmail.com"
  11 + gem.homepage = "http://github.com/mhaugland/wikipedia-client"
  12 + gem.authors = ["Cyril David", "Ken Pratt", "Mike Haugland"]
13 13 gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
14 14 # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15 15 end
5 lib/wikipedia.rb
@@ -25,8 +25,9 @@ def self.Configure(&block)
25 25 end
26 26
27 27 Configure {
28   - domain 'en.wikipedia.org'
29   - path 'w/api.php'
  28 + protocol 'http'
  29 + domain 'en.wikipedia.org'
  30 + path 'w/api.php'
30 31 }
31 32
32 33 private
7 lib/wikipedia/client.rb
... ... @@ -1,7 +1,7 @@
1 1 module Wikipedia
2 2 class Client
3 3 # see http://en.wikipedia.org/w/api.php
4   - BASE_URL = "http://:domain/:path?action=:action&format=json"
  4 + BASE_URL = ":protocol://:domain/:path?action=:action&format=json"
5 5
6 6 attr_accessor :follow_redirects
7 7
@@ -51,8 +51,9 @@ def request( options )
51 51 protected
52 52 def configuration_options
53 53 {
54   - :domain => Configuration[:domain],
55   - :path => Configuration[:path]
  54 + :protocol => Configuration[:protocol],
  55 + :domain => Configuration[:domain],
  56 + :path => Configuration[:path]
56 57 }
57 58 end
58 59
2  lib/wikipedia/configuration.rb
@@ -20,6 +20,6 @@ def self.[](directive)
20 20 instance.send(directive)
21 21 end
22 22
23   - directives :domain, :path
  23 + directives :protocol, :domain, :path
24 24 end
25 25 end
20 wikipedia-client.gemspec
@@ -5,18 +5,19 @@
5 5
6 6 Gem::Specification.new do |s|
7 7 s.name = %q{wikipedia-client}
8   - s.version = "0.0.0"
  8 + s.version = "1.0.1"
9 9
10 10 s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11   - s.authors = ["Cyril David", "Ken Pratt"]
12   - s.date = %q{2010-08-09}
  11 + s.authors = ["Cyril David", "Ken Pratt", "Mike Haugland"]
  12 + s.date = %q{2010-08-30}
13 13 s.description = %q{Ruby client for the Wikipedia API}
14   - s.email = %q{christian.hellsten@gmail.com}
  14 + s.email = %q{mike.haugland@gmail.com}
15 15 s.extra_rdoc_files = [
16 16 "README.textile"
17 17 ]
18 18 s.files = [
19   - "MIT-LICENSE",
  19 + ".gitignore",
  20 + "MIT-LICENSE",
20 21 "README.textile",
21 22 "Rakefile",
22 23 "VERSION",
@@ -63,12 +64,13 @@ Gem::Specification.new do |s|
63 64 "spec/lib/wikipedia_spec.rb",
64 65 "spec/spec_helper.rb",
65 66 "tasks/wikipedia_tasks.rake",
66   - "uninstall.rb"
  67 + "uninstall.rb",
  68 + "wikipedia-client.gemspec"
67 69 ]
68   - s.homepage = %q{http://github.com/christianhellsten/wikipedia-client}
  70 + s.homepage = %q{http://github.com/mhaugland/wikipedia-client}
69 71 s.rdoc_options = ["--charset=UTF-8"]
70 72 s.require_paths = ["lib"]
71   - s.rubygems_version = %q{1.3.7}
  73 + s.rubygems_version = %q{1.3.5}
72 74 s.summary = %q{Ruby client for the Wikipedia API}
73 75 s.test_files = [
74 76 "spec/lib/client_spec.rb",
@@ -82,7 +84,7 @@ Gem::Specification.new do |s|
82 84 current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
83 85 s.specification_version = 3
84 86
85   - if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
  87 + if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
86 88 s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
87 89 else
88 90 s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])

0 comments on commit b0008cd

Please sign in to comment.
Something went wrong with that request. Please try again.