init_copy 0.3.0 → 0.3.1
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 +4 -4
- data/Gemfile +7 -6
- data/Rakefile +1 -1
- data/init_copy.gemspec +3 -1
- data/lib/init_copy/version.rb +1 -1
- data/test/init_copy_test.rb +14 -10
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae95968b85aaaf5b99b3f6a6baa656c507c929c3b131a4033dc70aa53da771a1
|
4
|
+
data.tar.gz: 0ab5144c33d40065472d34d7f518d1d6b22d62f84673e5535b505c9897208a53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad48b02c42b4e53b2cd39c7e79cfd8eb1cc7d9dee97c48109d8dc6e5177f382ca31b3ff82610b35951429212957e2fa695c00064e1551527e9d22a4b8c28c05f
|
7
|
+
data.tar.gz: e9c728cdfc1ae494f18ff570f02787a4e6cabc264255eaf4b7d943410ce381b99dffcc05c3745f6b08af3fdd667e8229bb244eae62689987f3e0b4ca75a462ef
|
data/Gemfile
CHANGED
@@ -5,12 +5,13 @@ source 'https://rubygems.org'
|
|
5
5
|
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
group
|
9
|
-
gem 'bundler'
|
10
|
-
gem 'rake'
|
11
|
-
|
8
|
+
group(:development,:test) do
|
9
|
+
gem 'bundler','~> 2.6'
|
10
|
+
gem 'rake','~> 13.3.0'
|
11
|
+
|
12
|
+
gem 'rdoc','~> 6.14.0' # Doc.
|
12
13
|
end
|
13
14
|
|
14
|
-
group
|
15
|
-
gem 'minitest','~>
|
15
|
+
group(:test) do
|
16
|
+
gem 'minitest','~> 5.25.0' # Tests.
|
16
17
|
end
|
data/Rakefile
CHANGED
data/init_copy.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
|
16
16
|
spec.metadata = {
|
17
17
|
'rubygems_mfa_required' => 'true',
|
18
|
-
'homepage_uri' =>
|
18
|
+
'homepage_uri' => spec.homepage,
|
19
19
|
'source_code_uri' => 'https://github.com/esotericpig/init_copy',
|
20
20
|
'bug_tracker_uri' => 'https://github.com/esotericpig/init_copy/issues',
|
21
21
|
'changelog_uri' => 'https://github.com/esotericpig/init_copy/blob/main/CHANGELOG.md',
|
@@ -30,6 +30,8 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.extra_rdoc_files = %w[LICENSE.txt README.md]
|
31
31
|
spec.rdoc_options = [
|
32
32
|
%w[--embed-mixins --hyperlink-all --line-numbers --show-hash],
|
33
|
+
'--encoding','UTF-8',
|
34
|
+
'--markup','markdown',
|
33
35
|
'--main','README.md',
|
34
36
|
'--title',"InitCopy v#{InitCopy::VERSION}",
|
35
37
|
].flatten
|
data/lib/init_copy/version.rb
CHANGED
data/test/init_copy_test.rb
CHANGED
@@ -13,11 +13,11 @@ require 'minitest/autorun'
|
|
13
13
|
require 'init_copy'
|
14
14
|
|
15
15
|
describe InitCopy do
|
16
|
-
it 'has
|
16
|
+
it 'has the version' do
|
17
17
|
_(InitCopy::VERSION).must_match(/\d+\.\d+\.\d+(-[0-9A-Za-z\-.]+)?(\+[0-9A-Za-z\-.]+)?/)
|
18
18
|
end
|
19
19
|
|
20
|
-
def self.
|
20
|
+
def self.it_does_a_shallow_copy
|
21
21
|
it 'is not the same as the copies' do
|
22
22
|
_(@sut).wont_be_same_as(@sut_clone)
|
23
23
|
_(@sut).wont_be_same_as(@sut_dup)
|
@@ -30,7 +30,7 @@ describe InitCopy do
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
def self.
|
33
|
+
def self.it_does_a_deep_copy(is_frozen: false)
|
34
34
|
it 'has the correct original' do
|
35
35
|
_(@sut.orig).must_be_nil
|
36
36
|
_(@sut_clone.orig).must_be_same_as(@sut)
|
@@ -66,7 +66,7 @@ describe InitCopy do
|
|
66
66
|
@sut_dup = @sut.dup
|
67
67
|
end
|
68
68
|
|
69
|
-
|
69
|
+
it_does_a_shallow_copy
|
70
70
|
|
71
71
|
it 'has no original' do
|
72
72
|
_(@sut.orig).must_be_nil
|
@@ -103,8 +103,8 @@ describe InitCopy do
|
|
103
103
|
@sut_dup = @sut.dup
|
104
104
|
end
|
105
105
|
|
106
|
-
|
107
|
-
|
106
|
+
it_does_a_shallow_copy
|
107
|
+
it_does_a_deep_copy
|
108
108
|
end
|
109
109
|
|
110
110
|
describe 'with copy and internal state' do
|
@@ -124,8 +124,8 @@ describe InitCopy do
|
|
124
124
|
@sut_dup = @sut.dup
|
125
125
|
end
|
126
126
|
|
127
|
-
|
128
|
-
|
127
|
+
it_does_a_shallow_copy
|
128
|
+
it_does_a_deep_copy(is_frozen: true)
|
129
129
|
|
130
130
|
it 'has the correct bonus extension' do
|
131
131
|
_(@sut.nums).must_respond_to(:bonus,'SUT should have the nums bonus extension')
|
@@ -152,8 +152,8 @@ describe InitCopy do
|
|
152
152
|
@sut_dup = @sut.dup
|
153
153
|
end
|
154
154
|
|
155
|
-
|
156
|
-
|
155
|
+
it_does_a_shallow_copy
|
156
|
+
it_does_a_deep_copy
|
157
157
|
|
158
158
|
it 'does a deep copy of the strs' do
|
159
159
|
_(@sut.strs).wont_be_same_as(@sut_clone.strs)
|
@@ -177,6 +177,8 @@ describe InitCopy do
|
|
177
177
|
it 'does not do a deep copy of the unsafe var' do
|
178
178
|
_(@sut.unsafe).wont_respond_to(:clone)
|
179
179
|
_(@sut.unsafe).wont_respond_to(:dup)
|
180
|
+
expect { @sut.unsafe.clone }.must_raise(NoMethodError)
|
181
|
+
expect { @sut.unsafe.dup }.must_raise(NoMethodError)
|
180
182
|
|
181
183
|
_(@sut.unsafe).must_be_same_as(@sut_clone.unsafe)
|
182
184
|
_(@sut.unsafe).must_be_same_as(@sut_dup.unsafe)
|
@@ -228,6 +230,8 @@ class TestBagChildWithCopyAndUnsafe < TestBagWithCopy
|
|
228
230
|
end.new
|
229
231
|
end
|
230
232
|
|
233
|
+
protected
|
234
|
+
|
231
235
|
def init_copy(*)
|
232
236
|
super
|
233
237
|
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: init_copy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bradley Whited
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: Easily use the correct clone or dup method in initialize_copy.
|
14
13
|
email:
|
@@ -37,16 +36,19 @@ metadata:
|
|
37
36
|
source_code_uri: https://github.com/esotericpig/init_copy
|
38
37
|
bug_tracker_uri: https://github.com/esotericpig/init_copy/issues
|
39
38
|
changelog_uri: https://github.com/esotericpig/init_copy/blob/main/CHANGELOG.md
|
40
|
-
post_install_message:
|
41
39
|
rdoc_options:
|
42
40
|
- "--embed-mixins"
|
43
41
|
- "--hyperlink-all"
|
44
42
|
- "--line-numbers"
|
45
43
|
- "--show-hash"
|
44
|
+
- "--encoding"
|
45
|
+
- UTF-8
|
46
|
+
- "--markup"
|
47
|
+
- markdown
|
46
48
|
- "--main"
|
47
49
|
- README.md
|
48
50
|
- "--title"
|
49
|
-
- InitCopy v0.3.
|
51
|
+
- InitCopy v0.3.1
|
50
52
|
require_paths:
|
51
53
|
- lib
|
52
54
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -60,8 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
62
|
- !ruby/object:Gem::Version
|
61
63
|
version: '0'
|
62
64
|
requirements: []
|
63
|
-
rubygems_version: 3.
|
64
|
-
signing_key:
|
65
|
+
rubygems_version: 3.7.1
|
65
66
|
specification_version: 4
|
66
67
|
summary: Easily use the correct clone or dup method in initialize_copy.
|
67
68
|
test_files: []
|