runeblog 0.1.75 → 0.1.76
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/standard.tgz +0 -0
- data/lib/Javascript.stuff +69 -0
- data/lib/default.rb +1 -91
- data/lib/global.rb +2 -0
- data/lib/helpers-repl.rb +1 -0
- data/lib/post.rb +4 -7
- data/lib/publish.rb +2 -8
- data/lib/repl.rb +3 -1
- data/lib/runeblog.rb +5 -3
- data/lib/runeblog_version.rb +1 -1
- data/lib/view.rb +3 -6
- data/runeblog.gemspec +1 -1
- data/test/make_blog.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9820213ad610c3b8f8372fc6ba3e4b276a171e0fcf45392713c862d968aedafe
|
4
|
+
data.tar.gz: e55b2c905d49352cac5d38b663e02857082277c21dd32644f8cb010c6aa7b054
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c277ed7f2e698c0750b60cb914f4ad161b1e189d322f1bf28275f59df38196bd219cc5ad2d165a7f2f50242107385a27aa17bfd8cf7b9db4018a64b6b0022c4
|
7
|
+
data.tar.gz: e888d0b904dbd275a4fd5befe62fb7af5723aed24c7b4a3883e5e6515939883a4f2e8f51640353be60615a618cdc3fdf3421a8bef1d938840a7e32ac49f59ea1
|
data/data/standard.tgz
CHANGED
Binary file
|
@@ -0,0 +1,69 @@
|
|
1
|
+
def RuneBlog.teaser_template(title: "No title", date:, view: "test_view",
|
2
|
+
teaser: "No teaser", body: "No body", slug:)
|
3
|
+
<<-TEXT
|
4
|
+
<html>
|
5
|
+
|
6
|
+
<body>
|
7
|
+
|
8
|
+
<script>
|
9
|
+
window.fbAsyncInit = function() {
|
10
|
+
FB.init({
|
11
|
+
appId : '1176481582378716',
|
12
|
+
xfbml : true,
|
13
|
+
version : 'v2.4'
|
14
|
+
});
|
15
|
+
};
|
16
|
+
|
17
|
+
(function(d, s, id){
|
18
|
+
var js, fjs = d.getElementsByTagName(s)[0];
|
19
|
+
if (d.getElementById(id)) {return;}
|
20
|
+
js = d.createElement(s); js.id = id;
|
21
|
+
js.src = '//connect.facebook.net/en_US/sdk.js';
|
22
|
+
fjs.parentNode.insertBefore(js, fjs);
|
23
|
+
}(document, 'script', 'facebook-jssdk'));
|
24
|
+
</script>
|
25
|
+
<!-- meta property='fb:admins' content='767352779' /> -->
|
26
|
+
<meta property='og:url' content='http://rubyhacker.com/blog2/#{slug}.html'/>
|
27
|
+
<meta property='og:type' content='article'/>
|
28
|
+
<meta property='og:title' content='#{title}'/>
|
29
|
+
<meta property='og:image' content='http://rubyhacker.com/blog2/blog3b.gif'/>
|
30
|
+
<meta property='og:description' content='#{teaser}'/>
|
31
|
+
|
32
|
+
<table bgcolor=#eeeeee cellspacing=5>
|
33
|
+
<tr>
|
34
|
+
<td valign=top>
|
35
|
+
<br> <font size=+2 color=red>#{title}</font> <br> #{date}
|
36
|
+
</td>
|
37
|
+
<td width=2% bgcolor=red></td>
|
38
|
+
<td valign=top>
|
39
|
+
<a href='https://twitter.com/share'
|
40
|
+
class='twitter-share-button'
|
41
|
+
data-text='#{title}'
|
42
|
+
data-url='#{'url'}'
|
43
|
+
data-via='hal_fulton'
|
44
|
+
data-related='hal_fulton'>Tweet</a>
|
45
|
+
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
46
|
+
<br>
|
47
|
+
<a href='https://twitter.com/hal_fulton' class='twitter-follow-button' data-show-count='false'>Follow @hal_fulton</a>
|
48
|
+
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
49
|
+
|
50
|
+
<br>
|
51
|
+
<div
|
52
|
+
class='fb-like'
|
53
|
+
data-share='true'
|
54
|
+
data-width='450'
|
55
|
+
data-show-faces='true'>
|
56
|
+
</div>
|
57
|
+
</td>
|
58
|
+
</tr>
|
59
|
+
</table>
|
60
|
+
<hr>
|
61
|
+
|
62
|
+
#{body}
|
63
|
+
|
64
|
+
<hr>
|
65
|
+
<a href="http://rubyhacker.com/blog2" style="text-decoration: none">Back</a>
|
66
|
+
<a href="http://rubyhacker.com" style="text-decoration: none">Home</a>
|
67
|
+
TEXT
|
68
|
+
end
|
69
|
+
|
data/lib/default.rb
CHANGED
@@ -2,30 +2,6 @@ class RuneBlog::Default
|
|
2
2
|
|
3
3
|
# This will all become much more generic later.
|
4
4
|
|
5
|
-
BlogTemplate = <<-TEXT
|
6
|
-
.mixin liveblog
|
7
|
-
|
8
|
-
.title Fake Blog, Fake Title, Fake Author
|
9
|
-
|
10
|
-
<table>
|
11
|
-
<tr>
|
12
|
-
<td>
|
13
|
-
.image fakeimage.jpg
|
14
|
-
</td>
|
15
|
-
<td valign=top>
|
16
|
-
.h3 Yet another blog...
|
17
|
-
.h4 by Kilgore Trout
|
18
|
-
.br 2
|
19
|
-
If you're the kind of person who likes this sort of thing,
|
20
|
-
then this is the sort of thing a person like you will like.
|
21
|
-
.br 2
|
22
|
-
Don't you feel more like you do now than before you read this?
|
23
|
-
</td>
|
24
|
-
</tr>
|
25
|
-
</table>
|
26
|
-
.hr
|
27
|
-
TEASERS
|
28
|
-
TEXT
|
29
5
|
|
30
6
|
def RuneBlog.post_template(title: "No title", date: nil, view: "test_view",
|
31
7
|
teaser: "No teaser", body: "No body", tags: ["untagged"],
|
@@ -53,73 +29,7 @@ TEXT
|
|
53
29
|
|
54
30
|
end
|
55
31
|
|
56
|
-
|
57
|
-
teaser: "No teaser", body: "No body", slug:)
|
58
|
-
<<-TEXT
|
59
|
-
<html>
|
60
|
-
|
61
|
-
<body>
|
62
|
-
|
63
|
-
<script>
|
64
|
-
window.fbAsyncInit = function() {
|
65
|
-
FB.init({
|
66
|
-
appId : '1176481582378716',
|
67
|
-
xfbml : true,
|
68
|
-
version : 'v2.4'
|
69
|
-
});
|
70
|
-
};
|
71
|
-
|
72
|
-
(function(d, s, id){
|
73
|
-
var js, fjs = d.getElementsByTagName(s)[0];
|
74
|
-
if (d.getElementById(id)) {return;}
|
75
|
-
js = d.createElement(s); js.id = id;
|
76
|
-
js.src = '//connect.facebook.net/en_US/sdk.js';
|
77
|
-
fjs.parentNode.insertBefore(js, fjs);
|
78
|
-
}(document, 'script', 'facebook-jssdk'));
|
79
|
-
</script>
|
80
|
-
<!-- meta property='fb:admins' content='767352779' /> -->
|
81
|
-
<meta property='og:url' content='http://rubyhacker.com/blog2/#{slug}.html'/>
|
82
|
-
<meta property='og:type' content='article'/>
|
83
|
-
<meta property='og:title' content='#{title}'/>
|
84
|
-
<meta property='og:image' content='http://rubyhacker.com/blog2/blog3b.gif'/>
|
85
|
-
<meta property='og:description' content='#{teaser}'/>
|
86
|
-
|
87
|
-
<table bgcolor=#eeeeee cellspacing=5>
|
88
|
-
<tr>
|
89
|
-
<td valign=top>
|
90
|
-
<br> <font size=+2 color=red>#{title}</font> <br> #{date}
|
91
|
-
</td>
|
92
|
-
<td width=2% bgcolor=red></td>
|
93
|
-
<td valign=top>
|
94
|
-
<a href='https://twitter.com/share'
|
95
|
-
class='twitter-share-button'
|
96
|
-
data-text='#{title}'
|
97
|
-
data-url='#{'url'}'
|
98
|
-
data-via='hal_fulton'
|
99
|
-
data-related='hal_fulton'>Tweet</a>
|
100
|
-
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
101
|
-
<br>
|
102
|
-
<a href='https://twitter.com/hal_fulton' class='twitter-follow-button' data-show-count='false'>Follow @hal_fulton</a>
|
103
|
-
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
104
|
-
|
105
|
-
<br>
|
106
|
-
<div
|
107
|
-
class='fb-like'
|
108
|
-
data-share='true'
|
109
|
-
data-width='450'
|
110
|
-
data-show-faces='true'>
|
111
|
-
</div>
|
112
|
-
</td>
|
113
|
-
</tr>
|
114
|
-
</table>
|
115
|
-
<hr>
|
32
|
+
end
|
116
33
|
|
117
|
-
#{body}
|
118
34
|
|
119
|
-
<hr>
|
120
|
-
<a href="http://rubyhacker.com/blog2" style="text-decoration: none">Back</a>
|
121
|
-
<a href="http://rubyhacker.com" style="text-decoration: none">Home</a>
|
122
|
-
TEXT
|
123
|
-
end
|
124
35
|
|
125
|
-
end
|
data/lib/global.rb
CHANGED
data/lib/helpers-repl.rb
CHANGED
data/lib/post.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'helpers-blog'
|
2
|
-
require 'runeblog'
|
3
|
-
|
4
|
-
make_exception(:NoBlogAccessor, "Runeblog.blog is not set")
|
2
|
+
# require 'runeblog'
|
3
|
+
require 'global'
|
5
4
|
|
6
5
|
class RuneBlog::Post
|
7
6
|
|
@@ -71,7 +70,6 @@ class RuneBlog::Post
|
|
71
70
|
end
|
72
71
|
|
73
72
|
def self.create(title, teaser = "", body = "")
|
74
|
-
# STDERR.puts "-- create: teaser = #{teaser.inspect} body = #{body.inspect}"
|
75
73
|
debug "=== Post.create #{title.inspect} pwd = #{Dir.pwd}"
|
76
74
|
post = self.new
|
77
75
|
post.new_metadata(title.chomp, teaser.chomp, body.chomp)
|
@@ -83,13 +81,11 @@ class RuneBlog::Post
|
|
83
81
|
end
|
84
82
|
|
85
83
|
def new_metadata(title, teaser = nil, body = nil)
|
86
|
-
# STDERR.puts "-- new_meta: teaser = #{teaser.inspect} body = #{body.inspect}"
|
87
84
|
verify(title.is_a?(String) => "Title #{title.inspect} is not a string")
|
88
85
|
meta = OpenStruct.new
|
89
86
|
meta.title = title
|
90
87
|
meta.teaser ||= teaser
|
91
88
|
meta.body ||= body
|
92
|
-
# STDERR.puts "-- new_meta2: teaser = #{meta.teaser.inspect} body = #{meta.body.inspect}"
|
93
89
|
meta.pubdate = Time.now.strftime("%Y-%m-%d")
|
94
90
|
meta.date = meta.pubdate # fix later
|
95
91
|
meta.views = [@blog.view.to_s]
|
@@ -101,6 +97,7 @@ class RuneBlog::Post
|
|
101
97
|
end
|
102
98
|
|
103
99
|
def create_draft
|
100
|
+
# FIXME obsolete
|
104
101
|
# STDERR.puts "-- create_draft: teaser = #{@meta.teaser.inspect} body = #{@meta.body.inspect}"
|
105
102
|
viewhome = @blog.view.publisher.url
|
106
103
|
html = RuneBlog.post_template(title: @meta.title, date: @meta.pubdate,
|
@@ -127,7 +124,7 @@ class RuneBlog::Post
|
|
127
124
|
debug "=== build"
|
128
125
|
views = @meta.views
|
129
126
|
text = File.read(@draft)
|
130
|
-
STDERR.puts "-- build: draft = #{@draft.inspect}"
|
127
|
+
# STDERR.puts "-- build: draft = #{@draft.inspect}"
|
131
128
|
livetext = Livetext.new(STDOUT)
|
132
129
|
Livetext.parameters = [@blog, @meta.num, livetext]
|
133
130
|
meta = livetext.process_text(text)
|
data/lib/publish.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'helpers-blog'
|
2
|
-
require 'runeblog'
|
2
|
+
# require 'runeblog'
|
3
|
+
require 'global'
|
3
4
|
|
4
5
|
class RuneBlog::Publishing
|
5
6
|
attr_reader :user, :server, :docroot, :path
|
@@ -32,17 +33,10 @@ class RuneBlog::Publishing
|
|
32
33
|
|
33
34
|
def system!(str)
|
34
35
|
rc = system(str)
|
35
|
-
debug "Running: #{str}"
|
36
|
-
debug "Failed!\n " if ! rc
|
37
36
|
rc
|
38
37
|
end
|
39
38
|
|
40
|
-
# Could not copy
|
41
|
-
# /Users/Hal/Dropbox/files/runeblog/.blogs/data/views/alpha_view/index.html to
|
42
|
-
# root@rubyhacker.com:/var/www/testblog/alpha_view
|
43
|
-
|
44
39
|
def publish(files, assets=[])
|
45
|
-
STDERR.puts "-- publish: files = #{files.inspect} assets = #{assets.inspect}"
|
46
40
|
dir = "#@docroot/#@path"
|
47
41
|
view_name = @blog.view.name
|
48
42
|
viewpath = "#{dir}/#{view_name}"
|
data/lib/repl.rb
CHANGED
data/lib/runeblog.rb
CHANGED
@@ -26,6 +26,8 @@ class RuneBlog
|
|
26
26
|
make_exception(:EditorProblem, "Could not edit $1")
|
27
27
|
make_exception(:NoSuchView, "No such view: $1")
|
28
28
|
make_exception(:LivetextError, "Livetext#process_file returned nil for $1")
|
29
|
+
make_exception(:NoBlogAccessor, "Runeblog.blog is not set")
|
30
|
+
|
29
31
|
|
30
32
|
class << self
|
31
33
|
attr_accessor :blog
|
@@ -169,7 +171,7 @@ class RuneBlog
|
|
169
171
|
create_dir("generated")
|
170
172
|
create_dir('assets')
|
171
173
|
|
172
|
-
Dir.chdir("themes") { system("tar zxvf #{GemData}/standard.tgz
|
174
|
+
Dir.chdir("themes") { system("tar zxvf #{GemData}/standard.tgz >/dev/null 2>&1") }
|
173
175
|
system("cp themes/standard/blog/assets/* assets/")
|
174
176
|
|
175
177
|
pub = "user: xxx\nserver: xxx\ndocroot: xxx\npath: xxx\nproto: xxx\n"
|
@@ -182,7 +184,7 @@ class RuneBlog
|
|
182
184
|
vdir = self.view.dir
|
183
185
|
dir0 = "#{vdir}/themes/standard/blog"
|
184
186
|
dir1 = "#{vdir}/generated"
|
185
|
-
system("livetext #{dir0}/generate.lt3 >#{dir1}/index.html 2>#{dir1}/
|
187
|
+
system("livetext #{dir0}/generate.lt3 >#{dir1}/index.html 2>#{dir1}/errors.txt")
|
186
188
|
dump("Initial creation", "last_published")
|
187
189
|
Dir.chdir(up)
|
188
190
|
@views << view
|
@@ -279,7 +281,7 @@ class RuneBlog
|
|
279
281
|
vdir = self.view.dir
|
280
282
|
dir0 = "#{vdir}/themes/standard/blog"
|
281
283
|
dir1 = "#{vdir}/generated"
|
282
|
-
system("livetext #{dir0}/generate.lt3 >#{dir1}/index.html 2>#{dir1}/
|
284
|
+
system("livetext #{dir0}/generate.lt3 >#{dir1}/index.html 2>#{dir1}/errors.txt")
|
283
285
|
rescue => err
|
284
286
|
error(err)
|
285
287
|
exit
|
data/lib/runeblog_version.rb
CHANGED
data/lib/view.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'helpers-blog'
|
2
|
-
require 'runeblog'
|
2
|
+
# require 'runeblog'
|
3
|
+
require 'global'
|
3
4
|
|
4
5
|
class RuneBlog::View
|
5
6
|
attr_reader :name, :state
|
@@ -39,17 +40,13 @@ class RuneBlog::View
|
|
39
40
|
vdir = dir()
|
40
41
|
files = [local_index()]
|
41
42
|
others = Dir.entries(vdir + "/generated").grep(/^\d\d\d\d/).map {|x| "#{vdir}/generated/#{x}" }
|
42
|
-
STDERR.puts "-- publishable: others = #{others.inspect}"
|
43
43
|
deep_assets = Dir["#{vdir}/themes/standard/assets/*"]
|
44
|
-
# Do this at view creation
|
45
|
-
deep_assets.each do |file|
|
44
|
+
deep_assets.each do |file| # Do this at view creation
|
46
45
|
cmd = "cp #{file} #{vdir}/assets"
|
47
|
-
STDERR.puts "-- cmd = #{cmd}"
|
48
46
|
system(cmd)
|
49
47
|
end
|
50
48
|
assets = Dir.entries("#{vdir}/assets") - %w[. ..]
|
51
49
|
assets.map! {|x| "#{vdir}/assets/#{x}" }
|
52
|
-
STDERR.puts "-- publishable: assets = #{assets.inspect}"
|
53
50
|
assets.reject! {|x| File.directory?(x) }
|
54
51
|
# assets.reject! {|x| ! recent?(x) }
|
55
52
|
files = files + others
|
data/runeblog.gemspec
CHANGED
data/test/make_blog.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.1.
|
4
|
+
version: 0.1.76
|
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-
|
11
|
+
date: 2019-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- "./runeblog.gemspec"
|
63
63
|
- bin/blog
|
64
64
|
- data/standard.tgz
|
65
|
+
- lib/Javascript.stuff
|
65
66
|
- lib/default.rb
|
66
67
|
- lib/global.rb
|
67
68
|
- lib/helpers-blog.rb
|