runeblog 0.0.12 → 0.0.13

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/bin/blog +16 -11
  3. data/data/VERSION +1 -1
  4. data/lib/runeblog.rb +16 -11
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d9723f2b1c66529aa4845502907669a7262b10f
4
- data.tar.gz: 8f341eb35ff430168a7ea467a7d380381bad3985
3
+ metadata.gz: a0d20724848eac3276c922617ff768d1cff99329
4
+ data.tar.gz: 92ef30d939fe7501e547e1601d2d0c28f1d18da0
5
5
  SHA512:
6
- metadata.gz: 2ff01b349c131f3dffb73d2378d9e47cebe7fc787acfcba6423abdd752f916275599258eb28f5fa28fbaac88aacd8f4ba5e99829c26f62d3258e187c97e5d9e3
7
- data.tar.gz: 635ca6938d17a179a152d08b4fcbfdab8188186379d7671d627376ed74d658279635ea450beff87bff73fc0ae2cf057ab64b5b1df62df1754cfc87800478b9b4
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 This message
32
- q, quit Exit the program
33
- p, post Create a new post
34
- new post Same as post (create a post)
35
- list views List all views available
36
- lsv Same as: list views
37
- new view Create a new view
38
- relink Regenerate index for all views
39
- rebuild Regenerate all posts and relink
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.12 2017-05-05 00:00:00 UTC
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.12"
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
- Dir.chdir("#{@config.root}/views/#@view/")
326
- system("ls -d 0*")
327
- puts
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
-
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.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton