runeblog 0.0.37 → 0.0.38

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/data/VERSION +1 -1
  3. data/lib/repl.rb +28 -9
  4. data/lib/runeblog.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a2e6291b4aff39ca0c02dbc4b37cbdc8b7b6da8
4
- data.tar.gz: 983872044a0a48977748815171579d383bfc2e3c
3
+ metadata.gz: dfdf2ff420c85dec55444c49adf90bcc575345b9
4
+ data.tar.gz: b9db8a419d34258d9d0321227b1c9fade6bb1412
5
5
  SHA512:
6
- metadata.gz: 8115355f472e36bfc28284b100397acba86a612270f4795f88accbde2f549cfe2556e6e9c0156ddf04b8c900f0c18fa5b2966c4cd9789b1d45776bf829c474fd
7
- data.tar.gz: 8fe0486247019c49ebc656639fd7f7690a11a7db065e1f4da7e04c25404a76f62c3913549924193339175ef9b53721ff1c56e72acd1fc6e610d0463f4c5cbe02
6
+ metadata.gz: fb48c9b8af0fcb48c2024b23daffef23172e1b9676f47fc3b9e5389d328e54d2197f6c296251edd6df9d4c9aa5b9e81757053ba907435ef4a8c026ed0d05a449
7
+ data.tar.gz: 06789ea1030dfb724d4be0f86c035f6a0cb2123695b35dd8b252f57bfcc9b4621953473582b9eb0a06367d31064fce13202b1f0d13d35fcbc3bf0fb9d0f1a213
data/data/VERSION CHANGED
@@ -1 +1 @@
1
- RuneBlog v 0.0.37 2017-05-17
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
- unless File.exist?(dir) and File.directory?(dir)
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
- cmd = "mkdir -p #{dir + 'custom'}"
368
- result = system(cmd)
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
@@ -3,7 +3,7 @@ require 'yaml'
3
3
  require 'livetext'
4
4
 
5
5
  class RuneBlog
6
- VERSION = "0.0.37"
6
+ VERSION = "0.0.38"
7
7
 
8
8
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
9
9
  DefaultData = Path + "/../data"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.37
4
+ version: 0.0.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton