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 +4 -4
- data/lib/helpers-blog.rb +7 -4
- data/lib/post.rb +1 -1
- data/lib/runeblog.rb +10 -2
- data/lib/version.rb +1 -1
- data/test/general.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8f1101f28eb0da5d22f2e1585b49a0a7443041ffaa22848fe32e9f2f6213d3f
|
4
|
+
data.tar.gz: 808bbc71b7abc1e8bc6cce5470c8912568a7d8fb166a285ea783f8db5a710999
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 "
|
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
|
-
|
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
|
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
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
|
-
|
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
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.
|
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-
|
11
|
+
date: 2018-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|