runeblog 0.2.43 → 0.2.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blog +8 -10
- data/empty_view/assets/austin-pano.jpg +0 -0
- data/empty_view/themes/standard/blog/generate.lt3 +5 -3
- data/empty_view/themes/standard/blog/post_entry.lt3 +14 -10
- data/empty_view/themes/standard/etc/blog.css.lt3 +18 -0
- data/empty_view/themes/standard/navbar/faq.lt3 +1 -0
- data/empty_view/themes/standard/navbar/navbar.lt3 +1 -0
- data/empty_view/themes/standard/widgets/ad/ad.lt3 +8 -1
- data/empty_view/themes/standard/widgets/ad/ad1.png +0 -0
- data/empty_view/themes/standard/widgets/ad/ad2.png +0 -0
- data/empty_view/themes/standard/widgets/ad/ad3.png +0 -0
- data/empty_view/themes/standard/widgets/ad/ad4.png +0 -0
- data/empty_view/themes/standard/widgets/bydates/bydates.rb +7 -3
- data/empty_view/themes/standard/widgets/links/links.rb +28 -3
- data/empty_view/themes/standard/widgets/news/news.rb +7 -3
- data/empty_view/themes/standard/widgets/pages/pages.rb +10 -3
- data/empty_view/themes/standard/widgets/pinned/pinned.rb +7 -3
- data/empty_view/themes/standard/widgets/search/search.rb +7 -3
- data/empty_view/themes/standard/widgets/sitemap/sitemap.rb +7 -3
- data/empty_view/themes/standard/widgets/tag-cloud/tag-cloud.rb +7 -3
- data/lib/default.rb +1 -1
- data/lib/global.rb +15 -40
- data/lib/helpers-blog.rb +15 -44
- data/lib/liveblog.rb +86 -62
- data/lib/logging.rb +17 -8
- data/lib/post.rb +24 -20
- data/lib/publish.rb +4 -5
- data/lib/repl.rb +52 -11
- data/lib/runeblog.rb +115 -93
- data/lib/runeblog_version.rb +1 -1
- data/lib/view.rb +2 -9
- data/lib/xlate.rb +34 -33
- data/test/austin.rb +31 -20
- metadata +8 -5
- data/empty_view/remote/widgets/links/list.data +0 -3
- data/empty_view/remote/widgets/news/list.data +0 -4
- data/empty_view/remote/widgets/pages/list.data +0 -4
data/lib/runeblog_version.rb
CHANGED
data/lib/view.rb
CHANGED
@@ -8,7 +8,7 @@ class RuneBlog::View
|
|
8
8
|
include RuneBlog::Helpers
|
9
9
|
|
10
10
|
def initialize(name)
|
11
|
-
log!(enter: __method__, args: [name])
|
11
|
+
log!(enter: __method__, args: [name], level: 3)
|
12
12
|
raise NoBlogAccessor if RuneBlog.blog.nil?
|
13
13
|
@blog = RuneBlog.blog
|
14
14
|
@name = name
|
@@ -17,27 +17,23 @@ class RuneBlog::View
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def dir
|
20
|
-
log!(enter: __method__)
|
21
20
|
@blog.root + "/views/#@name/"
|
22
21
|
end
|
23
22
|
|
24
23
|
def local_index
|
25
|
-
log!(enter: __method__)
|
26
24
|
dir + "/remote/index.html"
|
27
25
|
end
|
28
26
|
|
29
27
|
def index
|
30
|
-
log!(enter: __method__)
|
31
28
|
dir + "index.html"
|
32
29
|
end
|
33
30
|
|
34
31
|
def to_s
|
35
|
-
log!(enter: __method__)
|
36
32
|
@name
|
37
33
|
end
|
38
34
|
|
39
35
|
def publishable_files
|
40
|
-
log!(enter: __method__)
|
36
|
+
log!(enter: __method__, level: 2)
|
41
37
|
vdir = dir()
|
42
38
|
remote = local_index()
|
43
39
|
files = [remote]
|
@@ -55,16 +51,13 @@ class RuneBlog::View
|
|
55
51
|
end
|
56
52
|
|
57
53
|
def can_publish?
|
58
|
-
log!(enter: __method__)
|
59
54
|
@can_publish
|
60
55
|
end
|
61
56
|
|
62
57
|
def recent?(file)
|
63
|
-
log!(enter: __method__, args: [file])
|
64
58
|
File.mtime(file) > File.mtime("#{self.dir()}/last_published")
|
65
59
|
rescue
|
66
60
|
true
|
67
61
|
end
|
68
|
-
|
69
62
|
end
|
70
63
|
|
data/lib/xlate.rb
CHANGED
@@ -1,42 +1,43 @@
|
|
1
1
|
|
2
2
|
LEXT = ".lt3"
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
def stale?(src, dst, force = false)
|
5
|
+
meh = File.new("/tmp/dammit-#{src.gsub(/\//, "-")}", "w")
|
6
|
+
log!(enter: __method__, args: [src, dst], level: 3)
|
7
|
+
raise "Source #{src} not found in #{Dir.pwd}" unless File.exist?(src)
|
8
|
+
return true if force
|
9
|
+
return true unless File.exist?(dst)
|
10
|
+
return true if File.mtime(src) > File.mtime(dst)
|
11
|
+
return false
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
STDERR.puts "#{indent} -- ^ Already up to date!" if debug
|
30
|
-
return
|
31
|
-
end
|
32
|
-
rc = system!("livetext #{src} >#{dst}")
|
14
|
+
def xlate(cwd: Dir.pwd, src:,
|
15
|
+
dst: (strip = true; src.sub(/.lt3$/,"")),
|
16
|
+
copy: nil, debug: false, force: false)
|
17
|
+
src += LEXT unless src.end_with?(LEXT)
|
18
|
+
dst += ".html" unless dst.end_with?(".html") || strip
|
19
|
+
indent = " "*12
|
20
|
+
Dir.chdir(cwd) do
|
21
|
+
if debug
|
22
|
+
STDERR.puts "#{indent} -- xlate #{src} >#{dst}"
|
23
|
+
STDERR.puts "#{indent} in: #{Dir.pwd}"
|
24
|
+
STDERR.puts "#{indent} from: #{caller[0]}"
|
25
|
+
STDERR.puts "#{indent} copy: #{copy}" if copy
|
26
|
+
end
|
27
|
+
stale = stale?(src, dst, force)
|
28
|
+
if stale
|
29
|
+
rc = system("livetext #{src} >#{dst}")
|
33
30
|
STDERR.puts "...completed (shell returned #{rc})" if debug
|
34
31
|
system!("cp #{dst} #{copy}") if copy
|
32
|
+
else
|
33
|
+
STDERR.puts "#{indent} -- ^ Already up to date!" if debug
|
34
|
+
return
|
35
35
|
end
|
36
36
|
end
|
37
|
+
end
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
def xlate!(cwd: Dir.pwd, src:, copy: nil, debug: false, force: false)
|
40
|
+
output = "/tmp/xlate-#{File.basename(src).sub(/.lt3$/, "")}"
|
41
|
+
xlate cwd: cwd, src: src, dst: output, debug: debug, force: force
|
42
|
+
File.read(output + ".html") # return all content as string
|
43
|
+
end
|
data/test/austin.rb
CHANGED
@@ -4,7 +4,9 @@ major, minor = RUBY_VERSION.split(".").values_at(0,1)
|
|
4
4
|
ver = major.to_i*10 + minor.to_i
|
5
5
|
abort "Need Ruby 2.4 or greater" unless ver >= 24
|
6
6
|
|
7
|
-
Home = Dir.pwd
|
7
|
+
# Home = Dir.pwd
|
8
|
+
|
9
|
+
require 'date'
|
8
10
|
|
9
11
|
require 'global'
|
10
12
|
require 'runeblog'
|
@@ -27,14 +29,14 @@ def debug(str = "")
|
|
27
29
|
STDERR.puts "#{'%-11s' % time} #{str}"
|
28
30
|
end
|
29
31
|
|
32
|
+
@fake_date = Date.today - 20
|
33
|
+
|
30
34
|
def make_post(x, title, teaser, body, views=[])
|
31
35
|
debug " make_post #{bold(title)}"
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
x.generate_index(view)
|
37
|
-
end # recent.html
|
36
|
+
pubdate = @fake_date.strftime("%Y-%m-%d")
|
37
|
+
@fake_date += (rand(2) + 1)
|
38
|
+
x.create_new_post(title, true, teaser: teaser, body: body, views: views,
|
39
|
+
pubdate: pubdate)
|
38
40
|
end
|
39
41
|
|
40
42
|
def show_lines(text)
|
@@ -70,6 +72,9 @@ File.open(".blogs/views/around_austin/themes/standard/global.lt3", "a") do |f|
|
|
70
72
|
end
|
71
73
|
####
|
72
74
|
|
75
|
+
debug("** generate_view: #{bold('around_austin')}")
|
76
|
+
x.generate_view("around_austin")
|
77
|
+
|
73
78
|
debug("-- change_view: #{bold('around_austin')}")
|
74
79
|
x.change_view("around_austin") # 1 2 7 8 9
|
75
80
|
|
@@ -88,29 +93,33 @@ BODY
|
|
88
93
|
make_post(x, "The graffiti wall", <<-EXCERPT, <<-BODY)
|
89
94
|
RIP, Hope Gallery
|
90
95
|
EXCERPT
|
91
|
-
.dropcap
|
92
96
|
|
93
|
-
It's been a while since I was there. They say it was torn down
|
94
|
-
while I wasn't looking.
|
97
|
+
.dropcap It's been a while since I was there. They say it was torn down
|
98
|
+
while I wasn't looking. Never tagged anything there, of course, nor
|
99
|
+
anywhere else. Spraypainting public places isn't my thing, but in this
|
100
|
+
case I condoned it because it was sort of there for that purpose.
|
95
101
|
|
96
102
|
This fake entry is a long one so as to demonstrate both drop-caps
|
97
103
|
(above) and an inset quote. Blah blah blah. Lorem ipsum dolor and
|
98
104
|
a partridge in a pear tree.
|
99
105
|
|
106
|
+
.inset left 20
|
100
107
|
Wherever you go, there you are. Last night I saw upon the stair
|
101
108
|
a little man who was not there. He wasn't there again today; I
|
102
|
-
wish, I wish he'd go away.
|
103
|
-
|
104
|
-
|
105
|
-
And never let it be denied that
|
106
|
-
toes. And may your snark never
|
109
|
+
wish, I wish he'd go away. As far as we know, our computer has
|
110
|
+
never had an undetected error.
|
111
|
+
|On a clean disk, you can seek forever.
|
112
|
+
And never let it be denied that
|
113
|
+
pobbles are happier without their toes. And may your snark never
|
114
|
+
be a boojum. How do you know you aren't dreaming right now? When
|
115
|
+
you see a butterfly, think of Chuang Tzu.
|
116
|
+
.end
|
107
117
|
|
108
118
|
Contact light. Houston, this is Tranquility Base. The Eagle has
|
109
119
|
landed. That's one small step for (a) man, one giant leap for
|
110
120
|
mankind.
|
111
|
-
|
112
|
-
|
113
|
-
.end
|
121
|
+
|
122
|
+
Here's the PDF of $$link["Ruby for the Old-Time C Programmer"|http://rubyhacker.com/blog2/rubydino.pdf]
|
114
123
|
|
115
124
|
Pity this busy monster, manunkind, not. Pity rather... Listen:
|
116
125
|
There's a hell of a universe next door; let's go.
|
@@ -136,8 +145,10 @@ in 2005.
|
|
136
145
|
BODY
|
137
146
|
|
138
147
|
debug
|
139
|
-
debug
|
140
|
-
x.
|
148
|
+
debug "** generate_index #{bold("around_austin")}"
|
149
|
+
x.generate_index("around_austin")
|
150
|
+
|
151
|
+
debug
|
141
152
|
x.change_view("around_austin")
|
142
153
|
debug
|
143
154
|
|
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.48
|
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-10-
|
11
|
+
date: 2019-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|
@@ -62,14 +62,12 @@ files:
|
|
62
62
|
- "./runeblog.gemspec"
|
63
63
|
- bin/blog
|
64
64
|
- bin/mkwidget
|
65
|
+
- empty_view/assets/austin-pano.jpg
|
65
66
|
- empty_view/assets/sky2.jpg
|
66
67
|
- empty_view/remote/assets/GIT_IS_DUMB
|
67
68
|
- empty_view/remote/etc/GIT_IS_DUMB
|
68
69
|
- empty_view/remote/navbar/GIT_IS_DUMB
|
69
70
|
- empty_view/remote/permalink/GIT_IS_DUMB
|
70
|
-
- empty_view/remote/widgets/links/list.data
|
71
|
-
- empty_view/remote/widgets/news/list.data
|
72
|
-
- empty_view/remote/widgets/pages/list.data
|
73
71
|
- empty_view/themes/standard/README
|
74
72
|
- empty_view/themes/standard/blog/generate.lt3
|
75
73
|
- empty_view/themes/standard/blog/head.lt3
|
@@ -82,6 +80,7 @@ files:
|
|
82
80
|
- empty_view/themes/standard/global.lt3
|
83
81
|
- empty_view/themes/standard/navbar/about.lt3
|
84
82
|
- empty_view/themes/standard/navbar/contact.lt3
|
83
|
+
- empty_view/themes/standard/navbar/faq.lt3
|
85
84
|
- empty_view/themes/standard/navbar/navbar.lt3
|
86
85
|
- empty_view/themes/standard/post/generate.lt3
|
87
86
|
- empty_view/themes/standard/post/head.lt3
|
@@ -89,6 +88,10 @@ files:
|
|
89
88
|
- empty_view/themes/standard/post/permalink.lt3
|
90
89
|
- empty_view/themes/standard/widgets/README
|
91
90
|
- empty_view/themes/standard/widgets/ad/ad.lt3
|
91
|
+
- empty_view/themes/standard/widgets/ad/ad1.png
|
92
|
+
- empty_view/themes/standard/widgets/ad/ad2.png
|
93
|
+
- empty_view/themes/standard/widgets/ad/ad3.png
|
94
|
+
- empty_view/themes/standard/widgets/ad/ad4.png
|
92
95
|
- empty_view/themes/standard/widgets/bydates/README
|
93
96
|
- empty_view/themes/standard/widgets/bydates/bydates.lt3
|
94
97
|
- empty_view/themes/standard/widgets/bydates/bydates.rb
|
@@ -1,4 +0,0 @@
|
|
1
|
-
https://techcrunch.com/2019/09/16/fossa-scores-8-5-million-series-a-to-help-enterprise-manage-open-source-licenses/, yes, FOSSA scores \$8.5 million Series A to help enterprise manage open-source licenses
|
2
|
-
https://techcrunch.com/2019/09/17/spacexs-orbital-starship-prototype-construction-progress-detailed-in-new-photos/, yes, SpaceX’s orbital Starship prototype construction progress detailed in new photos
|
3
|
-
https://developers.googleblog.com/2019/05/Flutter-io19.html, yes, Flutter: a Portable UI Framework for Mobile, Web, Embedded, and Desktop
|
4
|
-
https://jaycarlson.net/microcontrollers/, no, The Amazing \$1 Microcontroller (2017)
|