arrayfields 4.3.0 → 4.4.0

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.
data/README CHANGED
@@ -272,6 +272,9 @@ AUTHOR
272
272
  ara.t.howard@gmail.com
273
273
 
274
274
  HISTORY
275
+ 4.4.0:
276
+ - working dup method worked in, also deepcopy and clone
277
+
275
278
  4.3.0:
276
279
  - a dup like method, named 'copy' and based on clone, is added to Arrayfields objects
277
280
 
data/README.tmpl CHANGED
@@ -92,6 +92,9 @@ AUTHOR
92
92
  ara.t.howard@gmail.com
93
93
 
94
94
  HISTORY
95
+ 4.4.0:
96
+ - working dup method worked in, also deepcopy and clone
97
+
95
98
  4.3.0:
96
99
  - a dup like method, named 'copy' and based on clone, is added to Arrayfields objects
97
100
 
data/a.rb CHANGED
@@ -1,8 +1,8 @@
1
- require 'rubygems'
2
- require 'arrayfields'
3
- puts "ruby version : #{RUBY_VERSION}"
4
- puts "gems version : #{Gem::RubyGemsVersion}"
5
- puts "arrayfields version : #{ArrayFields::VERSION}"
6
- require 'rake'
7
- puts 42
1
+ require 'rubygems'
2
+ require 'arrayfields'
3
+ puts "ruby version : #{RUBY_VERSION}"
4
+ puts "gems version : #{Gem::RubyGemsVersion}"
5
+ puts "arrayfields version : #{ArrayFields::VERSION}"
6
+ require 'rake'
7
+ puts 42
8
8
 
@@ -5,7 +5,7 @@
5
5
  # Array#fields= is called
6
6
  #
7
7
  module ArrayFields
8
- self::VERSION = '4.3.0' unless defined? self::VERSION
8
+ self::VERSION = '4.4.0' unless defined? self::VERSION
9
9
  def self.version() VERSION end
10
10
  #
11
11
  # multiton cache of fields - wraps fields and fieldpos map to save memory
@@ -250,10 +250,19 @@
250
250
  alias_method 'pairs', 'to_pairs'
251
251
 
252
252
  def copy
253
- cp = clone
253
+ cp = clone
254
254
  cp.fields = fields.clone
255
255
  cp
256
256
  end
257
+
258
+ alias_method 'dup', 'copy'
259
+ alias_method 'clone', 'copy'
260
+
261
+ def deepcopy
262
+ cp = Marshal.load(Marshal.dump(self))
263
+ cp.fields = Marshal.load(Marshal.dump(self.fields))
264
+ cp
265
+ end
257
266
  end
258
267
  Arrayfields = ArrayFields
259
268
 
data/lib/arrayfields.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  # Array#fields= is called
6
6
  #
7
7
  module ArrayFields
8
- self::VERSION = '4.3.0' unless defined? self::VERSION
8
+ self::VERSION = '4.4.0' unless defined? self::VERSION
9
9
  def self.version() VERSION end
10
10
  #
11
11
  # multiton cache of fields - wraps fields and fieldpos map to save memory
@@ -250,10 +250,19 @@
250
250
  alias_method 'pairs', 'to_pairs'
251
251
 
252
252
  def copy
253
- cp = clone
253
+ cp = clone
254
254
  cp.fields = fields.clone
255
255
  cp
256
256
  end
257
+
258
+ alias_method 'dup', 'copy'
259
+ alias_method 'clone', 'copy'
260
+
261
+ def deepcopy
262
+ cp = Marshal.load(Marshal.dump(self))
263
+ cp.fields = Marshal.load(Marshal.dump(self.fields))
264
+ cp
265
+ end
257
266
  end
258
267
  Arrayfields = ArrayFields
259
268
 
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: arrayfields
5
5
  version: !ruby/object:Gem::Version
6
- version: 4.3.0
6
+ version: 4.4.0
7
7
  date: 2007-09-18 00:00:00 -06:00
8
8
  summary: arrayfields
9
9
  require_paths:
@@ -34,7 +34,7 @@ files:
34
34
  - gen_readme.rb
35
35
  - install.rb
36
36
  - lib
37
- - lib/arrayfields-4.3.0.rb
37
+ - lib/arrayfields-4.4.0.rb
38
38
  - lib/arrayfields.rb
39
39
  - README
40
40
  - README.tmpl