runeblog 0.2.91 → 0.2.92
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 -1
- data/empty_view/themes/standard/global.lt3 +1 -1
- data/empty_view/themes/standard/post/index.lt3 +8 -8
- data/empty_view/themes/standard/widgets/links/links.rb +1 -1
- data/empty_view/themes/standard/widgets/news/news.rb +1 -1
- data/empty_view/themes/standard/widgets/pages/pages.rb +1 -1
- data/empty_view/themes/standard/widgets/pinned/pinned.rb +1 -1
- data/lib/helpers-blog.rb +19 -2
- data/lib/liveblog.rb +6 -3
- data/lib/repl.rb +2 -1
- data/lib/runeblog.rb +6 -2
- data/lib/runeblog_version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a01afc10ad3439db402e06d8c0d5674d247485fe82c63c29160ca70d8e43a6d
|
4
|
+
data.tar.gz: 50df27f119a4df78b1c366dc119e4b84c8fb45a9707a02d43e1e20e8caa32e01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f3ffe63bab275d26f14c516f24b48c127fc8bd4a661c32b17528a9d0bd399a85294fbb33af24436984a0dfe749d7a7651acc37b096819a71dbb763375d2ef3f
|
7
|
+
data.tar.gz: 6ee5c12a07c7f493b71352ca0aa0bd633810222efda55e19925ed8dc71b4ee42a27b58a352bfce2d1bd815768513c9e9c6216178278995f26cf2188aae8bca93
|
data/bin/blog
CHANGED
@@ -146,7 +146,10 @@ end
|
|
146
146
|
|
147
147
|
major, minor = RUBY_VERSION.split(".").values_at(0,1)
|
148
148
|
ver = major.to_i*10 + minor.to_i
|
149
|
-
|
149
|
+
unless ver >= 24
|
150
|
+
RubyText.stop
|
151
|
+
abort "Need Ruby 2.4 or greater"
|
152
|
+
end
|
150
153
|
|
151
154
|
include RuneBlog::Helpers # for try_read_config
|
152
155
|
|
@@ -6,19 +6,19 @@
|
|
6
6
|
. likely be the place.
|
7
7
|
. --------------------------------------------------
|
8
8
|
|
9
|
-
.mixin liveblog
|
10
|
-
. ^ get rid of this later
|
11
|
-
|
12
9
|
.post 0
|
13
10
|
|
14
|
-
.title
|
11
|
+
.title This is my title
|
15
12
|
.pubdate 2019-07-09
|
16
|
-
.views
|
13
|
+
.views stuff
|
17
14
|
.tags
|
18
15
|
|
19
16
|
.teaser
|
20
|
-
|
21
|
-
|
17
|
+
This is only a short excerpt from the top of the blog post.
|
22
18
|
.end
|
23
|
-
|
19
|
+
|
20
|
+
And now we continue the post.
|
21
|
+
Do we have anything to say?
|
22
|
+
|
23
|
+
Apparently not much.
|
24
24
|
|
data/lib/helpers-blog.rb
CHANGED
@@ -5,6 +5,23 @@ require 'processing'
|
|
5
5
|
|
6
6
|
module RuneBlog::Helpers
|
7
7
|
|
8
|
+
def _get_data?(file) # File need not exist
|
9
|
+
if File.exist?(file)
|
10
|
+
_get_data(file)
|
11
|
+
else
|
12
|
+
[]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def _get_data(file)
|
17
|
+
lines = File.readlines(file)
|
18
|
+
lines.reject! {|line| line[0] == "-" } # allow rejection of lines
|
19
|
+
lines = lines.map do |line|
|
20
|
+
line.sub(/ *# .*$/, "") # allow trailing comments
|
21
|
+
end
|
22
|
+
lines
|
23
|
+
end
|
24
|
+
|
8
25
|
def copy(src, dst)
|
9
26
|
log!(enter: __method__, args: [src, dst], level: 2)
|
10
27
|
cmd = "cp #{src} #{dst} 2>/dev/null"
|
@@ -100,13 +117,13 @@ module RuneBlog::Helpers
|
|
100
117
|
end
|
101
118
|
end
|
102
119
|
|
103
|
-
def
|
120
|
+
def retrieve_views # read from filesystem
|
104
121
|
log!(enter: __method__, level: 3)
|
105
122
|
dirs = subdirs("#@root/views/").sort
|
106
123
|
dirs.map {|name| RuneBlog::View.new(name) }
|
107
124
|
end
|
108
125
|
|
109
|
-
def write_repo_config(root: "#{Dir.pwd}/.blogs", view: "#{root}/data/VIEW", editor: "/usr/local/bin/vim")
|
126
|
+
def write_repo_config(root: "#{Dir.pwd}/.blogs", view: File.read("#{root}/data/VIEW").chomp, editor: "/usr/local/bin/vim")
|
110
127
|
File.write(root + "/data/ROOT", root + "\n")
|
111
128
|
File.write(root + "/data/VIEW", view.to_s + "\n")
|
112
129
|
File.write(root + "/data/EDITOR", editor + "\n")
|
data/lib/liveblog.rb
CHANGED
@@ -86,9 +86,9 @@ end
|
|
86
86
|
|
87
87
|
def _read_navbar_data
|
88
88
|
vdir = @blog.root/:views/@blog.view
|
89
|
-
dir = vdir/"themes/standard/banner/"
|
89
|
+
dir = vdir/"themes/standard/banner/navbar/"
|
90
90
|
datafile = dir/"list.data"
|
91
|
-
|
91
|
+
_get_data(datafile)
|
92
92
|
end
|
93
93
|
|
94
94
|
def banner
|
@@ -100,6 +100,9 @@ def banner
|
|
100
100
|
navbar = nil
|
101
101
|
vdir = @blog.root/:views/@blog.view
|
102
102
|
lines = _body.to_a
|
103
|
+
TTY.puts "-"*30
|
104
|
+
lines.each {|x| TTY.puts x }
|
105
|
+
TTY.puts "-"*30
|
103
106
|
|
104
107
|
lines.each do |line|
|
105
108
|
count += 1
|
@@ -343,7 +346,7 @@ def pin
|
|
343
346
|
pinned.each do |pinview|
|
344
347
|
dir = @blog.root/:views/pinview/"themes/standard/widgets/pinned/"
|
345
348
|
datafile = dir/"list.data"
|
346
|
-
pins =
|
349
|
+
pins = _get_data?(datafile)
|
347
350
|
pins << "#{@meta.num} #{@meta.title}\n"
|
348
351
|
pins.uniq!
|
349
352
|
File.open(datafile, "w") {|out| pins.each {|pin| out.puts pin } }
|
data/lib/repl.rb
CHANGED
@@ -114,7 +114,7 @@ module RuneBlog::REPL
|
|
114
114
|
dir = @blog.view.dir/"themes/standard/widgets/pages"
|
115
115
|
# Assume child files already generated (and list.data??)
|
116
116
|
data = dir/"list.data"
|
117
|
-
lines =
|
117
|
+
lines = _get_data?(data)
|
118
118
|
hash = {}
|
119
119
|
lines.each do |line|
|
120
120
|
url, name = line.chomp.split(",")
|
@@ -229,6 +229,7 @@ module RuneBlog::REPL
|
|
229
229
|
debug "Starting cmd_rebuild..."
|
230
230
|
reset_output
|
231
231
|
puts unless testing
|
232
|
+
TTY.puts "rebuilding #{@blog.view.inspect}"
|
232
233
|
@blog.generate_view(@blog.view)
|
233
234
|
@blog.generate_index(@blog.view)
|
234
235
|
@out
|
data/lib/runeblog.rb
CHANGED
@@ -90,10 +90,13 @@ class RuneBlog
|
|
90
90
|
self.class.blog = self # Weird. Like a singleton - dumbass circular dependency?
|
91
91
|
|
92
92
|
@root = Dir.pwd/root_rel
|
93
|
-
copy_data(:config, @root/:data)
|
93
|
+
copy_data(:config, @root/:data) unless File.exist?(@root/"data/VIEW")
|
94
94
|
write_repo_config(root: @root)
|
95
95
|
get_repo_config
|
96
|
-
@views =
|
96
|
+
@views = retrieve_views
|
97
|
+
puts @views.inspect
|
98
|
+
system("cat #@root/data/VIEW")
|
99
|
+
self.view = File.read(@root/"data/VIEW").chomp
|
97
100
|
md = Dir.pwd.match(%r[.*/views/(.*?)/])
|
98
101
|
if md
|
99
102
|
@view_name = md[1]
|
@@ -460,6 +463,7 @@ class RuneBlog
|
|
460
463
|
|
461
464
|
def generate_view(view) # huh?
|
462
465
|
log!(enter: __method__, args: [view])
|
466
|
+
puts "gv: view = #{view}"
|
463
467
|
vdir = @root/:views/view
|
464
468
|
@theme = @root/:views/view/:themes/:standard
|
465
469
|
depend = [vdir/"remote/etc/blog.css.lt3", @theme/"global.lt3",
|
data/lib/runeblog_version.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.2.
|
4
|
+
version: 0.2.92
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|