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.
- checksums.yaml +4 -4
- data/lib/blog-generator/post.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99b4a6e4adee3a1872bc70639064959f4e287f4a
|
4
|
+
data.tar.gz: 67668ed2d0b763d8fd36fc466533eb73ce5f76db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f2920301bc20c3780bfe89dfc24ef993f5b925c6c035b5c18028b4f65fa94290ec40d64be14f2dc205f081721f73af2b8d6b90382804dcbc354dcd895e0da17
|
7
|
+
data.tar.gz: 90d0b3dfbad3743f7fe7e542f540772e4ed38100c30411f72c9a59800c46a3c83ba1ec8d8b6fa6c5e7f1a753098155b3c3bafa7ceb7a6b25e22d7090fef77227
|
data/lib/blog-generator/post.rb
CHANGED
@@ -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
|
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
|