runeblog 0.0.36 → 0.0.37
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/bin/blog +6 -4
- data/data/VERSION +1 -1
- data/lib/repl.rb +18 -30
- data/lib/runeblog.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a2e6291b4aff39ca0c02dbc4b37cbdc8b7b6da8
|
4
|
+
data.tar.gz: 983872044a0a48977748815171579d383bfc2e3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8115355f472e36bfc28284b100397acba86a612270f4795f88accbde2f549cfe2556e6e9c0156ddf04b8c900f0c18fa5b2966c4cd9789b1d45776bf829c474fd
|
7
|
+
data.tar.gz: 8fe0486247019c49ebc656639fd7f7690a11a7db065e1f4da7e04c25404a76f62c3913549924193339175ef9b53721ff1c56e72acd1fc6e610d0463f4c5cbe02
|
data/bin/blog
CHANGED
@@ -109,11 +109,12 @@ end
|
|
109
109
|
|
110
110
|
def handle_multi_rm
|
111
111
|
raise "Need at least one arg" unless @words.size >= 2
|
112
|
-
@words[1..-1].
|
112
|
+
@arg = @words[1..-1].join(" ")
|
113
|
+
@meth = :remove_multiple_posts
|
113
114
|
end
|
114
115
|
|
115
|
-
def parse_cmd
|
116
|
-
@cmd =
|
116
|
+
def parse_cmd(str)
|
117
|
+
@cmd = str
|
117
118
|
@arg = ""
|
118
119
|
if @cmd == ""
|
119
120
|
@meth = :do_nothing
|
@@ -198,7 +199,7 @@ if @cmd.nil? # REPL
|
|
198
199
|
loop do
|
199
200
|
print red("blog> ")
|
200
201
|
begin
|
201
|
-
|
202
|
+
parse_cmd(gets.chomp)
|
202
203
|
rescue => err
|
203
204
|
puts err
|
204
205
|
next
|
@@ -208,5 +209,6 @@ if @cmd.nil? # REPL
|
|
208
209
|
else # one command
|
209
210
|
file = File.open("/dev/tty")
|
210
211
|
STDIN.reopen(file) # avoid ARGF dumbness
|
212
|
+
parse_cmd(ARGV.join(" "))
|
211
213
|
execute_command
|
212
214
|
end
|
data/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
RuneBlog v 0.0.
|
1
|
+
RuneBlog v 0.0.37 2017-05-17
|
data/lib/repl.rb
CHANGED
@@ -275,9 +275,9 @@ Remainder of post goes here.
|
|
275
275
|
puts red("\n Error: (line #{__LINE__} of #{File.basename(__FILE__)}) ") + err.to_s
|
276
276
|
end
|
277
277
|
|
278
|
-
###
|
278
|
+
### publish_post
|
279
279
|
|
280
|
-
def
|
280
|
+
def publish_post(meta)
|
281
281
|
puts " #{colored_slug(meta.slug)}"
|
282
282
|
# First gather the views
|
283
283
|
views = meta.views
|
@@ -295,8 +295,7 @@ Remainder of post goes here.
|
|
295
295
|
|
296
296
|
def rebuild_post(file)
|
297
297
|
reload_post(file)
|
298
|
-
|
299
|
-
publish_post
|
298
|
+
publish_post(@meta) # FIXME ??
|
300
299
|
rescue => err
|
301
300
|
puts red("\n Error: (line #{__LINE__} of #{File.basename(__FILE__)}) ") + err.to_s
|
302
301
|
end
|
@@ -321,20 +320,12 @@ Remainder of post goes here.
|
|
321
320
|
puts red("\n Error: (line #{__LINE__} of #{File.basename(__FILE__)}) ") + err.to_s
|
322
321
|
end
|
323
322
|
|
324
|
-
### publish?
|
325
|
-
|
326
|
-
def publish?
|
327
|
-
yn = ask(red(" Publish? y/n "))
|
328
|
-
yn.upcase == "Y"
|
329
|
-
end
|
330
|
-
|
331
|
-
### publish_post
|
332
|
-
|
333
|
-
def publish_post
|
334
|
-
# Grab destination data
|
335
|
-
# scp changed files over
|
336
|
-
# puts " Publish: Not implemented yet"
|
337
|
-
end
|
323
|
+
# ### publish?
|
324
|
+
#
|
325
|
+
# def publish?
|
326
|
+
# yn = ask(red(" Publish? y/n "))
|
327
|
+
# yn.upcase == "Y"
|
328
|
+
# end
|
338
329
|
|
339
330
|
### list_views
|
340
331
|
|
@@ -401,10 +392,7 @@ Remainder of post goes here.
|
|
401
392
|
|
402
393
|
edit_initial_post(@fname)
|
403
394
|
process_post(@fname)
|
404
|
-
if publish?
|
405
|
-
link_post(@meta)
|
406
|
-
publish_post
|
407
|
-
end
|
395
|
+
publish_post(@meta) # if publish?
|
408
396
|
rescue => err
|
409
397
|
puts red("\n Error: (line #{__LINE__} of #{File.basename(__FILE__)}) ") + err.to_s
|
410
398
|
end
|
@@ -421,17 +409,15 @@ Remainder of post goes here.
|
|
421
409
|
edit_initial_post(file)
|
422
410
|
# file = @root + "/src/" + file
|
423
411
|
process_post(file) #- FIXME handle each view
|
424
|
-
if publish?
|
425
|
-
link_post(@meta)
|
426
|
-
publish_post
|
427
|
-
end
|
412
|
+
publish_post(@meta) # if publish?
|
428
413
|
rescue => err
|
429
414
|
puts red("\n Error: (line #{__LINE__} of #{File.basename(__FILE__)}) ") + err.to_s
|
430
415
|
end
|
431
416
|
|
432
417
|
### remove_multiple_posts
|
433
|
-
|
434
|
-
def remove_multiple_posts(
|
418
|
+
|
419
|
+
def remove_multiple_posts(str)
|
420
|
+
args = str.split
|
435
421
|
args.each {|arg| remove_post(arg, false) }
|
436
422
|
end
|
437
423
|
|
@@ -444,7 +430,7 @@ Remainder of post goes here.
|
|
444
430
|
tag = "#{'%04d' % id}-"
|
445
431
|
files = Find.find(@root).to_a
|
446
432
|
files = files.grep(/#{tag}/)
|
447
|
-
return puts red("\n No such post found") if files.empty?
|
433
|
+
return puts red("\n No such post found (#{tag})") if files.empty?
|
448
434
|
|
449
435
|
if safe
|
450
436
|
puts
|
@@ -460,6 +446,8 @@ Remainder of post goes here.
|
|
460
446
|
end
|
461
447
|
else
|
462
448
|
result = system("rm -rf #{files.join(' ')}")
|
449
|
+
puts red("\n Deleted:")
|
450
|
+
files.each {|f| puts " #{f}" }
|
463
451
|
raise "Problem mass-deleting file(s)" unless result
|
464
452
|
end
|
465
453
|
rescue => err
|
@@ -478,7 +466,7 @@ Remainder of post goes here.
|
|
478
466
|
files = files.grep(/#{tag}/)
|
479
467
|
files = files.map {|f| File.basename(f) }
|
480
468
|
return puts red("Multiple files: #{files}") if files.size > 1
|
481
|
-
return puts red("\n No such post found") if files.empty?
|
469
|
+
return puts red("\n No such post found (#{tag})") if files.empty?
|
482
470
|
|
483
471
|
file = files.first
|
484
472
|
result = system("vi #@root/src/#{file}")
|
data/lib/runeblog.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runeblog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.37
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|