Sha256: 3f6eaafedd7a1bfbda9e224b35f57d4990edc4d0b13eef849fe290d4783002d8

Contents?: true

Size: 482 Bytes

Versions: 139

Compression:

Stored size: 482 Bytes

Contents

module Rake
  # ##########################################################################
  # Mixin for creating easily cloned objects.
  #
  module Cloneable
    # The hook that invoked by 'clone' and 'dup' methods.
    def initialize_copy(source)
      super
      source.instance_variables.each do |var|
        src_value  = source.instance_variable_get(var)
        value = src_value.clone rescue src_value
        instance_variable_set(var, value)
      end
    end
  end
end

Version data entries

139 entries across 121 versions & 33 rubygems

Version Path
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/cloneable.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/cloneable.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/cloneable.rb
sshp-0.0.2 vendor/ruby/1.9.1/gems/rake-10.0.4/lib/rake/cloneable.rb
sshp-0.0.1 vendor/ruby/1.9.1/gems/rake-10.0.4/lib/rake/cloneable.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/cloneable.rb
vergissberlin-0.0.9 vendor/bundle/gems/rake-10.0.4/lib/rake/cloneable.rb
vergissberlin-0.0.7 vendor/bundle/gems/rake-10.0.4/lib/rake/cloneable.rb
font-awesome-rails-3.1.1.2 vendor/ruby/2.0.0/gems/rake-10.0.3/lib/rake/cloneable.rb
font-awesome-rails-3.1.1.2 vendor/ruby/1.9.1/gems/rake-10.0.4/lib/rake/cloneable.rb
font-awesome-rails-3.1.1.2 vendor/ruby/1.9.1/gems/rake-10.0.3/lib/rake/cloneable.rb
font-awesome-rails-3.1.1.1 vendor/ruby/1.9.1/gems/rake-10.0.3/lib/rake/cloneable.rb
font-awesome-rails-3.1.1.1 vendor/ruby/1.9.1/gems/rake-10.0.4/lib/rake/cloneable.rb
font-awesome-rails-3.1.1.1 vendor/ruby/2.0.0/gems/rake-10.0.3/lib/rake/cloneable.rb
challah-1.0.0.beta3 vendor/bundle/gems/rake-10.0.4/lib/rake/cloneable.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/rake-10.0.4/lib/rake/cloneable.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/rake-10.0.4/lib/rake/cloneable.rb
rake-10.1.0.beta.3 lib/rake/cloneable.rb
rake-10.1.0.beta.2 lib/rake/cloneable.rb
rake-10.1.0.beta.1 lib/rake/cloneable.rb