runeblog 0.0.37 → 0.0.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/VERSION +1 -1
- data/lib/repl.rb +28 -9
- data/lib/runeblog.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: dfdf2ff420c85dec55444c49adf90bcc575345b9
|
4
|
+
data.tar.gz: b9db8a419d34258d9d0321227b1c9fade6bb1412
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb48c9b8af0fcb48c2024b23daffef23172e1b9676f47fc3b9e5389d328e54d2197f6c296251edd6df9d4c9aa5b9e81757053ba907435ef4a8c026ed0d05a449
|
7
|
+
data.tar.gz: 06789ea1030dfb724d4be0f86c035f6a0cb2123695b35dd8b252f57bfcc9b4621953473582b9eb0a06367d31064fce13202b1f0d13d35fcbc3bf0fb9d0f1a213
|
data/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
RuneBlog v 0.0.
|
1
|
+
RuneBlog v 0.0.38 2017-05-17
|
data/lib/repl.rb
CHANGED
@@ -254,18 +254,21 @@ Remainder of post goes here.
|
|
254
254
|
puts red("\n Error: (line #{__LINE__} of #{File.basename(__FILE__)}) ") + err.to_s
|
255
255
|
end
|
256
256
|
|
257
|
+
### create_dir
|
258
|
+
|
259
|
+
def create_dir
|
260
|
+
cmd = "mkdir -p #{dir} >/dev/null 2>&1"
|
261
|
+
result = system(cmd)
|
262
|
+
raise "Can't create #{dir}" unless result
|
263
|
+
end
|
264
|
+
|
257
265
|
### link_post_view
|
258
266
|
|
259
267
|
def link_post_view(view)
|
260
268
|
# Create dir using slug (index.html, metadata?)
|
261
269
|
vdir = @config.viewdir(view)
|
262
270
|
dir = vdir + @meta.slug + "/"
|
263
|
-
|
264
|
-
cmd = "mkdir -p #{dir}"
|
265
|
-
result = system(cmd)
|
266
|
-
raise "Can't create #{dir}" unless result
|
267
|
-
end
|
268
|
-
|
271
|
+
create_dir(dir + "assets")
|
269
272
|
File.write("#{dir}/metadata.yaml", @meta.to_yaml)
|
270
273
|
template = File.read(vdir + "custom/post_template.html")
|
271
274
|
post = interpolate(template)
|
@@ -275,6 +278,22 @@ Remainder of post goes here.
|
|
275
278
|
puts red("\n Error: (line #{__LINE__} of #{File.basename(__FILE__)}) ") + err.to_s
|
276
279
|
end
|
277
280
|
|
281
|
+
### find_asset
|
282
|
+
|
283
|
+
def find_asset(asset, views)
|
284
|
+
STDERR.puts " Search #{@meta.slug}"
|
285
|
+
views.each {|view| STDERR.puts " Search #{view}" }
|
286
|
+
STDERR.puts " Search #@root"
|
287
|
+
end
|
288
|
+
|
289
|
+
### find_all_assets
|
290
|
+
|
291
|
+
def find_all_assets(list, views)
|
292
|
+
STDERR.puts "\n Called find_assets with #{list.inspect}"
|
293
|
+
list ||= []
|
294
|
+
list.each {|asset| find_asset(asset, views) }
|
295
|
+
end
|
296
|
+
|
278
297
|
### publish_post
|
279
298
|
|
280
299
|
def publish_post(meta)
|
@@ -286,6 +305,7 @@ Remainder of post goes here.
|
|
286
305
|
print "#{view} "
|
287
306
|
link_post_view(view)
|
288
307
|
end
|
308
|
+
assets = find_assets(@meta.assets, views)
|
289
309
|
puts
|
290
310
|
rescue => err
|
291
311
|
puts red("\n Error: (line #{__LINE__} of #{File.basename(__FILE__)}) ") + err.to_s
|
@@ -364,9 +384,8 @@ Remainder of post goes here.
|
|
364
384
|
raise "view #{arg} already exists" if @config.views.include?(arg)
|
365
385
|
|
366
386
|
dir = @root + "/views/" + arg + "/"
|
367
|
-
|
368
|
-
|
369
|
-
raise "Could not create #{dir}/custom" unless result
|
387
|
+
create_dir(dir + 'custom')
|
388
|
+
create_dir(dir + 'assets')
|
370
389
|
|
371
390
|
File.write(dir + "custom/blog_header.html", RuneBlog::BlogHeader)
|
372
391
|
File.write(dir + "custom/blog_trailer.html", RuneBlog::BlogTrailer)
|
data/lib/runeblog.rb
CHANGED