Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove dependency on activesupport for singleton_class

This change can be reverted when the required Ruby version >= 1.9.

Closes #264.
  • Loading branch information...
commit 2ed9db21c87d1218b15373e42a36ad536b07dcbb 1 parent 538cd2f
Erik Michaels-Ober authored
15 lib/twitter/core_ext/kernel.rb
View
@@ -0,0 +1,15 @@
+module Kernel
+
+ # Returns the object's singleton class.
+ def singleton_class
+ class << self
+ self
+ end
+ end unless respond_to?(:singleton_class) # exists in 1.9.2
+
+ # class_eval on an object acts like singleton_class.class_eval.
+ def class_eval(*args, &block)
+ singleton_class.class_eval(*args, &block)
+ end
+
+end
4 lib/twitter/cursor.rb
View
@@ -1,5 +1,5 @@
-require 'active_support/core_ext/kernel/singleton_class'
require 'twitter/base'
+require 'twitter/core_ext/kernel'
module Twitter
class Cursor < Twitter::Base
@@ -23,7 +23,7 @@ def initialize(attrs, method, klass=nil)
item
end
end
- singleton_class.class_eval do
+ class_eval do
alias_method method.to_sym, :collection
end
end
1  twitter.gemspec
View
@@ -2,7 +2,6 @@
require File.expand_path('../lib/twitter/version', __FILE__)
Gem::Specification.new do |gem|
- gem.add_dependency 'activesupport', ['>= 2.3.9', '< 4']
gem.add_dependency 'faraday', '~> 0.8'
gem.add_dependency 'multi_json', '~> 1.3'
gem.add_dependency 'simple_oauth', '~> 0.1.6'
Please sign in to comment.
Something went wrong with that request. Please try again.