runeblog 0.1.74 → 0.1.75
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/helpers-blog.rb +6 -4
- data/lib/publish.rb +2 -1
- data/lib/repl.rb +3 -0
- data/lib/runeblog.rb +4 -3
- data/lib/runeblog_version.rb +1 -1
- data/lib/view.rb +11 -2
- data/test/make_blog.rb +0 -1
- 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: 0470ad7c94aa5cb9de8da34f2939c4dcab2f763da6c2dafb21ef2cf7e736b4c2
|
4
|
+
data.tar.gz: e254ba0ab1d45cea175e1e74e2d00c2dde7889f407c544f41d226342e8a6411f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99fe9e5f8b55e3fa7831adc49ca9a32ea26ea842a927fa497cc70c611f80c8c8cd60f83d83dcfaa5501d392cdedd528d16a5b018b342ef33009f9a621399b1d8
|
7
|
+
data.tar.gz: 89109d824983f4f2d342ac1e1f5a29d233776f38a68387045053f86a4dcef2217740818daa448cfe6fef8389285307c2c196a8347dce55581a58f7b49a9e9861
|
data/data/standard.tgz
CHANGED
Binary file
|
data/lib/helpers-blog.rb
CHANGED
@@ -3,16 +3,17 @@ require 'runeblog_version'
|
|
3
3
|
module RuneBlog::Helpers
|
4
4
|
|
5
5
|
def read_config(file, *syms)
|
6
|
-
|
6
|
+
# verify(File.exist?(file) => "File #{file} doesn't exist")
|
7
7
|
lines = File.readlines(file).map(&:chomp)
|
8
|
-
obj = OpenStruct.new
|
8
|
+
obj = ::OpenStruct.new
|
9
9
|
lines.each do |line|
|
10
10
|
next if line == "\n" || line[0] == "#"
|
11
|
-
key, val = line.split(
|
12
|
-
|
11
|
+
key, val = line.split(/: +/, 2)
|
12
|
+
# STDERR.puts [key, val].inspect
|
13
13
|
obj.send(key+"=", val)
|
14
14
|
end
|
15
15
|
return obj if syms.empty?
|
16
|
+
|
16
17
|
vals = []
|
17
18
|
if syms.empty?
|
18
19
|
vals = obj.to_hash.values
|
@@ -30,6 +31,7 @@ module RuneBlog::Helpers
|
|
30
31
|
def try_read_config(file, hash)
|
31
32
|
return hash.values unless File.exist?(file)
|
32
33
|
vals = read_config(file, *hash.keys)
|
34
|
+
# STDERR.puts vals.inspect
|
33
35
|
vals
|
34
36
|
end
|
35
37
|
|
data/lib/publish.rb
CHANGED
@@ -42,11 +42,12 @@ debug "Failed!\n " if ! rc
|
|
42
42
|
# root@rubyhacker.com:/var/www/testblog/alpha_view
|
43
43
|
|
44
44
|
def publish(files, assets=[])
|
45
|
+
STDERR.puts "-- publish: files = #{files.inspect} assets = #{assets.inspect}"
|
45
46
|
dir = "#@docroot/#@path"
|
46
47
|
view_name = @blog.view.name
|
47
48
|
viewpath = "#{dir}/#{view_name}"
|
48
49
|
result = system!("ssh #@user@#@server -x mkdir -p #{viewpath}")
|
49
|
-
|
50
|
+
result = system!("ssh #@user@#@server -x mkdir -p #{viewpath}/assets")
|
50
51
|
files.each do |file|
|
51
52
|
dest = "#@user@#@server:#{dir}/#{view_name}"
|
52
53
|
file.gsub!(/\/\//, "/") # weird... :-/
|
data/lib/repl.rb
CHANGED
@@ -91,6 +91,7 @@ module RuneBlog::REPL
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def cmd_publish(arg, testing = false)
|
94
|
+
# Future Hal says please refactor this
|
94
95
|
puts unless testing
|
95
96
|
reset_output
|
96
97
|
check_empty(arg)
|
@@ -99,6 +100,7 @@ module RuneBlog::REPL
|
|
99
100
|
output! "Can't publish without entries in #{@blog.view.name}/publish"
|
100
101
|
return @out
|
101
102
|
end
|
103
|
+
|
102
104
|
# Need to check dirty/clean status first
|
103
105
|
dirty, all, assets = @blog.view.publishable_files
|
104
106
|
files = dirty
|
@@ -114,6 +116,7 @@ module RuneBlog::REPL
|
|
114
116
|
@blog.view.publisher.publish(files, assets) # FIXME weird?
|
115
117
|
end
|
116
118
|
return @out unless ret
|
119
|
+
|
117
120
|
vdir = @blog.view.dir
|
118
121
|
dump("fix this later", "#{vdir}/last_published")
|
119
122
|
if ! testing || ! ret
|
data/lib/runeblog.rb
CHANGED
@@ -166,11 +166,12 @@ class RuneBlog
|
|
166
166
|
Dir.chdir(vdir)
|
167
167
|
x = RuneBlog::Default
|
168
168
|
create_dir('themes')
|
169
|
-
# create_dir("local")
|
170
169
|
create_dir("generated")
|
171
170
|
create_dir('assets')
|
172
171
|
|
173
172
|
Dir.chdir("themes") { system("tar zxvf #{GemData}/standard.tgz 2>/dev/null") }
|
173
|
+
system("cp themes/standard/blog/assets/* assets/")
|
174
|
+
|
174
175
|
pub = "user: xxx\nserver: xxx\ndocroot: xxx\npath: xxx\nproto: xxx\n"
|
175
176
|
dump(pub, "publish")
|
176
177
|
|
@@ -180,7 +181,7 @@ class RuneBlog
|
|
180
181
|
self.view = view
|
181
182
|
vdir = self.view.dir
|
182
183
|
dir0 = "#{vdir}/themes/standard/blog"
|
183
|
-
dir1 = "#{vdir}/generated
|
184
|
+
dir1 = "#{vdir}/generated"
|
184
185
|
system("livetext #{dir0}/generate.lt3 >#{dir1}/index.html 2>#{dir1}/index.err")
|
185
186
|
dump("Initial creation", "last_published")
|
186
187
|
Dir.chdir(up)
|
@@ -277,7 +278,7 @@ class RuneBlog
|
|
277
278
|
|
278
279
|
vdir = self.view.dir
|
279
280
|
dir0 = "#{vdir}/themes/standard/blog"
|
280
|
-
dir1 = "#{vdir}/generated
|
281
|
+
dir1 = "#{vdir}/generated"
|
281
282
|
system("livetext #{dir0}/generate.lt3 >#{dir1}/index.html 2>#{dir1}/index.err")
|
282
283
|
rescue => err
|
283
284
|
error(err)
|
data/lib/runeblog_version.rb
CHANGED
data/lib/view.rb
CHANGED
@@ -24,7 +24,7 @@ class RuneBlog::View
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def local_index
|
27
|
-
dir + "/generated/
|
27
|
+
dir + "/generated/index.html"
|
28
28
|
end
|
29
29
|
|
30
30
|
def index
|
@@ -38,9 +38,18 @@ class RuneBlog::View
|
|
38
38
|
def publishable_files
|
39
39
|
vdir = dir()
|
40
40
|
files = [local_index()]
|
41
|
-
others = Dir.entries(vdir).grep(/^\d\d\d\d/).map {|x| "#{vdir}/#{x}" }
|
41
|
+
others = Dir.entries(vdir + "/generated").grep(/^\d\d\d\d/).map {|x| "#{vdir}/generated/#{x}" }
|
42
|
+
STDERR.puts "-- publishable: others = #{others.inspect}"
|
43
|
+
deep_assets = Dir["#{vdir}/themes/standard/assets/*"]
|
44
|
+
# Do this at view creation
|
45
|
+
deep_assets.each do |file|
|
46
|
+
cmd = "cp #{file} #{vdir}/assets"
|
47
|
+
STDERR.puts "-- cmd = #{cmd}"
|
48
|
+
system(cmd)
|
49
|
+
end
|
42
50
|
assets = Dir.entries("#{vdir}/assets") - %w[. ..]
|
43
51
|
assets.map! {|x| "#{vdir}/assets/#{x}" }
|
52
|
+
STDERR.puts "-- publishable: assets = #{assets.inspect}"
|
44
53
|
assets.reject! {|x| File.directory?(x) }
|
45
54
|
# assets.reject! {|x| ! recent?(x) }
|
46
55
|
files = files + others
|
data/test/make_blog.rb
CHANGED
@@ -39,7 +39,6 @@ x.create_view("around_austin") # FIXME remember view title!
|
|
39
39
|
if File.exist?("publish")
|
40
40
|
system("cp publish .blogs/data/views/around_austin/publish")
|
41
41
|
end
|
42
|
-
system("cp test/fakeimage.jpg .blogs/data/views/around_austin/assets/")
|
43
42
|
|
44
43
|
x.create_view("computing")
|
45
44
|
|