Permalink
Browse files

these extensions already come with ActiveSupport

  • Loading branch information...
1 parent a9bb8dd commit 721abbdf4229762a7c8812675028b26f7f4069e5 @langalex committed Feb 26, 2012
Showing with 0 additions and 35 deletions.
  1. +0 −5 lib/core_ext/object.rb
  2. +0 −12 lib/core_ext/string.rb
  3. +0 −15 lib/core_ext/symbol.rb
  4. +0 −3 lib/couch_potato.rb
View
5 lib/core_ext/object.rb
@@ -1,5 +0,0 @@
-Object.class_eval do
- def try(method, *args)
- self.send method, *args if self.respond_to?(method)
- end
-end
View
12 lib/core_ext/string.rb
@@ -1,12 +0,0 @@
-module ActiveSupportMethods
- def camelize
- sub(/^([a-z])/) {$1.upcase}.gsub(/_([a-z])/) do
- $1.upcase
- end
- end
-
- def blank?
- empty?
- end
-end
-String.send :include, ActiveSupportMethods unless String.new.respond_to?(:underscore)
View
15 lib/core_ext/symbol.rb
@@ -1,15 +0,0 @@
-# taken from ActiveSupport 2.3.2
-unless :to_proc.respond_to?(:to_proc)
- class Symbol
- # Turns the symbol into a simple proc, which is especially useful for enumerations. Examples:
- #
- # # The same as people.collect { |p| p.name }
- # people.collect(&:name)
- #
- # # The same as people.select { |p| p.manager? }.collect { |p| p.salary }
- # people.select(&:manager?).collect(&:salary)
- def to_proc
- Proc.new { |*args| args.shift.__send__(self, *args) }
- end
- end
-end
View
3 lib/couch_potato.rb
@@ -61,11 +61,8 @@ def self.full_url_to_database(database_name=CouchPotato::Config.database_name)
$LOAD_PATH << File.dirname(__FILE__)
-require 'core_ext/object'
require 'core_ext/time'
require 'core_ext/date'
-require 'core_ext/string'
-require 'core_ext/symbol'
require 'couch_potato/validation'
require 'couch_potato/persistence'
require 'couch_potato/railtie' if defined?(Rails)

0 comments on commit 721abbd

Please sign in to comment.