blog-generator 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/blog-generator/post.rb +8 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f258b5e260b6477100127d77278a8b97ea9ce8c
4
- data.tar.gz: aa4775b05d306ef5788e22f430ff89ba6d998019
3
+ metadata.gz: 99b4a6e4adee3a1872bc70639064959f4e287f4a
4
+ data.tar.gz: 67668ed2d0b763d8fd36fc466533eb73ce5f76db
5
5
  SHA512:
6
- metadata.gz: e33b8e4920fd2e9fbd4f2962bfba99992b42c05daf605bfc62117334cf2c4010ded613a24ebe547e3f0779fddb4e4fd278089feadcf5f1993ccdbee27cceae63
7
- data.tar.gz: 9f3ea4463fcf75272be1b5aff24d34434f8139b5260bba931635dcbe16449b9cab8ce6edd3ee082975de5015972883a40f9929fa15b03f26c2239894b0970881
6
+ metadata.gz: 2f2920301bc20c3780bfe89dfc24ef993f5b925c6c035b5c18028b4f65fa94290ec40d64be14f2dc205f081721f73af2b8d6b90382804dcbc354dcd895e0da17
7
+ data.tar.gz: 90d0b3dfbad3743f7fe7e542f540772e4ed38100c30411f72c9a59800c46a3c83ba1ec8d8b6fa6c5e7f1a753098155b3c3bafa7ceb7a6b25e22d7090fef77227
@@ -41,7 +41,7 @@ module BlogGenerator
41
41
 
42
42
  def load_metadata
43
43
  self.raw_metadata.reduce(Hash.new) do |buffer, (slug, value)|
44
- buffer.merge(slug.to_sym => value.dup)
44
+ buffer.merge(slug.to_sym => try_to_dup(value))
45
45
  end
46
46
  end
47
47
 
@@ -125,5 +125,12 @@ module BlogGenerator
125
125
  published_on = match[1] ? Date.parse(match[1]).to_time.utc : nil
126
126
  [published_on, match[3], match[4].to_sym]
127
127
  end
128
+
129
+ # true and some others cannot be cloned.
130
+ def try_to_dup(value)
131
+ value.dup
132
+ rescue TypeError
133
+ value
134
+ end
128
135
  end
129
136
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blog-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James C Russell