artifact 0.2.5 → 0.2.6
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.
- checksums.yaml +4 -4
- data/lib/artifact/middleman.rb +4 -4
- data/lib/artifact/version.rb +1 -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: 1f929f66acb44ec95065685aa54fcb231b67e45d
|
4
|
+
data.tar.gz: 0aa1053336b4590294f8a73bbd489de9d6229e6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40ab00a99aa37365e181ba35f3297c8c15e3feb0c83da010de6becb5c6dd1012ca719db0c10b9d1f51977fe4e7ec8cfd74628f5c521280964dc4ea15b2871587
|
7
|
+
data.tar.gz: e448c93c689612e8b6815f2a0acdfd0913711d14200b4acb63f98a541e6964c2090dc4cf60f6f92e3143978cc32b50df16f6d8117c97969206c9fdcc8827e55b
|
data/lib/artifact/middleman.rb
CHANGED
@@ -113,7 +113,7 @@ module Artifact
|
|
113
113
|
@post = MarkdownFile.new(params[:splat][0])
|
114
114
|
|
115
115
|
# ensure date is valid and insert author/last_updated_by
|
116
|
-
meta = check_post_meta! or halt(422, "Invalid meta.")
|
116
|
+
meta = check_post_meta!(params[:save]) or halt(422, "Invalid meta.")
|
117
117
|
|
118
118
|
# puts "Writing content and meta to file: #{meta.inspect}"
|
119
119
|
@post.update(params[:content].gsub("\r\n", "\n"), meta)
|
@@ -180,13 +180,13 @@ module Artifact
|
|
180
180
|
|
181
181
|
private
|
182
182
|
|
183
|
-
def check_post_meta!
|
183
|
+
def check_post_meta!(action)
|
184
184
|
meta = (params[:meta] || {}).symbolize_keys.merge(:last_updated_by => current_user[:email])
|
185
185
|
|
186
|
-
if meta[:date]
|
186
|
+
if meta[:date] or action.to_s.downcase.to_sym != :publish
|
187
187
|
# puts "Meta date is #{meta[:date]}"
|
188
188
|
return false unless valid_date?(meta[:date])
|
189
|
-
else # no date, set current
|
189
|
+
else # either publishing or no date, so set current
|
190
190
|
meta[:date] = Time.now.utc.strftime("%Y-%m-%d %H:%M %Z")
|
191
191
|
end
|
192
192
|
|
data/lib/artifact/version.rb
CHANGED