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
shoulda-context-3.0.0.rc1 lib/shoulda/context/proc_extensions.rb
shoulda-context-2.0.0 lib/shoulda/context/proc_extensions.rb
shoulda-context-2.0.0.rc4 lib/shoulda/context/proc_extensions.rb
shoulda-context-2.0.0.rc3 lib/shoulda/context/proc_extensions.rb
shoulda-context-2.0.0.rc2 lib/shoulda/context/proc_extensions.rb
shoulda-context-2.0.0.rc1 lib/shoulda/context/proc_extensions.rb
shoulda-context-1.2.2 lib/shoulda/context/proc_extensions.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/shoulda-context-1.2.1/lib/shoulda/context/proc_extensions.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
Flamefork-shoulda-2.10.1 lib/shoulda/proc_extensions.rb
Flamefork-shoulda-2.10.2 lib/shoulda/proc_extensions.rb
akitaonrails-resource_controller-0.5.2 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
akitaonrails-resource_controller-0.5.3 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
auser-poolparty-1.3.0 vendor/gems/shoulda/lib/shoulda/proc_extensions.rb
auser-poolparty-1.3.1 vendor/gems/shoulda/lib/shoulda/proc_extensions.rb
auser-poolparty-1.3.10 vendor/gems/shoulda/lib/shoulda/proc_extensions.rb
auser-poolparty-1.3.11 vendor/gems/shoulda/lib/shoulda/proc_extensions.rb