livetext 0.8.53 → 0.8.54
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/livetext.rb +1 -1
- data/plugin/liveblog.rb +1 -20
- 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: 9209b28685d092f304cc148101bb5e7bfb2bc54efbcec6e7563575c127e2c377
|
4
|
+
data.tar.gz: 5de9376c7d6707274f3d9f59f5e2623ba2057c9e97600b094be12dfee374de96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae360b0f56c258c80d12eba7ab6dfafd254e741cc4b3dbe67bbb5eb03a973ed467381b62038c0c0e1f27d690a6d22f1d072548054ad25a93f3a7ae3f6c99a5fb
|
7
|
+
data.tar.gz: e7136a6ef4ecc064cf6dccf6e0a46b701903d4a0e7482bd2ac2b8bf1d945ff2ed4f468e27dfa783623065117c03af08700f7d19005564a70c8c8eec3d2e9b27e
|
data/lib/livetext.rb
CHANGED
data/plugin/liveblog.rb
CHANGED
@@ -61,7 +61,6 @@ end
|
|
61
61
|
|
62
62
|
def init_liveblog # FIXME - a lot of this logic sucks
|
63
63
|
@blog, @meta = Livetext.parameters
|
64
|
-
# puts "init: #{[@blog, @meta].inspect}"
|
65
64
|
@root = @blog.root
|
66
65
|
@view = @blog.view.name
|
67
66
|
@vdir = @blog.view.dir
|
@@ -69,15 +68,6 @@ def init_liveblog # FIXME - a lot of this logic sucks
|
|
69
68
|
@body = ""
|
70
69
|
@slug = @blog.make_slug(@meta)
|
71
70
|
@postdir = @blog.view.dir + "/#@slug"
|
72
|
-
# puts "postdir = #{@postdir.inspect}"
|
73
|
-
|
74
|
-
# @publish ||= {}
|
75
|
-
# @config.views.each do |view|
|
76
|
-
# publish = @config.viewdir(view) + "publish"
|
77
|
-
# raise "File '#{publish}' not found" unless File.exist?(publish)
|
78
|
-
# lines = File.readlines(publish).map {|x| x.chomp }
|
79
|
-
# @publish[view] = lines
|
80
|
-
# end
|
81
71
|
end
|
82
72
|
|
83
73
|
def _errout(*args)
|
@@ -109,7 +99,7 @@ end
|
|
109
99
|
def image # primitive so far
|
110
100
|
_debug "img: huh? <img src=#{_args.first}></img>"
|
111
101
|
fname = _args.first
|
112
|
-
path = "
|
102
|
+
path = "../assets/#{fname}"
|
113
103
|
@body << "<img src=#{path}></img>"
|
114
104
|
end
|
115
105
|
|
@@ -168,30 +158,21 @@ end
|
|
168
158
|
|
169
159
|
def write_post(meta)
|
170
160
|
save = Dir.pwd
|
171
|
-
# puts "lt write_post: pwd = #{Dir.pwd}"
|
172
161
|
@postdir.gsub!(/\/\//, "/") # FIXME unneeded?
|
173
|
-
# puts "lt write_post: ls -l #@postdir"
|
174
|
-
# system("ls -l #@postdir")
|
175
|
-
# puts "lt write_post: trying chdir #@postdir"
|
176
162
|
Dir.mkdir(@postdir) unless Dir.exist?(@postdir) # FIXME remember assets!
|
177
163
|
Dir.chdir(@postdir)
|
178
|
-
# puts "lt write_post: inside #@postdir"
|
179
164
|
meta.views = meta.views.join(" ")
|
180
165
|
meta.tags = meta.tags.join(" ")
|
181
|
-
# puts "lt write_post: writing body"
|
182
166
|
File.write("body.txt", @body) # Actually HTML...
|
183
|
-
# puts "lt write_post: writing teaser"
|
184
167
|
File.write("teaser.txt", meta.teaser)
|
185
168
|
|
186
169
|
fields = [:num, :title, :date, :pubdate, :views, :tags]
|
187
170
|
|
188
171
|
fname2 = "metadata.txt"
|
189
|
-
# puts "lt write_post: writing metadata"
|
190
172
|
f2 = File.open(fname2, "w") do |f2|
|
191
173
|
fields.each {|fld| f2.puts "#{fld}: #{meta.send(fld)}" }
|
192
174
|
end
|
193
175
|
Dir.chdir(save)
|
194
|
-
# puts "lt write_post: returning (now pwd = #{Dir.pwd})"
|
195
176
|
rescue => err
|
196
177
|
puts "err = #{err}"
|
197
178
|
puts err.backtrace.join("\n")
|