ruby-serial 1.0.2.20130725 → 1.0.3.20130731

Sign up to get free protection for your applications and to get access to all the features.
data/AUTHORS CHANGED
@@ -3,3 +3,4 @@
3
3
  * 1.0.0.20130705
4
4
  * 1.0.1.20130709
5
5
  * 1.0.2.20130725
6
+ * 1.0.3.20130731
data/ChangeLog CHANGED
@@ -1,5 +1,9 @@
1
1
  = Ruby-Serial Release History
2
2
 
3
+ == 1.0.3.20130725 (Beta)
4
+
5
+ * Added support for rubyserial_ondump and rubyserial_onload methods
6
+
3
7
  == 1.0.2.20130725 (Beta)
4
8
 
5
9
  * Can serialize objects with constructors having parameters
@@ -2,7 +2,7 @@
2
2
  # This file has been generated by RubyPackager during a delivery.
3
3
  # More info about RubyPackager: http://rubypackager.sourceforge.net
4
4
  {
5
- :version => '1.0.2.20130725',
5
+ :version => '1.0.3.20130731',
6
6
  :tags => [ 'Beta' ],
7
7
  :dev_status => 'Beta'
8
8
  }
@@ -48,14 +48,15 @@ module RubySerial
48
48
  elsif (decoded_obj.is_a?(Hash))
49
49
  # Check for special hashes
50
50
  if (decoded_obj[OBJECT_ID_REFERENCE] == nil)
51
- if (decoded_obj[OBJECT_CLASSNAME_REFERENCE] == CLASS_ID_SYMBOL)
51
+ case decoded_obj[OBJECT_CLASSNAME_REFERENCE]
52
+ when CLASS_ID_SYMBOL
52
53
  return decoded_obj[OBJECT_CONTENT_REFERENCE].to_sym
53
- elsif (decoded_obj[OBJECT_CLASSNAME_REFERENCE] == CLASS_ID_ENCODING)
54
+ when CLASS_ID_ENCODING
54
55
  return Encoding::find(decoded_obj[OBJECT_CONTENT_REFERENCE])
55
- elsif (decoded_obj[OBJECT_CLASSNAME_REFERENCE] == CLASS_ID_RANGE)
56
+ when CLASS_ID_RANGE
56
57
  serialized_first, serialized_last, exclude_end = decoded_obj[OBJECT_CONTENT_REFERENCE]
57
58
  return (exclude_end ? (get_original_rec(serialized_first)...get_original_rec(serialized_last)) : (get_original_rec(serialized_first)..get_original_rec(serialized_last)) )
58
- elsif (decoded_obj[OBJECT_CLASSNAME_REFERENCE] == nil)
59
+ when nil
59
60
  # Normal hash
60
61
  hash_obj = ((container_to_fill == nil) ? {} : container_to_fill)
61
62
  decoded_obj.each do |serialized_key, serialized_value|
@@ -71,6 +72,8 @@ module RubySerial
71
72
  instance_vars[var_name] = get_original_rec(serialized_value)
72
73
  end
73
74
  new_obj.set_instance_vars_from_rubyserial(instance_vars)
75
+ # If there is an onload callback, call it
76
+ new_obj.rubyserial_onload if (new_obj.respond_to?(:rubyserial_onload))
74
77
  return new_obj
75
78
  end
76
79
  else
@@ -137,6 +137,8 @@ module RubySerial
137
137
  }
138
138
  else
139
139
  # Handle other objects
140
+ # If there is an ondump callback, call it
141
+ obj.rubyserial_ondump if (obj.respond_to?(:rubyserial_ondump))
140
142
  serialized_instance_vars = {}
141
143
  obj.get_instance_vars_to_rubyserial.each do |var_name, value|
142
144
  serialized_instance_vars[var_name] = get_msgpack_compatible_rec(value)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-serial
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2.20130725
4
+ version: 1.0.3.20130731
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-25 00:00:00.000000000 Z
12
+ date: 2013-07-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack