ruby_deep_clone 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8484cb9b2193de9597046084cd08d0da04e011cb
4
+ data.tar.gz: 42b44ed0f9340cda04b3720afeb0c81f245860d6
5
+ SHA512:
6
+ metadata.gz: 3c1af9c76e96f9624df214ba55c4513a03b4f58cb23dc739488cac9904f4e961b1c963fcf3be2b9449e1a1c38be2788a7a3b36d687235d7f911c26c7925a02d0
7
+ data.tar.gz: 1aa4d4c22cf31a3f0beafef48d4972557d5aae0714635cb93a96cafbf4331da6e4326dd1d9e9192ed860a86d3cccb9bc5f6c6b92fd43e4d0837a46c587264a7f
data/deep_clone.gemspec CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
 
6
6
  s.name = 'ruby_deep_clone'
7
- s.version = '0.4.0'
7
+ s.version = '0.5.0'
8
8
  s.date = '2014-01-21'
9
9
 
10
10
  s.summary = "Ruby native deep clone"
@@ -99,20 +99,25 @@ static VALUE clone_object(VALUE object, VALUE tracker)
99
99
  rb_hash_aset(tracker,id,new_obj);
100
100
  break;
101
101
  default:
102
- new_obj = rb_obj_clone(object);
102
+ if(rb_obj_is_kind_of(object,rb_cNumeric)){
103
+ new_obj = object;
104
+ rb_hash_aset(tracker,id,new_obj);
105
+ } else {
106
+ new_obj = rb_obj_clone(object);
103
107
 
104
- // Unfreeze the new object
105
- OBJ_UNFREEZE(new_obj);
108
+ // Unfreeze the new object
109
+ OBJ_UNFREEZE(new_obj);
106
110
 
107
- rb_hash_aset(tracker,id,new_obj);
108
- st_table *tbl = DC_ROBJECT_IV_INDEX_TBL(object);
111
+ rb_hash_aset(tracker,id,new_obj);
112
+ st_table *tbl = DC_ROBJECT_IV_INDEX_TBL(object);
109
113
 
110
- if(tbl) {
111
- struct dump_call_arg arg = {new_obj,tracker, object};
112
- TABLE_FOREACH(tbl, clone_variable, (st_data_t)&arg);
113
- }
114
+ if(tbl) {
115
+ struct dump_call_arg arg = {new_obj,tracker, object};
116
+ TABLE_FOREACH(tbl, clone_variable, (st_data_t)&arg);
117
+ }
114
118
 
115
- if(OBJ_FROZEN(object)) OBJ_FREEZE(new_obj);
119
+ if(OBJ_FROZEN(object)) OBJ_FREEZE(new_obj);
120
+ }
116
121
  break;
117
122
  }
118
123
  ident--;
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_deep_clone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
5
- prerelease:
4
+ version: 0.5.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Matthias Balmer
@@ -16,49 +15,43 @@ dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: rspec
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
- - - ~>
19
+ - - "~>"
22
20
  - !ruby/object:Gem::Version
23
21
  version: 2.13.0
24
22
  type: :development
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
- - - ~>
26
+ - - "~>"
30
27
  - !ruby/object:Gem::Version
31
28
  version: 2.13.0
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: rake-compiler
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
- - - ~>
33
+ - - "~>"
38
34
  - !ruby/object:Gem::Version
39
35
  version: 0.8.3
40
36
  type: :development
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
- - - ~>
40
+ - - "~>"
46
41
  - !ruby/object:Gem::Version
47
42
  version: 0.8.3
48
43
  - !ruby/object:Gem::Dependency
49
44
  name: rake
50
45
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
46
  requirements:
53
- - - ~>
47
+ - - "~>"
54
48
  - !ruby/object:Gem::Version
55
49
  version: 10.0.4
56
50
  type: :development
57
51
  prerelease: false
58
52
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
- - - ~>
54
+ - - "~>"
62
55
  - !ruby/object:Gem::Version
63
56
  version: 10.0.4
64
57
  description: Native implementation to create deep clones of Ruby objects
@@ -72,32 +65,31 @@ extensions:
72
65
  extra_rdoc_files: []
73
66
  files:
74
67
  - deep_clone.gemspec
75
- - lib/deep_clone.rb
76
68
  - ext/deep_clone/deep_clone.c
77
69
  - ext/deep_clone/deep_clone.h
78
70
  - ext/deep_clone/extconf.rb
71
+ - lib/deep_clone.rb
79
72
  homepage: https://github.com/balmma/ruby-deepclone
80
73
  licenses: []
74
+ metadata: {}
81
75
  post_install_message:
82
76
  rdoc_options: []
83
77
  require_paths:
84
78
  - ext
85
79
  - lib
86
80
  required_ruby_version: !ruby/object:Gem::Requirement
87
- none: false
88
81
  requirements:
89
- - - ! '>='
82
+ - - ">="
90
83
  - !ruby/object:Gem::Version
91
84
  version: '0'
92
85
  required_rubygems_version: !ruby/object:Gem::Requirement
93
- none: false
94
86
  requirements:
95
- - - ! '>='
87
+ - - ">="
96
88
  - !ruby/object:Gem::Version
97
89
  version: '0'
98
90
  requirements: []
99
91
  rubyforge_project:
100
- rubygems_version: 1.8.25
92
+ rubygems_version: 2.2.1
101
93
  signing_key:
102
94
  specification_version: 2
103
95
  summary: Ruby native deep clone