Permalink
Browse files

adding protocol support to configuration

  • Loading branch information...
1 parent 774c894 commit b0008cde490b4165fce211a06bf9032c7d06e4f3 Mike Haugland committed with mhaugland Aug 30, 2010
Showing with 22 additions and 18 deletions.
  1. +3 −3 Rakefile
  2. +3 −2 lib/wikipedia.rb
  3. +4 −3 lib/wikipedia/client.rb
  4. +1 −1 lib/wikipedia/configuration.rb
  5. +11 −9 wikipedia-client.gemspec
View
@@ -7,9 +7,9 @@ begin
gem.name = "wikipedia-client"
gem.summary = %Q{Ruby client for the Wikipedia API}
gem.description = %Q{Ruby client for the Wikipedia API}
- gem.email = "christian.hellsten@gmail.com"
- gem.homepage = "http://github.com/christianhellsten/wikipedia-client"
- gem.authors = ["Cyril David", "Ken Pratt"]
+ gem.email = "mike.haugland@gmail.com"
+ gem.homepage = "http://github.com/mhaugland/wikipedia-client"
+ gem.authors = ["Cyril David", "Ken Pratt", "Mike Haugland"]
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
View
@@ -25,8 +25,9 @@ def self.Configure(&block)
end
Configure {
- domain 'en.wikipedia.org'
- path 'w/api.php'
+ protocol 'http'
+ domain 'en.wikipedia.org'
+ path 'w/api.php'
}
private
View
@@ -1,7 +1,7 @@
module Wikipedia
class Client
# see http://en.wikipedia.org/w/api.php
- BASE_URL = "http://:domain/:path?action=:action&format=json"
+ BASE_URL = ":protocol://:domain/:path?action=:action&format=json"
attr_accessor :follow_redirects
@@ -51,8 +51,9 @@ def request( options )
protected
def configuration_options
{
- :domain => Configuration[:domain],
- :path => Configuration[:path]
+ :protocol => Configuration[:protocol],
+ :domain => Configuration[:domain],
+ :path => Configuration[:path]
}
end
@@ -20,6 +20,6 @@ def self.[](directive)
instance.send(directive)
end
- directives :domain, :path
+ directives :protocol, :domain, :path
end
end
View
@@ -5,18 +5,19 @@
Gem::Specification.new do |s|
s.name = %q{wikipedia-client}
- s.version = "0.0.0"
+ s.version = "1.0.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Cyril David", "Ken Pratt"]
- s.date = %q{2010-08-09}
+ s.authors = ["Cyril David", "Ken Pratt", "Mike Haugland"]
+ s.date = %q{2010-08-30}
s.description = %q{Ruby client for the Wikipedia API}
- s.email = %q{christian.hellsten@gmail.com}
+ s.email = %q{mike.haugland@gmail.com}
s.extra_rdoc_files = [
"README.textile"
]
s.files = [
- "MIT-LICENSE",
+ ".gitignore",
+ "MIT-LICENSE",
"README.textile",
"Rakefile",
"VERSION",
@@ -63,12 +64,13 @@ Gem::Specification.new do |s|
"spec/lib/wikipedia_spec.rb",
"spec/spec_helper.rb",
"tasks/wikipedia_tasks.rake",
- "uninstall.rb"
+ "uninstall.rb",
+ "wikipedia-client.gemspec"
]
- s.homepage = %q{http://github.com/christianhellsten/wikipedia-client}
+ s.homepage = %q{http://github.com/mhaugland/wikipedia-client}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.7}
+ s.rubygems_version = %q{1.3.5}
s.summary = %q{Ruby client for the Wikipedia API}
s.test_files = [
"spec/lib/client_spec.rb",
@@ -82,7 +84,7 @@ Gem::Specification.new do |s|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
else
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])

0 comments on commit b0008cd

Please sign in to comment.