runeblog 0.3.02 → 0.3.03
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/features.txt +1 -1
- data/empty_view/settings/features.txt +1 -1
- data/lib/helpers-blog.rb +16 -14
- data/lib/liveblog.rb +2 -2
- data/lib/runeblog.rb +3 -0
- data/lib/runeblog_version.rb +1 -1
- data/test/austin.rb +6 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 981c7fd06d3616dd52825124cc99baf2822e45733c02d7d979750d95bb296a1a
|
4
|
+
data.tar.gz: 7662e51fbe7a7ac7986ef6c4f745a4d745774a1a36085a2ac666d1d96cc06a5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a72de8c66f10ede4bec71970d46d3f1d48cb41546d8f600338cb8738d22419acc992ab9d88d3e5c8a6531d7f6b3a0b1e82bc80a12078032addaa6d2b5edb49cc
|
7
|
+
data.tar.gz: 556c8604bea8f8fbd42d78b8cfffcb8a8af183958698543d25969cd4d9511f986814b55488d98fe87ac81a5bea05dc51a058f7a0ce24f7a39271aa6e38697a30
|
data/data/features.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# 1 = enabled (implies installed)
|
3
3
|
# x = excluded (not installed; does it even exist?)
|
4
4
|
|
5
|
-
reddit
|
5
|
+
reddit 0 # autopost, embed thread after blog post
|
6
6
|
facebook 0 # reader-like, reader post, autopost?
|
7
7
|
twitter 0 # reader-tweet, reader-follow, autotweet?
|
8
8
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# 1 = enabled (implies installed)
|
3
3
|
# x = excluded (not installed; does it even exist?)
|
4
4
|
|
5
|
-
reddit
|
5
|
+
reddit 0 # autopost, embed thread after blog post
|
6
6
|
facebook 0 # reader-like, reader post, autopost?
|
7
7
|
twitter 0 # reader-tweet, reader-follow, autotweet?
|
8
8
|
|
data/lib/helpers-blog.rb
CHANGED
@@ -14,14 +14,22 @@ module RuneBlog::Helpers
|
|
14
14
|
exit
|
15
15
|
end
|
16
16
|
|
17
|
-
def read_features
|
17
|
+
def read_features(view = nil)
|
18
18
|
hash = {}
|
19
|
-
|
19
|
+
if view.nil? # toplevel default
|
20
|
+
dir = @root/"data"
|
21
|
+
else
|
22
|
+
dir = @root/:views/self.view/:settings
|
23
|
+
end
|
24
|
+
file = dir/"features.txt"
|
20
25
|
lines = File.readlines(file)
|
21
26
|
lines.each do |line|
|
22
|
-
|
23
|
-
|
24
|
-
|
27
|
+
line = line.strip
|
28
|
+
line.sub!(/ #.*/, "") # trailing
|
29
|
+
next if line =~ /^ *#/ # leading
|
30
|
+
next if line.empty?
|
31
|
+
name, status = line.split
|
32
|
+
hash[name] = (status == "1") # enabled
|
25
33
|
end
|
26
34
|
@features = hash
|
27
35
|
end
|
@@ -39,15 +47,9 @@ module RuneBlog::Helpers
|
|
39
47
|
|
40
48
|
def copy_data(tag, dest)
|
41
49
|
data = RuneBlog::Path + "/../data" # files kept inside gem
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
when :config
|
46
|
-
files = %w[ROOT VIEW EDITOR universal.lt3 global.lt3]
|
47
|
-
files.each {|file| copy(data + "/" + file, dest) }
|
48
|
-
when :extra # FIXME remove later
|
49
|
-
# copy!(extra, dest)
|
50
|
-
end
|
50
|
+
# FIXME tag no longer used
|
51
|
+
files = %w[ROOT VIEW EDITOR universal.lt3 global.lt3 features.txt]
|
52
|
+
files.each {|file| copy(data + "/" + file, dest) unless File.exist?(dest/file) }
|
51
53
|
end
|
52
54
|
|
53
55
|
def read_vars(file)
|
data/lib/liveblog.rb
CHANGED
@@ -72,7 +72,7 @@ def post_trailer
|
|
72
72
|
tags = _var("post.tags")
|
73
73
|
taglist = tags.empty? ? "" : "Tags: #{tags}"
|
74
74
|
|
75
|
-
reddit_enabled = @blog.features["reddit"]
|
75
|
+
reddit_enabled = @blog.features["reddit"]
|
76
76
|
reddit_txt = ""
|
77
77
|
if reddit_enabled
|
78
78
|
vdir = @blog.root/:views/@blog.view
|
@@ -110,7 +110,7 @@ def faq
|
|
110
110
|
_out %[ <a data-toggle="collapse" href="##{id}" role="button" aria-expanded="false" aria-controls="collapseExample"><font size=+3>⌄</font></a>]
|
111
111
|
_out %[ <b>#{ques}</b>]
|
112
112
|
_out %[<div class="collapse" id="#{id}"><br><font size=+1> #{ans}</font></div>\n]
|
113
|
-
_out "<br>" unless @faq_count == 1
|
113
|
+
_out "<br>" # unless @faq_count == 1
|
114
114
|
_optional_blank_line
|
115
115
|
end
|
116
116
|
|
data/lib/runeblog.rb
CHANGED
@@ -122,6 +122,7 @@ class RuneBlog
|
|
122
122
|
@root = Dir.pwd/root_rel
|
123
123
|
write_repo_config(root: @root) # ?? FIXME
|
124
124
|
get_repo_config
|
125
|
+
read_features # top level
|
125
126
|
@views = retrieve_views
|
126
127
|
self.view = File.read(@root/"data/VIEW").chomp
|
127
128
|
md = Dir.pwd.match(%r[.*/views/(.*?)/])
|
@@ -294,11 +295,13 @@ class RuneBlog
|
|
294
295
|
@view = nil
|
295
296
|
when RuneBlog::View
|
296
297
|
@view = arg
|
298
|
+
read_features(@view)
|
297
299
|
_set_publisher
|
298
300
|
when String
|
299
301
|
new_view = str2view(arg)
|
300
302
|
raise NoSuchView(arg) if new_view.nil?
|
301
303
|
@view = new_view
|
304
|
+
read_features(@view)
|
302
305
|
_set_publisher
|
303
306
|
else
|
304
307
|
raise CantAssignView(arg.class.to_s)
|
data/lib/runeblog_version.rb
CHANGED
data/test/austin.rb
CHANGED
@@ -31,7 +31,7 @@ end
|
|
31
31
|
@fake_date = Date.today - 20
|
32
32
|
|
33
33
|
def make_post(x, title, teaser, body, views=[])
|
34
|
-
debug "
|
34
|
+
debug " make_post #{bold(title)}"
|
35
35
|
pubdate = @fake_date.strftime("%Y-%m-%d")
|
36
36
|
@fake_date += (rand(2) + 1)
|
37
37
|
x.create_new_post(title, true, teaser: teaser, body: body, views: views,
|
@@ -53,8 +53,8 @@ puts
|
|
53
53
|
debug bold("Generating test blog...")
|
54
54
|
|
55
55
|
system("rm -rf .blogs")
|
56
|
-
RuneBlog.create_new_blog_repo(".blogs")
|
57
|
-
x = RuneBlog.new(".blogs")
|
56
|
+
RuneBlog.create_new_blog_repo # (".blogs")
|
57
|
+
x = RuneBlog.new # (".blogs")
|
58
58
|
|
59
59
|
debug("create_view: #{bold('around_austin')}")
|
60
60
|
x.create_view("around_austin") # FIXME remember view title!
|
@@ -72,7 +72,7 @@ File.open(vfile, "w") {|f| f.puts vars }
|
|
72
72
|
|
73
73
|
####
|
74
74
|
|
75
|
-
debug("
|
75
|
+
debug("change_view: #{bold('around_austin')}")
|
76
76
|
x.change_view("around_austin") # 1 2 7 8 9
|
77
77
|
|
78
78
|
make_post(x, "What's at Stubbs...", <<-EXCERPT, <<-BODY)
|
@@ -142,11 +142,10 @@ But I first heard of them
|
|
142
142
|
in 2005.
|
143
143
|
BODY
|
144
144
|
|
145
|
-
debug
|
146
|
-
debug "** generate_index #{bold("around_austin")}"
|
145
|
+
debug "generate_index #{bold("around_austin")}"
|
147
146
|
x.generate_index("around_austin")
|
148
147
|
|
149
|
-
debug("
|
148
|
+
debug("generate_view: #{bold('around_austin')}")
|
150
149
|
x.generate_view("around_austin")
|
151
150
|
|
152
151
|
debug bold("...finished.\n")
|