runeblog 0.0.58 → 0.0.59
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 +1 -1
- data/data/VERSION +1 -1
- data/lib/helpers-repl.rb +1 -1
- data/lib/repl.rb +11 -16
- data/lib/runeblog.rb +16 -1
- data/test/repl.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: f5ef2b59f2ea5d65799fce9e0d24bcb4038afa10
|
4
|
+
data.tar.gz: b643c98e0d6c8da57e0acd72f41029b7ea147c77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 113d0e271a81cd8f0d7021d66806bffcfcdedac95526ed7795ce056a47fb94c049d1b1eafcdcc9fad3f917f33d166d004bd58c09c3b05c32ab91bd178c2a29ee
|
7
|
+
data.tar.gz: 6f96ad2f2cc7826c52afb7e8ec946f355f0a7ad35b7853e4abdd8d4ea2ab0aa14c99dc729cad888a4e18df6daf9f970af14d43f1687a4987d94f5f2f29ce8ebc
|
data/bin/blog
CHANGED
data/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
RuneBlog v 0.0.
|
1
|
+
RuneBlog v 0.0.59 2018-09-16
|
data/lib/helpers-repl.rb
CHANGED
data/lib/repl.rb
CHANGED
@@ -4,6 +4,8 @@ require 'helpers-repl' # FIXME structure
|
|
4
4
|
|
5
5
|
module RuneBlog::REPL
|
6
6
|
|
7
|
+
# @blog = open_blog
|
8
|
+
|
7
9
|
def cmd_quit(arg)
|
8
10
|
check_empty(arg)
|
9
11
|
abort "\n "
|
@@ -106,7 +108,10 @@ module RuneBlog::REPL
|
|
106
108
|
reset_output("\n")
|
107
109
|
check_empty(arg)
|
108
110
|
abort "Config file not read" unless @blog
|
109
|
-
@blog.views.each
|
111
|
+
@blog.views.each do |v|
|
112
|
+
v = bold(v) if v == @blog.view
|
113
|
+
outstr " #{v}\n"
|
114
|
+
end
|
110
115
|
@out
|
111
116
|
rescue => err
|
112
117
|
error(err)
|
@@ -133,20 +138,9 @@ module RuneBlog::REPL
|
|
133
138
|
|
134
139
|
def cmd_new_view(arg)
|
135
140
|
reset_output
|
136
|
-
@blog ||= open_blog
|
137
141
|
arg ||= ask("New view: ") # check validity later
|
138
|
-
|
139
|
-
|
140
|
-
dir = @root + "/views/" + arg + "/"
|
141
|
-
create_dir(dir + 'custom')
|
142
|
-
create_dir(dir + 'assets')
|
143
|
-
File.open(dir + "deploy") { } # FIXME
|
144
|
-
|
145
|
-
# Something more like this? RuneBlog.new_view(arg)
|
146
|
-
File.write(dir + "custom/blog_header.html", RuneBlog::BlogHeader)
|
147
|
-
File.write(dir + "custom/blog_trailer.html", RuneBlog::BlogTrailer)
|
148
|
-
File.write(dir + "last_deployed", "Initial creation")
|
149
|
-
@blog.views << arg
|
142
|
+
RuneBlog.create_view(arg)
|
143
|
+
return nil
|
150
144
|
rescue => err
|
151
145
|
error(err)
|
152
146
|
end
|
@@ -154,9 +148,10 @@ module RuneBlog::REPL
|
|
154
148
|
def cmd_new_post(arg)
|
155
149
|
reset_output
|
156
150
|
check_empty(arg)
|
157
|
-
|
151
|
+
# open_blog unless @blog # duh?
|
158
152
|
@title = ask("Title: ")
|
159
153
|
@blog.create_new_post(@title)
|
154
|
+
return nil
|
160
155
|
rescue => err
|
161
156
|
error(err)
|
162
157
|
end
|
@@ -165,7 +160,7 @@ module RuneBlog::REPL
|
|
165
160
|
reset_output
|
166
161
|
args = arg.split
|
167
162
|
args.each {|x| cmd_remove_post([x], false) }
|
168
|
-
nil
|
163
|
+
return nil
|
169
164
|
rescue => err
|
170
165
|
error(err)
|
171
166
|
end
|
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.
|
6
|
+
VERSION = "0.0.59"
|
7
7
|
|
8
8
|
Path = File.expand_path(File.join(File.dirname(__FILE__)))
|
9
9
|
DefaultData = Path + "/../data"
|
@@ -56,6 +56,21 @@ class RuneBlog
|
|
56
56
|
File.exist?(".blog")
|
57
57
|
end
|
58
58
|
|
59
|
+
def create_view(name)
|
60
|
+
raise "view #{arg} already exists" if self.views.include?(arg)
|
61
|
+
|
62
|
+
dir = @root + "/views/" + arg + "/"
|
63
|
+
create_dir(dir + 'custom')
|
64
|
+
create_dir(dir + 'assets')
|
65
|
+
File.open(dir + "deploy", "w") { } # FIXME
|
66
|
+
|
67
|
+
# Something more like this? RuneBlog.new_view(arg)
|
68
|
+
File.write(dir + "custom/blog_header.html", RuneBlog::BlogHeader)
|
69
|
+
File.write(dir + "custom/blog_trailer.html", RuneBlog::BlogTrailer)
|
70
|
+
File.write(dir + "last_deployed", "Initial creation")
|
71
|
+
self.views << arg
|
72
|
+
end
|
73
|
+
|
59
74
|
def create_new_post(title, view=nil)
|
60
75
|
view ||= @view
|
61
76
|
date = Time.now.strftime("%Y-%m-%d")
|
data/test/repl.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.59
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|