runeblog 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blog +16 -11
- data/data/VERSION +1 -1
- data/lib/runeblog.rb +16 -11
- 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: a0d20724848eac3276c922617ff768d1cff99329
|
4
|
+
data.tar.gz: 92ef30d939fe7501e547e1601d2d0c28f1d18da0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac55ecffcc926ba4c6e6d4694ea3cfcbdaa08a816d3ecc0868add0655ba1f4852297994aa42cbf98e3f45223bcd50906fa5842a0a6b500f128e033b0b7b60960
|
7
|
+
data.tar.gz: e74d325b989475a4d9b5d43975469027d8ab0d3856acdd11d4d106277d084d57d191c7c1da28b1d4f5d4809a14f54d72f1c19082b6c5cdfab1727cab039d760a
|
data/bin/blog
CHANGED
@@ -5,7 +5,6 @@ $: << "./lib"
|
|
5
5
|
require 'runeblog'
|
6
6
|
|
7
7
|
def execute_command
|
8
|
-
puts "CMD = #@cmd"
|
9
8
|
case @cmd
|
10
9
|
when "h", "help"; help
|
11
10
|
when "q", "quit"; exit
|
@@ -20,7 +19,7 @@ def execute_command
|
|
20
19
|
when "rebuild"; rebuild
|
21
20
|
when "version"; puts RuneBlog::VERSION
|
22
21
|
else
|
23
|
-
puts "Huh? I don't know #{@cmd}"
|
22
|
+
puts "\n Huh? I don't know the command '#{@cmd}'"
|
24
23
|
end
|
25
24
|
puts
|
26
25
|
end
|
@@ -28,15 +27,21 @@ end
|
|
28
27
|
def help
|
29
28
|
puts <<-EOS
|
30
29
|
Commands:
|
31
|
-
h, help
|
32
|
-
q, quit
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
30
|
+
h, help This message
|
31
|
+
q, quit Exit the program
|
32
|
+
|
33
|
+
change view Change current view
|
34
|
+
new view Create a new view
|
35
|
+
list views List all views available
|
36
|
+
lsv Same as: list views
|
37
|
+
|
38
|
+
p, post Create a new post
|
39
|
+
new post Same as post (create a post)
|
40
|
+
lsp, list posts List posts in current view
|
41
|
+
|
42
|
+
relink Regenerate index for all views
|
43
|
+
rebuild Regenerate all posts and relink
|
44
|
+
|
40
45
|
EOS
|
41
46
|
end
|
42
47
|
|
data/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
RuneBlog v 0.0.
|
1
|
+
RuneBlog v 0.0.13 2017-05-05 00:00:00 UTC
|
data/lib/runeblog.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
class RuneBlog
|
3
|
-
VERSION = "0.0.
|
3
|
+
VERSION = "0.0.13"
|
4
4
|
|
5
5
|
Path = File.expand_path(File.join(File.dirname(__FILE__)))
|
6
6
|
DefaultData = Path + "/../data"
|
@@ -64,7 +64,7 @@ end
|
|
64
64
|
|
65
65
|
def next_sequence
|
66
66
|
@config.sequence += 1
|
67
|
-
File.open("data/sequence", "w") {|f| f.puts @config.sequence }
|
67
|
+
File.open("#{@config.root}/data/sequence", "w") {|f| f.puts @config.sequence }
|
68
68
|
@config.sequence
|
69
69
|
end
|
70
70
|
|
@@ -322,15 +322,20 @@ end
|
|
322
322
|
### list_posts
|
323
323
|
|
324
324
|
def list_posts
|
325
|
-
|
326
|
-
|
327
|
-
|
325
|
+
dir = "#{@config.root}/views/#@view/"
|
326
|
+
Dir.chdir(dir) do
|
327
|
+
posts = Dir.entries(".").grep(/^0.*/)
|
328
|
+
puts
|
329
|
+
if posts.empty?
|
330
|
+
puts "No posts"
|
331
|
+
else
|
332
|
+
posts.each {|post| puts " #{post}" }
|
333
|
+
end
|
334
|
+
puts
|
335
|
+
end
|
336
|
+
rescue
|
337
|
+
puts "Oops? cwd = #{Dir.pwd} dir = #{dir}"
|
338
|
+
exit
|
328
339
|
end
|
329
340
|
|
330
341
|
|
331
|
-
### templates
|
332
|
-
|
333
|
-
class RuneBlog
|
334
|
-
|
335
|
-
end
|
336
|
-
|