runeblog 0.1.16 → 0.1.17

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: a430f05e99cacbffb7eda0025f5cfdddb3d688ff0450ae6c3972da8f9c5bbd55
4
- data.tar.gz: 6f3a6f70702041640e119168290228d95d2e24c4536ce13b483556b77670a8ca
3
+ metadata.gz: a8f1101f28eb0da5d22f2e1585b49a0a7443041ffaa22848fe32e9f2f6213d3f
4
+ data.tar.gz: 808bbc71b7abc1e8bc6cce5470c8912568a7d8fb166a285ea783f8db5a710999
5
5
  SHA512:
6
- metadata.gz: 692090810d4084c10ff355dfa9c52d96f68ffb54f5ab6ab2771db393fc63313d893156fd100a8dc1f496991af1849851df5e902e0c7d8d3e3283c8eedd10eb04
7
- data.tar.gz: dda041ee187d5aa62c5460db0111e7af794d2d55d240b6555574a1542b1b4959b57c5ee4dd2d0e3f6777dc238ae43a82cc5ae6ea79c17e0acd49ba8c066ec7a1
6
+ metadata.gz: e9ffb37ff118a8336a2568030aacc8873226879d461002457d28ee322f405601ba7a2a51dd76c17c725a5ee2cc4d4ff13833e593db6f2cbdd2b7cc5fea97a28a
7
+ data.tar.gz: e3f626c123be7ba870e6ade22d19fe3cbaff016ca21206d84b72658f6e64e8eb9eebbb9e2fe7b521690cade73d37edea9a7cf61a9e49bdbf24ace94b1c6bbb62
data/lib/helpers-blog.rb CHANGED
@@ -18,7 +18,7 @@ module RuneBlog::Helpers
18
18
  end
19
19
  return vals
20
20
  rescue => err
21
- puts "Something hit the fan: #{err}"
21
+ puts "Can't read config file '#{file}': #{err}"
22
22
  puts err.backtrace.join("\n")
23
23
  puts "dir = #{Dir.pwd}"
24
24
  exit
@@ -43,7 +43,8 @@ module RuneBlog::Helpers
43
43
  Dir.mkdir(".blog")
44
44
  x = OpenStruct.new
45
45
  x.root, x.current_view, x.editor = root, current_view, editor
46
- write_config(x, RuneBlog::DotDir + "/config")
46
+ puts "config = #{RuneBlog::ConfigFile}"
47
+ write_config(x, RuneBlog::ConfigFile)
47
48
  end
48
49
 
49
50
  def new_sequence
@@ -56,8 +57,10 @@ module RuneBlog::Helpers
56
57
  dirs = Dir.entries(dir) - %w[. ..]
57
58
  dirs.reject! {|x| ! File.directory?("#@root/views/#{x}") }
58
59
  dirs
59
- rescue
60
+ rescue => err
60
61
  STDERR.puts "Can't find dir '#{dir}'"
62
+ puts err
63
+ puts err.backtrace
61
64
  exit
62
65
  end
63
66
 
@@ -70,7 +73,7 @@ module RuneBlog::Helpers
70
73
 
71
74
  def create_dir(dir)
72
75
  return if Dir.exist?(dir) # && File.directory?(dir)
73
- cmd = "mkdir -p #{dir} >/dev/null 2>&1"
76
+ cmd = "mkdir -p #{dir} >/dev/null" # 2>&1"
74
77
  result = system(cmd)
75
78
  raise CantCreateDir(dir) unless result
76
79
  end
data/lib/post.rb CHANGED
@@ -38,7 +38,7 @@ class RuneBlog::Post
38
38
  create_dir(post_dir) rescue nil # FIXME?
39
39
  Dir.chdir(post_dir) do
40
40
  create_dir("assets") rescue nil
41
- system("cp body.txt index.html") # gahhh
41
+ system("cp body.txt index.html") # gahhh FIXME
42
42
  end
43
43
  end
44
44
 
data/lib/runeblog.rb CHANGED
@@ -36,17 +36,23 @@ class RuneBlog
36
36
 
37
37
  include Helpers
38
38
 
39
- def self.create_new_blog(dir = ".blog")
39
+ def self.create_new_blog(dir = ".blog/data")
40
+ puts "--- create_new_blog"
40
41
  raise ArgumentError unless dir.is_a?(String) && ! dir.empty?
41
42
  root_dir = Dir.pwd + "/" + dir
43
+ puts "--- create: dir = #{dir} pwd = #{Dir.pwd} DotDir = #{DotDir} root_dir = #{root_dir}"
42
44
  raise BlogAlreadyExists if Dir.exist?(root_dir)
43
- new_dotfile(root: root_dir, current_view: "test_view")
45
+ puts "--- new dotfile"
46
+ new_dotfile(root: dir, current_view: "test_view")
47
+ puts "--- create #{dir}"
44
48
  create_dir(dir)
45
49
  Dir.chdir(dir) do
50
+ puts "--- in chdir: pwd = #{Dir.pwd}"
46
51
  create_dir("views")
47
52
  create_dir("assets")
48
53
  create_dir("src")
49
54
  new_sequence
55
+ puts "==== CREATED BLOG ==="
50
56
  end
51
57
  blog = self.new
52
58
  blog.create_view("test_view")
@@ -61,6 +67,7 @@ class RuneBlog
61
67
  self.class.blog = self # Weird. Like a singleton - dumbass circular dependency?
62
68
  @root, @view_name, @editor =
63
69
  read_config(ConfigFile, :root, :current_view, :editor)
70
+ puts "=== init root = #@root"
64
71
  @views = get_views
65
72
  @view = str2view(@view_name)
66
73
  @sequence = get_sequence
@@ -130,6 +137,7 @@ class RuneBlog
130
137
  Dir.chdir(dir)
131
138
  x = RuneBlog::Default
132
139
  create_dir('custom')
140
+ puts "=== create_view - created 'custom'"
133
141
  create_dir('assets')
134
142
  # FIXME dump method??
135
143
  pub = "user: xxx\nserver: xxx\ndocroot: xxx\npath: xxx\nproto: xxx\n"
data/lib/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.16"
3
+ VERSION = "0.1.17"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
data/test/general.rb CHANGED
@@ -2,6 +2,7 @@ $LOAD_PATH << "."
2
2
 
3
3
  require "minitest/autorun"
4
4
 
5
+ require 'runeblog'
5
6
  require 'lib/repl'
6
7
  require 'rubytext'
7
8
 
@@ -20,6 +21,7 @@ class TestREPL < Minitest::Test
20
21
  def setup
21
22
  # To be strictly correct in testing (though slower),
22
23
  # run make_blog here.
24
+ system("tar zcvf last-test.tgz .blog/ && rm -rf .blog")
23
25
  system("ruby test/make_blog.rb") if ARGV.first == "new"
24
26
  @blog = RuneBlog.new
25
27
  end
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.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-27 00:00:00.000000000 Z
11
+ date: 2018-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext