full_clone 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWI0NTg2ZTJkZTk0NTRmYzFiNTY1OGI1MGY2ODM3YjMyODRmNTFmNg==
4
+ ZDc2N2Q1ZDU5OTljNTRkMjcyYTM3MDFlYjJiODFiYTA3Nzc0YjY4MQ==
5
5
  data.tar.gz: !binary |-
6
- MmExOWRiMTNkMGY0ZmUzMDYzOTk3NTgxOTQ5MzNkZmVhYjhhNmI0ZA==
6
+ M2EwOGU0MDlmODQ1NTAzZmJmMDk5ZGM3ZDhjNGE5OTAwM2FkMDVjMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTc0MGJlNWYyYmZkZWZmMjRiMDFkMTMyYjVjNjk4YTAxOTdhNzQ2Y2M2ZWE3
10
- Zjc2MmQyYjhhMDExYWVjYzkyOWNiZTk4Y2FkZTRhY2NhZjRmMTM4OGI5ZThj
11
- YjYyOGM3YTRlNDQ3YmYxMmQyZDIyNWE0ZGViOWVkNWM3MzcwNDM=
9
+ MjRjODE1MDk4ODNlYTBmN2U4MzkyZWI3MzQzNjcxMzQxZWNkOTc0ZjZlZmQ3
10
+ ODI2MjNlZjZiYTU0Y2M0YjEwMjI1MGUwNDFjNGY4Njg0MjNjZDNkNGE2MGI3
11
+ OGRjMjg3MmJhNTExNDk3N2I5YzIyMWIzYWNlNDY1N2JiZGJjYzY=
12
12
  data.tar.gz: !binary |-
13
- ODQ2NTdhN2FlNGIzMDk5MzczNzkzNjU4NDFjOTA1OTcyZTVmNDY5NmI3OWM3
14
- ODk4OTIxOTIzYTlhZTRjMWZkNGVhMjAwNTFiZWY4YWQyZDM1MDQ5ZmE4YzY3
15
- M2Y5YjIyZWJmYTc1ZGRiMDg3NmYzZTMzZWUwNDc4OTFiYjhhOGY=
13
+ M2M4YTFmYTViYTdmNzhkYzBiMjZiMjFmMmJkZmU1ZjQzODY0MGRmYzRlMzNh
14
+ YTQ5NzU0ZmJkODgwZGUyMTk5OTliZTk3MGNkOGRiZjE4NjE0YTg0M2M3NjVj
15
+ OWM0M2JkZWRhOGQyYjQ1YjAxNmY2NWU0ZWY2NDRhMDQ2NWM0MjY=
data/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  The standard clone method creates a fresh instance of most (non-scalar) objects
4
4
  but does not clone internal state. This internal state remains aliased in the
5
5
  cloned copy. The full_clone method digs deep and makes copies of these internal
6
- variables. It also allows classes to specify an exclusion list of variable that
7
- are not to be processed.
6
+ variables, not just arrays and hashes. It also allows classes to specify an
7
+ exclusion list of variables that are not to be processed.
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
@@ -33,9 +33,9 @@ instead of
33
33
  To exclude some instance variables from the deep cloning process, define a
34
34
  full_clone_exclude method in the required class:
35
35
 
36
- def full_clone_exclude
37
- [:@bad_var1, :@bad_var2, :@bad_var_etc]
38
- end
36
+ def full_clone_exclude
37
+ [:@bad_var1, :@bad_var2, :@bad_var_etc]
38
+ end
39
39
 
40
40
 
41
41
  ## Contributing
data/deep_clone.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'full_clone/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "full_clone"
8
- spec.version = DeepClone::VERSION
8
+ spec.version = FullClone::VERSION
9
9
  spec.authors = ["Peter Camilleri"]
10
10
  spec.email = ["peter.c.camilleri@gmail.com"]
11
11
  spec.description = "A (safe/no exceptions) clone variant that performs a deep, recursive copy."
@@ -1,3 +1,3 @@
1
- module DeepClone
2
- VERSION = "0.0.1"
1
+ module FullClone
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/full_clone.rb CHANGED
@@ -4,32 +4,32 @@ require_relative 'full_clone/array'
4
4
  require_relative 'full_clone/hash'
5
5
  require_relative 'full_clone/struct'
6
6
 
7
- module DeepClone
7
+ module FullClone
8
8
  def full_clone(_progress={})
9
9
  self
10
10
  end
11
11
  end
12
12
 
13
13
  class Numeric
14
- include DeepClone
14
+ include FullClone
15
15
  end
16
16
 
17
17
  class NilClass
18
- include DeepClone
18
+ include FullClone
19
19
  end
20
20
 
21
21
  class TrueClass
22
- include DeepClone
22
+ include FullClone
23
23
  end
24
24
 
25
25
  class FalseClass
26
- include DeepClone
26
+ include FullClone
27
27
  end
28
28
 
29
29
  class Symbol
30
- include DeepClone
30
+ include FullClone
31
31
  end
32
32
 
33
33
  class Regexp
34
- include DeepClone
34
+ include FullClone
35
35
  end
data/test/array_tests.rb CHANGED
@@ -4,7 +4,7 @@ require_relative '../lib/full_clone'
4
4
  require 'minitest/autorun'
5
5
 
6
6
  #Test the monkey patches applied to the Object class.
7
- class ArrayDeepCloneTester < MiniTest::Unit::TestCase
7
+ class ArrayFullCloneTester < MiniTest::Unit::TestCase
8
8
 
9
9
  #Special initialize to track rake progress.
10
10
  def initialize(*all)
@@ -4,7 +4,7 @@ require_relative '../lib/full_clone'
4
4
  require 'minitest/autorun'
5
5
 
6
6
  #Test the monkey patches applied to the Object class.
7
- class DeepCloneTester < MiniTest::Unit::TestCase
7
+ class FullCloneTester < MiniTest::Unit::TestCase
8
8
 
9
9
  #Special initialize to track rake progress.
10
10
  def initialize(*all)
data/test/hash_tests.rb CHANGED
@@ -4,7 +4,7 @@ require_relative '../lib/full_clone'
4
4
  require 'minitest/autorun'
5
5
 
6
6
  #Test the monkey patches applied to the Object class.
7
- class HashDeepCloneTester < MiniTest::Unit::TestCase
7
+ class HashFullCloneTester < MiniTest::Unit::TestCase
8
8
 
9
9
  #Special initialize to track rake progress.
10
10
  def initialize(*all)
data/test/object_tests.rb CHANGED
@@ -4,7 +4,7 @@ require_relative '../lib/full_clone'
4
4
  require 'minitest/autorun'
5
5
 
6
6
  #Test the monkey patches applied to the Object class.
7
- class ObjectDeepCloneTester < MiniTest::Unit::TestCase
7
+ class ObjectFullCloneTester < MiniTest::Unit::TestCase
8
8
 
9
9
  class SimpleClass
10
10
  attr_accessor :iva
data/test/struct_tests.rb CHANGED
@@ -4,7 +4,7 @@ require_relative '../lib/full_clone'
4
4
  require 'minitest/autorun'
5
5
 
6
6
  #Test the monkey patches applied to the Object class.
7
- class StructDeepCloneTester < MiniTest::Unit::TestCase
7
+ class StructFullCloneTester < MiniTest::Unit::TestCase
8
8
 
9
9
  SimpleStruct = Struct.new(:iva, :ivb, :ivc)
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: full_clone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Camilleri