Permalink
Browse files

cleaning

  • Loading branch information...
1 parent 5325a10 commit 7503298d22eaa0963cfb11f4ddc928107990b8d4 @kachick committed May 18, 2012
Showing with 1 addition and 54 deletions.
  1. +1 −2 Manifest.txt
  2. +0 −52 lib/vertere/core.rb
View
@@ -4,8 +4,7 @@ History.rdoc
Manifest.txt
Rakefile
example.rb
-lib/vertere/core.rb
-lib/vertere/ext.rb
lib/vertere.rb
+lib/vertere/ext.rb
test/test_helper.rb
test/test_vertere.rb
View
@@ -1,52 +0,0 @@
-require 'delegate'
-
-# @author Kenichi Kamiya
-module Vertere
-
- VERSION = '0.0.1'.freeze
-
- # @author Kenichi Kamiya
- module ObjectExtension
- def for_vertere
- ::Vertere.for_object self
- end
-
- alias_method :for_!, :for_vertere
-
- def comparison_inverted?
- false
- end
- end
-
- class << self
- def for_object(original)
- invereted = original.clone
- rescue SecurityError
- invereted = original.dup
- rescue TypeError
- invereted = SimpleDelegator.new original
- ensure
- invereted.singleton_class.class_eval do
- %w[== === =~].each do |operator|
- if original.respond_to? operator
- define_method operator do |other|
- ! (super other)
- end
- end
- end
-
- if original.respond_to? :<=>
- def <=>(other)
- r = super other
- r && (- r)
- end
- end
-
- def comparison_inverted?
- true
- end
- end
- end
- end
-
-end

0 comments on commit 7503298

Please sign in to comment.