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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8887f24789a03d99de20f8b9494ba5a63f13c1a66fab44c6d8e45c7b8ca194ed
4
- data.tar.gz: 6a61b3fd742b4136e9782d1a5b00f47d5b1651bf25a732d0c9214e97682e669c
3
+ metadata.gz: 0470ad7c94aa5cb9de8da34f2939c4dcab2f763da6c2dafb21ef2cf7e736b4c2
4
+ data.tar.gz: e254ba0ab1d45cea175e1e74e2d00c2dde7889f407c544f41d226342e8a6411f
5
5
  SHA512:
6
- metadata.gz: 5d3f15071f792b4704730516f5f643b2d1fc3924ce9fdd1f7435d80b91a20517bcad6f858227839d73b7dced3bf1a54aefe946983d21d2f6213af597930c1b47
7
- data.tar.gz: f1e6d968e46a0386148746df2f7410262bdcea0701842b81060c6cd286da386d97d6f2b552d22cadfa3510d4efebc7dd3601a5f86918995a75d1b611c659db86
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
- verify(File.exist?(file) => "File #{file} doesn't exist")
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(" ", 2)
12
- key = key[0..-2] # remove colon
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
- # result = system!("ssh #@user@#@server -x mkdir -p #{dir}/assets")
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/blog"
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/blog"
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)
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.74"
3
+ VERSION = "0.1.75"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
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/blog/index.html"
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.74
4
+ version: 0.1.75
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton