storable 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/CHANGES.txt +7 -0
  2. data/lib/storable.rb +5 -5
  3. data/storable.gemspec +1 -1
  4. metadata +4 -4
data/CHANGES.txt CHANGED
@@ -3,6 +3,13 @@ STORABLE, CHANGES
3
3
  * TODO: Handle nested hashes and arrays.
4
4
  * TODO: to_xml, see: http://codeforpeople.com/lib/ruby/xx/xx-2.0.0/README
5
5
 
6
+
7
+ #### 0.8.3 (2010-11-02) #############################
8
+
9
+ * FIXED: Handling of Boolean fields when the value is null.
10
+ * CHANGE: from_hash explicitly checks field names as Symbols and Strings
11
+
12
+
6
13
  #### 0.8.2 (2010-09-05) #############################
7
14
 
8
15
  * FIXED: undefined method `each_pair' for nil:NilClass for hash_proc_processor
data/lib/storable.rb CHANGED
@@ -35,7 +35,7 @@ class Storable
35
35
  require 'proc_source'
36
36
  require 'storable/orderedhash' if USE_ORDERED_HASH
37
37
  unless defined?(SUPPORTED_FORMATS) # We can assume all are defined
38
- VERSION = "0.8.2"
38
+ VERSION = "0.8.3"
39
39
  NICE_TIME_FORMAT = "%Y-%m-%d@%H:%M:%S".freeze
40
40
  SUPPORTED_FORMATS = [:tsv, :csv, :yaml, :json, :s, :string].freeze
41
41
  end
@@ -217,11 +217,11 @@ class Storable
217
217
 
218
218
  def from_hash(from={})
219
219
  fnames = field_names
220
+
220
221
  return from if fnames.nil? || fnames.empty?
221
222
  fnames.each_with_index do |fname,index|
222
223
  ftype = field_types[fname]
223
- value_orig = from[fname] || from[fname.to_s]
224
-
224
+ value_orig = from[fname.to_s] || from[fname.to_s.to_sym]
225
225
  next if value_orig.nil?
226
226
 
227
227
  if ( ftype == String or ftype == Symbol ) && value_orig.to_s.empty?
@@ -264,8 +264,8 @@ class Storable
264
264
  value = Proc.from_string value_orig
265
265
  end
266
266
  end
267
-
268
- value ||= value_orig
267
+
268
+ value = value_orig if value.nil?
269
269
 
270
270
  if self.respond_to?("#{fname}=")
271
271
  self.send("#{fname}=", value)
data/storable.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = "storable"
3
3
  s.rubyforge_project = "storable"
4
- s.version = "0.8.2"
4
+ s.version = "0.8.3"
5
5
  s.summary = "Storable: Marshal Ruby classes into and out of multiple formats (yaml, json, csv, tsv)"
6
6
  s.description = s.summary
7
7
  s.author = "Delano Mandelbaum"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: storable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 2
10
- version: 0.8.2
9
+ - 3
10
+ version: 0.8.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Delano Mandelbaum
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-05 00:00:00 -04:00
18
+ date: 2010-11-02 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21