Permalink
Browse files

add spec/**/*_spec.rb and bugfixes

  • Loading branch information...
1 parent aaf3341 commit 346030fb9e4b65d8fe555189a8abf1ffe11fbc40 nov committed Dec 24, 2008
Showing with 16 additions and 10 deletions.
  1. +1 −1 Rakefile
  2. +1 −2 iknow.gemspec
  3. +3 −1 lib/iknow.rb
  4. +11 −6 lib/iknow/core/config.rb
View
@@ -62,7 +62,7 @@ spec = Gem::Specification.new do |s|
s.add_dependency('json')
s.add_dependency('oauth')
- s.required_ruby_version = '>= 1.8.6'
+ # s.required_ruby_version = '>= 1.8.6'
s.files = %w(README ChangeLog Rakefile) +
Dir.glob("{bin,doc,test,lib,templates,extras,website,script}/**/*") +
View
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["nov"]
- s.date = %q{2008-12-23}
+ s.date = %q{2008-12-24}
s.description = %q{A rubygem for iKnow! APIs}
s.email = %q{developer@iknow.co.jp}
s.extra_rdoc_files = ["README", "ChangeLog"]
@@ -15,7 +15,6 @@ Gem::Specification.new do |s|
s.homepage = %q{http://iknow.rubyforge.org}
s.rdoc_options = ["--title", "iknow documentation", "--charset", "utf-8", "--opname", "index.html", "--line-numbers", "--main", "README", "--inline-source", "--exclude", "^(examples|extras)/"]
s.require_paths = ["lib"]
- s.required_ruby_version = Gem::Requirement.new(">= 1.8.6")
s.rubyforge_project = %q{iknow}
s.rubygems_version = %q{1.3.1}
s.summary = %q{A rubygem for iKnow! APIs}
View
@@ -11,4 +11,6 @@ module Iknow
require 'ext/hash'
require 'iknow/core'
require 'iknow/rest_client'
-require 'iknow/model'
+require 'iknow/model'
+
+Iknow::Config.init
View
@@ -2,9 +2,10 @@
class Iknow::Config
include Singleton
- attr_accessor :protocol, :host, :port, :api_protocol, :api_host, :api_port, :api_key, :timeout,
- :oauth_consumer_key, :oauth_consumer_secret, :oauth_http_method, :oauth_scheme,
- :user_agent, :application_name, :application_version, :application_url
+ ATTRIBUTES = [ :protocol, :host, :port, :api_protocol, :api_host, :api_port, :api_key, :timeout,
+ :oauth_consumer_key, :oauth_consumer_secret, :oauth_http_method, :oauth_scheme,
+ :user_agent, :application_name, :application_version, :application_url ]
+ attr_accessor *ATTRIBUTES
def self.init(&block)
conf = Iknow::Config.instance
@@ -39,8 +40,12 @@ def api_base_url
"#{self.api_protocol}://#{self.api_host}#{port}"
end
- def self.method_missing(method, *args)
- self.instance.send(method, *args)
+ # hack: Object.timeout is already defined..
+ def self.timeout
+ instance.timeout
end
-end
+ def self.method_missing(method, *args)
+ Iknow::Config.instance.send(method, *args)
+ end
+end

0 comments on commit 346030f

Please sign in to comment.