runeblog 0.0.30 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blog +4 -0
- data/data/VERSION +1 -1
- data/lib/repl.rb +41 -12
- data/lib/runeblog.rb +1 -1
- data/runeblog.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 723dfcd02942dab4992da211a1319c819fb37477
|
4
|
+
data.tar.gz: 463da39549a74e0ded3f38f39b8c5dd187252265
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cab5fb3f93542e90bdb38642452d3add274cc7df132340bbbb1155aee2c7711b83ac9a9153adcaf812fcd438a5f8351f36baa190b02c8978ae843149534752d3
|
7
|
+
data.tar.gz: 67ac663301af71c279bf064eb055257ac620b79879a68b4ee38b2704f496250f6c6cba0fc2abba0a2ebff74b10fafd72658f28bb777a2b303b3ce5b0af2993fe
|
data/bin/blog
CHANGED
@@ -98,6 +98,10 @@ def parse_cmd
|
|
98
98
|
raise "Too many arguments" if @words.size > 2
|
99
99
|
@meth = :remove_post
|
100
100
|
@arg = need_arg(1)
|
101
|
+
when "e", "edit"
|
102
|
+
raise "Too many arguments" if @words.size > 2
|
103
|
+
@meth = :edit_post
|
104
|
+
@arg = need_arg(1)
|
101
105
|
when "list"
|
102
106
|
case @words[1]
|
103
107
|
when "views"
|
data/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
RuneBlog v 0.0.
|
1
|
+
RuneBlog v 0.0.31 2017-05-11
|
data/lib/repl.rb
CHANGED
@@ -110,9 +110,9 @@ module RuneBlog::REPL
|
|
110
110
|
@fname
|
111
111
|
end
|
112
112
|
|
113
|
-
###
|
113
|
+
### edit_initial_post
|
114
114
|
|
115
|
-
def
|
115
|
+
def edit_initial_post(file)
|
116
116
|
system("vi #@root/src/#{file} +8 ")
|
117
117
|
end
|
118
118
|
|
@@ -249,6 +249,14 @@ module RuneBlog::REPL
|
|
249
249
|
puts
|
250
250
|
end
|
251
251
|
|
252
|
+
### rebuild_post
|
253
|
+
|
254
|
+
def rebuild_post(file)
|
255
|
+
reload_post(file)
|
256
|
+
link_post(@meta) # FIXME ??
|
257
|
+
publish_post
|
258
|
+
end
|
259
|
+
|
252
260
|
### rebuild
|
253
261
|
|
254
262
|
def rebuild
|
@@ -256,19 +264,13 @@ module RuneBlog::REPL
|
|
256
264
|
files = Dir.entries("#@root/src/").grep /\d\d\d\d.*.lt3$/
|
257
265
|
files.map! {|f| File.basename(f) }
|
258
266
|
files = files.sort.reverse
|
259
|
-
files.each
|
260
|
-
reload_post(file)
|
261
|
-
link_post(@meta)
|
262
|
-
publish_post
|
263
|
-
end
|
267
|
+
files.each {|file| rebuild_post(file) }
|
264
268
|
end
|
265
269
|
|
266
270
|
### relink
|
267
271
|
|
268
272
|
def relink
|
269
|
-
@config.views.each
|
270
|
-
generate_index(view)
|
271
|
-
end
|
273
|
+
@config.views.each {|view| generate_index(view) }
|
272
274
|
end
|
273
275
|
|
274
276
|
### publish?
|
@@ -335,7 +337,7 @@ module RuneBlog::REPL
|
|
335
337
|
@slug = make_slug(@title)
|
336
338
|
@fname = @slug + ".lt3"
|
337
339
|
system("cp #{name} #@root/src/#@fname")
|
338
|
-
|
340
|
+
edit_initial_post(@fname)
|
339
341
|
process_post(@fname)
|
340
342
|
if publish?
|
341
343
|
link_post(@meta)
|
@@ -352,7 +354,7 @@ module RuneBlog::REPL
|
|
352
354
|
@date = Time.now.strftime("%Y-%m-%d")
|
353
355
|
|
354
356
|
file = create_empty_post
|
355
|
-
|
357
|
+
edit_initial_post(file)
|
356
358
|
# file = @root + "/src/" + file
|
357
359
|
process_post(file) #- FIXME handle each view
|
358
360
|
if publish?
|
@@ -389,6 +391,33 @@ module RuneBlog::REPL
|
|
389
391
|
puts
|
390
392
|
end
|
391
393
|
|
394
|
+
### edit_post
|
395
|
+
|
396
|
+
#-- FIXME affects linking, building, deployment...
|
397
|
+
|
398
|
+
def edit_post(arg)
|
399
|
+
id = Integer(arg) rescue raise("'#{arg}' is not an integer")
|
400
|
+
tag = "#{'%04d' % id}-"
|
401
|
+
files = Find.find(@root+"/src").to_a
|
402
|
+
files = files.grep(/#{tag}/)
|
403
|
+
files = files.map {|f| File.basename(f) }
|
404
|
+
if files.size > 1
|
405
|
+
puts red("Multiple files: #{files}")
|
406
|
+
return
|
407
|
+
end
|
408
|
+
if files.empty?
|
409
|
+
puts red("\n No such post found")
|
410
|
+
return
|
411
|
+
end
|
412
|
+
|
413
|
+
file = files.first
|
414
|
+
system("vi #@root/src/#{file}")
|
415
|
+
rebuild_post(file)
|
416
|
+
rescue => err
|
417
|
+
puts err
|
418
|
+
puts
|
419
|
+
end
|
420
|
+
|
392
421
|
### list_posts
|
393
422
|
|
394
423
|
def list_posts
|
data/lib/runeblog.rb
CHANGED
data/runeblog.gemspec
CHANGED
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.
|
4
|
+
version: 0.0.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
@@ -9,7 +9,21 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2017-05-11 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: livetext
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.8.18
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.8.18
|
13
27
|
description: A blog system based on Ruby and Livetext
|
14
28
|
email: rubyhacker@gmail.com
|
15
29
|
executables:
|