runeblog 0.3.03 → 0.3.04
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/empty_view/settings/recent.txt +5 -0
- data/lib/repl.rb +13 -33
- data/lib/runeblog.rb +9 -4
- data/lib/runeblog_version.rb +1 -1
- data/lib/view.rb +4 -0
- 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: fad63c680c64fff5ca7fab06ee3c95a2d1b51f4bd4d3c0e74b21b917599f9086
|
4
|
+
data.tar.gz: '0906af618397683f84fd78d43b6f7742fbc64d9872290ea96067447079f45637'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0aa69a9da231a7fa90f64f86ebcf0d4d1cc135d59682f5fb313b129374a8e976011578ad1f962baca9fbe0a095134b7d22d185a542f195f317ed0d56e6172a4
|
7
|
+
data.tar.gz: da1e4bd77770d91aa872fe61d2a8e17fad3f26fbc5ed766a84adb15c5087a780e57940a6ceebf5656e169bde4b05a439d138e696c00ef1c7fd8b2ab2b15c330c
|
data/lib/repl.rb
CHANGED
@@ -14,20 +14,21 @@ module RuneBlog::REPL
|
|
14
14
|
result = system!("#{@blog.editor} #{file} #{params}")
|
15
15
|
raise EditorProblem(file) unless result
|
16
16
|
STDSCR.restback
|
17
|
-
|
17
|
+
cmd_clear(nil)
|
18
18
|
end
|
19
19
|
|
20
20
|
def cmd_quit(arg, testing = false)
|
21
21
|
cmd_clear(nil)
|
22
|
+
sleep 0.1
|
22
23
|
RubyText.stop
|
23
24
|
sleep 0.1
|
24
|
-
|
25
|
+
system("clear")
|
25
26
|
sleep 0.1
|
26
27
|
exit
|
27
28
|
end
|
28
29
|
|
29
30
|
def cmd_clear(arg, testing = false)
|
30
|
-
|
31
|
+
STDSCR.rows.times { puts " "*(STDSCR.cols-1) }
|
31
32
|
STDSCR.clear
|
32
33
|
end
|
33
34
|
|
@@ -38,44 +39,25 @@ module RuneBlog::REPL
|
|
38
39
|
@out
|
39
40
|
end
|
40
41
|
|
41
|
-
def OLD_cmd_config(arg, testing = false)
|
42
|
-
hash = {"global.lt3 Global configuration" => "global.lt3",
|
43
|
-
"banner/top.lt3 Text portion of banner" => "banner/top.lt3",
|
44
|
-
"blog/generate.lt3 Generator for view (usu not edited)" => "blog/generate.lt3",
|
45
|
-
".... head.lt3 HEAD info for view" => "blog/head.lt3",
|
46
|
-
".... banner.lt3 banner description" => "blog/banner.lt3",
|
47
|
-
".... index.lt3 User-edited detail for view" => "blog/index.lt3",
|
48
|
-
".... post_entry.lt3 Generator for post entry in recent-posts" => "blog/post_entry.lt3",
|
49
|
-
"etc/blog.css.lt3 Global CSS" => "etc/blog.css.lt3",
|
50
|
-
"... externals.lt3 External JS/CSS (Bootstrap, etc.)" => "/etc/externals.lt3",
|
51
|
-
"post/generate.lt3 Generator for a post" => "post/generate.lt3",
|
52
|
-
".... head.lt3 HEAD info for post" => "post/head.lt3",
|
53
|
-
".... index.lt3 Content for post" => "post/index.lt3",
|
54
|
-
".... permalink.lt3 Generator for permalink" => "post/permalink.lt3",
|
55
|
-
}
|
56
|
-
|
57
|
-
dir = @blog.view.dir/"themes/standard/"
|
58
|
-
num, target = STDSCR.menu(title: "Edit file:", items: hash)
|
59
|
-
edit_file(dir/target)
|
60
|
-
end
|
61
|
-
|
62
42
|
def cmd_config(arg, testing = false)
|
63
43
|
hash = {"Global configuration" => "global.lt3",
|
64
44
|
" View-specific variables" => "../../settings/view.txt",
|
65
45
|
" Recent posts" => "../../settings/recent.txt",
|
66
46
|
" Publishing vars" => "../../settings/publish.txt",
|
67
|
-
"
|
68
|
-
"
|
69
|
-
"
|
47
|
+
" Config for reddit" => "../../config/reddit/credentials.txt",
|
48
|
+
" Config for Facebook" => "../../config/facebook/credentials.txt",
|
49
|
+
" Config for Twitter" => "../../config/twitter/credentials.txt",
|
50
|
+
"View generator" => "blog/generate.lt3",
|
51
|
+
" Banner: Description" => "blog/banner.lt3",
|
52
|
+
" Banner: Text portion" => "banner/top.lt3",
|
70
53
|
" HEAD info for view" => "blog/head.lt3",
|
71
54
|
" User-edited detail for view" => "blog/index.lt3",
|
72
|
-
"Generator for
|
73
|
-
"Global CSS" => "etc/blog.css.lt3",
|
74
|
-
"External JS/CSS (Bootstrap, etc.)" => "/etc/externals.lt3",
|
55
|
+
" Generator for recent-posts entry" => "blog/post_entry.lt3",
|
75
56
|
"Generator for a post" => "post/generate.lt3",
|
76
57
|
" HEAD info for post" => "post/head.lt3",
|
77
58
|
" Content for post" => "post/index.lt3",
|
78
|
-
"
|
59
|
+
"Global CSS" => "etc/blog.css.lt3",
|
60
|
+
"External JS/CSS (Bootstrap, etc.)" => "/etc/externals.lt3"
|
79
61
|
}
|
80
62
|
|
81
63
|
dir = @blog.view.dir/"themes/standard/"
|
@@ -83,8 +65,6 @@ module RuneBlog::REPL
|
|
83
65
|
edit_file(dir/target)
|
84
66
|
end
|
85
67
|
|
86
|
-
|
87
|
-
|
88
68
|
def cmd_manage(arg, testing = false)
|
89
69
|
case arg
|
90
70
|
when "pages"; _manage_pages(nil, testing = false)
|
data/lib/runeblog.rb
CHANGED
@@ -296,12 +296,14 @@ class RuneBlog
|
|
296
296
|
when RuneBlog::View
|
297
297
|
@view = arg
|
298
298
|
read_features(@view)
|
299
|
+
@view.get_globals
|
299
300
|
_set_publisher
|
300
301
|
when String
|
301
302
|
new_view = str2view(arg)
|
302
303
|
raise NoSuchView(arg) if new_view.nil?
|
303
304
|
@view = new_view
|
304
305
|
read_features(@view)
|
306
|
+
@view.get_globals
|
305
307
|
_set_publisher
|
306
308
|
else
|
307
309
|
raise CantAssignView(arg.class.to_s)
|
@@ -377,6 +379,7 @@ class RuneBlog
|
|
377
379
|
add_view(view_name)
|
378
380
|
mark_last_published("Initial creation")
|
379
381
|
system("cp #@root/data/global.lt3 #@root/views/#{view_name}/themes/standard/global.lt3")
|
382
|
+
@view.get_globals
|
380
383
|
rescue => err
|
381
384
|
_tmp_error(err)
|
382
385
|
end
|
@@ -457,16 +460,18 @@ class RuneBlog
|
|
457
460
|
return posts[0..19] # return 20 at most
|
458
461
|
end
|
459
462
|
|
460
|
-
def collect_recent_posts(file)
|
463
|
+
def collect_recent_posts(file = "recent.html")
|
461
464
|
log!(enter: __method__, args: [file], level: 3)
|
465
|
+
vars = self.view.globals
|
462
466
|
text = <<-HTML
|
463
467
|
<html>
|
464
468
|
<head><link rel="stylesheet" href="etc/blog.css"></head>
|
465
|
-
<body>
|
469
|
+
<body style="background-color: #{vars["recent.bgcolor"]}">
|
466
470
|
HTML
|
467
471
|
posts = _sorted_posts
|
468
472
|
if posts.size > 0
|
469
|
-
|
473
|
+
# estimate how many we want
|
474
|
+
wanted = [vars["recent.count"].to_i, posts.size].min
|
470
475
|
enum = posts.each
|
471
476
|
entries = []
|
472
477
|
wanted.times do
|
@@ -538,7 +543,7 @@ class RuneBlog
|
|
538
543
|
log!(enter: __method__, args: [view], pwd: true, dir: true)
|
539
544
|
raise ArgumentError unless view.is_a?(String) || view.is_a?(RuneBlog::View)
|
540
545
|
@vdir = @root/:views/view
|
541
|
-
num = collect_recent_posts
|
546
|
+
num = collect_recent_posts
|
542
547
|
return num
|
543
548
|
rescue => err
|
544
549
|
_tmp_error(err)
|
data/lib/runeblog_version.rb
CHANGED
data/lib/view.rb
CHANGED
@@ -14,6 +14,10 @@ class RuneBlog::View
|
|
14
14
|
@publisher = RuneBlog::Publishing.new(name)
|
15
15
|
@can_publish = true # FIXME
|
16
16
|
@blog.view = self
|
17
|
+
get_globals
|
18
|
+
end
|
19
|
+
|
20
|
+
def get_globals
|
17
21
|
gfile = @blog.root/"views/#{name}/themes/standard/global.lt3"
|
18
22
|
return unless File.exist?(gfile) # Hackish!! how is View.new called from create_view??
|
19
23
|
|
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.3.
|
4
|
+
version: 0.3.04
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|