full_clone 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/README.md +9 -0
- data/full_clone.gemspec +1 -0
- data/lib/full_clone/version.rb +1 -1
- data/test/array_tests.rb +5 -13
- data/test/deep_clone_tests.rb +5 -13
- data/test/hash_tests.rb +5 -13
- data/test/object_tests.rb +5 -13
- data/test/struct_tests.rb +5 -13
- metadata +26 -12
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MTRiNGUwMThjMGUxM2Y4YjE3MDhkNDBjMmMyMTIyMTE4MTY2YWY5Mg==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6356656d26f8c77cdeec7f5eac9d764e4a398623
|
4
|
+
data.tar.gz: 4eaa1c261d356c755cfe5f64f95d08a26bb700ae
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NDYxMTc3NDY5OGY3M2VjMWI1ZTI5MzViZGNjMDliMDNkOWMwMDMyMjczNTk1
|
11
|
-
OGM0NGIzYWEyZTFhZDI0MGI5MTZhOTgzNWVlM2QyMDFhNjQzZTU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ODZjOGMyYTAyYjAzMGFiMGNjMzhjN2QzMTBiNDc3N2M2ZjNjZDRjY2RjMWMz
|
14
|
-
YmUyZDZmOGQxODYzNDFhYjYxYjMxOTczMGJjMDc4NjBiNjRhOGZkODkyYTU4
|
15
|
-
OTM2NDZlMWJmMTY2NTZjMDE3NTgwY2Y5NGU3ZjMyNDFlYTIxMWU=
|
6
|
+
metadata.gz: 0116b825408bb0554e0a6d6cbcf7ba0219add96b12ad80a3a813e928781f595b961631d7ed97e17d14ee2b9825373e01c80073cd809777cca9382d97f76f83fd
|
7
|
+
data.tar.gz: 81b56106d08a3374e90b203d212e26dfcdf4a088bc52c54a8bb860461beeb1814bb8cd8312b34f42f4cb06bb35b052161f7448bfd846a8d99a5c9687b09e6de3
|
data/README.md
CHANGED
@@ -38,6 +38,15 @@ full_clone_exclude method in the required class:
|
|
38
38
|
end
|
39
39
|
|
40
40
|
|
41
|
+
## Notes
|
42
|
+
|
43
|
+
The full_clone gem tracks its progress and handles data objects that
|
44
|
+
contain loops, cycles, and other forms of recursion. In order to do this,
|
45
|
+
it relies heavily on the object_id property of the data being copied.
|
46
|
+
If object_id is broken, then full_clone and hashes and ... will also be
|
47
|
+
broken!
|
48
|
+
|
49
|
+
|
41
50
|
## Contributing
|
42
51
|
|
43
52
|
1. Fork it
|
data/full_clone.gemspec
CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.add_development_dependency 'minitest_visible', ">= 0.1.0"
|
21
22
|
spec.add_development_dependency "bundler", "~> 1.3"
|
22
23
|
spec.add_development_dependency "rake"
|
23
24
|
spec.add_development_dependency 'minitest', "~> 4.7.5"
|
data/lib/full_clone/version.rb
CHANGED
data/test/array_tests.rb
CHANGED
@@ -1,23 +1,15 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
require_relative '../lib/full_clone'
|
4
|
+
gem 'minitest'
|
4
5
|
require 'minitest/autorun'
|
6
|
+
require 'minitest_visible'
|
5
7
|
|
6
8
|
#Test the monkey patches applied to the Object class.
|
7
|
-
class ArrayFullCloneTester <
|
9
|
+
class ArrayFullCloneTester < Minitest::Test
|
8
10
|
|
9
|
-
#
|
10
|
-
|
11
|
-
$do_this_only_one_time = "" unless defined? $do_this_only_one_time
|
12
|
-
|
13
|
-
if $do_this_only_one_time != __FILE__
|
14
|
-
puts
|
15
|
-
puts "Running test file: #{File.split(__FILE__)[1]}"
|
16
|
-
$do_this_only_one_time = __FILE__
|
17
|
-
end
|
18
|
-
|
19
|
-
super(*all)
|
20
|
-
end
|
11
|
+
#Track mini-test progress.
|
12
|
+
include MinitestVisible
|
21
13
|
|
22
14
|
def test_basic_deep_cloning
|
23
15
|
sa = "North"
|
data/test/deep_clone_tests.rb
CHANGED
@@ -1,23 +1,15 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
require_relative '../lib/full_clone'
|
4
|
+
gem 'minitest'
|
4
5
|
require 'minitest/autorun'
|
6
|
+
require 'minitest_visible'
|
5
7
|
|
6
8
|
#Test the monkey patches applied to the Object class.
|
7
|
-
class FullCloneTester <
|
9
|
+
class FullCloneTester < Minitest::Test
|
8
10
|
|
9
|
-
#
|
10
|
-
|
11
|
-
$do_this_only_one_time = "" unless defined? $do_this_only_one_time
|
12
|
-
|
13
|
-
if $do_this_only_one_time != __FILE__
|
14
|
-
puts
|
15
|
-
puts "Running test file: #{File.split(__FILE__)[1]}"
|
16
|
-
$do_this_only_one_time = __FILE__
|
17
|
-
end
|
18
|
-
|
19
|
-
super(*all)
|
20
|
-
end
|
11
|
+
#Track mini-test progress.
|
12
|
+
include MinitestVisible
|
21
13
|
|
22
14
|
def test_for_safe_value_cloning
|
23
15
|
assert_equal((6).full_clone, 6)
|
data/test/hash_tests.rb
CHANGED
@@ -1,23 +1,15 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
require_relative '../lib/full_clone'
|
4
|
+
gem 'minitest'
|
4
5
|
require 'minitest/autorun'
|
6
|
+
require 'minitest_visible'
|
5
7
|
|
6
8
|
#Test the monkey patches applied to the Object class.
|
7
|
-
class HashFullCloneTester <
|
9
|
+
class HashFullCloneTester < Minitest::Test
|
8
10
|
|
9
|
-
#
|
10
|
-
|
11
|
-
$do_this_only_one_time = "" unless defined? $do_this_only_one_time
|
12
|
-
|
13
|
-
if $do_this_only_one_time != __FILE__
|
14
|
-
puts
|
15
|
-
puts "Running test file: #{File.split(__FILE__)[1]}"
|
16
|
-
$do_this_only_one_time = __FILE__
|
17
|
-
end
|
18
|
-
|
19
|
-
super(*all)
|
20
|
-
end
|
11
|
+
#Track mini-test progress.
|
12
|
+
include MinitestVisible
|
21
13
|
|
22
14
|
def test_basic_deep_cloning
|
23
15
|
sa = "North"
|
data/test/object_tests.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
require_relative '../lib/full_clone'
|
4
|
+
gem 'minitest'
|
4
5
|
require 'minitest/autorun'
|
6
|
+
require 'minitest_visible'
|
5
7
|
|
6
8
|
#Test the monkey patches applied to the Object class.
|
7
|
-
class ObjectFullCloneTester <
|
9
|
+
class ObjectFullCloneTester < Minitest::Test
|
8
10
|
|
9
11
|
class SimpleClass
|
10
12
|
attr_accessor :iva
|
@@ -16,18 +18,8 @@ class ObjectFullCloneTester < MiniTest::Unit::TestCase
|
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
19
|
-
#
|
20
|
-
|
21
|
-
$do_this_only_one_time = "" unless defined? $do_this_only_one_time
|
22
|
-
|
23
|
-
if $do_this_only_one_time != __FILE__
|
24
|
-
puts
|
25
|
-
puts "Running test file: #{File.split(__FILE__)[1]}"
|
26
|
-
$do_this_only_one_time = __FILE__
|
27
|
-
end
|
28
|
-
|
29
|
-
super(*all)
|
30
|
-
end
|
21
|
+
#Track mini-test progress.
|
22
|
+
include MinitestVisible
|
31
23
|
|
32
24
|
def test_basic_deep_cloning
|
33
25
|
sa = "North"
|
data/test/struct_tests.rb
CHANGED
@@ -1,25 +1,17 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
require_relative '../lib/full_clone'
|
4
|
+
gem 'minitest'
|
4
5
|
require 'minitest/autorun'
|
6
|
+
require 'minitest_visible'
|
5
7
|
|
6
8
|
#Test the monkey patches applied to the Object class.
|
7
|
-
class StructFullCloneTester <
|
9
|
+
class StructFullCloneTester < Minitest::Test
|
8
10
|
|
9
11
|
SimpleStruct = Struct.new(:iva, :ivb, :ivc)
|
10
12
|
|
11
|
-
#
|
12
|
-
|
13
|
-
$do_this_only_one_time = "" unless defined? $do_this_only_one_time
|
14
|
-
|
15
|
-
if $do_this_only_one_time != __FILE__
|
16
|
-
puts
|
17
|
-
puts "Running test file: #{File.split(__FILE__)[1]}"
|
18
|
-
$do_this_only_one_time = __FILE__
|
19
|
-
end
|
20
|
-
|
21
|
-
super(*all)
|
22
|
-
end
|
13
|
+
#Track mini-test progress.
|
14
|
+
include MinitestVisible
|
23
15
|
|
24
16
|
def test_basic_deep_cloning
|
25
17
|
sa = "North"
|
metadata
CHANGED
@@ -1,55 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: full_clone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Camilleri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: minitest_visible
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.0
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
|
-
- - ~>
|
31
|
+
- - "~>"
|
18
32
|
- !ruby/object:Gem::Version
|
19
33
|
version: '1.3'
|
20
34
|
type: :development
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
|
-
- - ~>
|
38
|
+
- - "~>"
|
25
39
|
- !ruby/object:Gem::Version
|
26
40
|
version: '1.3'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- -
|
45
|
+
- - ">="
|
32
46
|
- !ruby/object:Gem::Version
|
33
47
|
version: '0'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- -
|
52
|
+
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: minitest
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - ~>
|
59
|
+
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
61
|
version: 4.7.5
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - ~>
|
66
|
+
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: 4.7.5
|
55
69
|
description: A (safe/no exceptions) clone variant that performs a deep, recursive
|
@@ -60,7 +74,7 @@ executables: []
|
|
60
74
|
extensions: []
|
61
75
|
extra_rdoc_files: []
|
62
76
|
files:
|
63
|
-
- .gitignore
|
77
|
+
- ".gitignore"
|
64
78
|
- Gemfile
|
65
79
|
- LICENSE.txt
|
66
80
|
- README.md
|
@@ -87,17 +101,17 @@ require_paths:
|
|
87
101
|
- lib
|
88
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|
89
103
|
requirements:
|
90
|
-
- -
|
104
|
+
- - ">="
|
91
105
|
- !ruby/object:Gem::Version
|
92
106
|
version: '0'
|
93
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
108
|
requirements:
|
95
|
-
- -
|
109
|
+
- - ">="
|
96
110
|
- !ruby/object:Gem::Version
|
97
111
|
version: '0'
|
98
112
|
requirements: []
|
99
113
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
114
|
+
rubygems_version: 2.2.2
|
101
115
|
signing_key:
|
102
116
|
specification_version: 4
|
103
117
|
summary: A clone variant that performs a deep copy.
|