Sha256: b95d770256fd195daca0863a7541866c5f11b162fda64f58a3219dc2e07452bd

Contents?: true

Size: 373 Bytes

Versions: 307

Compression:

Stored size: 373 Bytes

Contents

# Stolen straight from ActiveSupport

class Proc #:nodoc:
  def bind(object)
    block, time = self, Time.now
    (class << object; self end).class_eval do
      method_name = "__bind_#{time.to_i}_#{time.usec}"
      define_method(method_name, &block)
      method = instance_method(method_name)
      remove_method(method_name)
      method
    end.bind(object)
  end
end

Version data entries

307 entries across 258 versions & 47 rubygems

Version Path
giraffesoft-resource_controller-0.4.10 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
giraffesoft-resource_controller-0.4.12 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
giraffesoft-resource_controller-0.4.9 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
giraffesoft-resource_controller-0.5.2 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
giraffesoft-resource_controller-0.5.3 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
gnip-gnip-1.1.1 test/lib/shoulda/proc_extensions.rb
gsterndale-warrant-0.2.0 test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.6/lib/shoulda/proc_extensions.rb
gsterndale-warrant-0.3.0 test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.6/lib/shoulda/proc_extensions.rb
hashrocket-clearance-0.4.0 test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/proc_extensions.rb
hashrocket-clearance-0.4.1 test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/proc_extensions.rb
hashrocket-clearance-0.4.2 test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/proc_extensions.rb
hashrocket-clearance-0.4.3 test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/proc_extensions.rb
iGEL-shoulda-2.10.2 lib/shoulda/proc_extensions.rb
jcnetdev-shoulda-4.2 lib/shoulda/gem/proc_extensions.rb
korin-resource_controller-0.5.3 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
mattknox-goaloc-0.3.0 lib/goaloc/generators/resources/shoulda/lib/shoulda/proc_extensions.rb
mattknox-goaloc-0.3.0 lib/goaloc/generators/resources/shoulda/lib/shoulda/gem/proc_extensions.rb
mattknox-goaloc-0.4.0 lib/goaloc/generators/resources/shoulda/lib/shoulda/proc_extensions.rb
mattknox-goaloc-0.4.0 lib/goaloc/generators/resources/shoulda/lib/shoulda/gem/proc_extensions.rb
mjankowski-shoulda-2.0.4 lib/shoulda/proc_extensions.rb