runeblog 0.0.69 → 0.0.70
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/VERSION +1 -1
- data/lib/post.rb +5 -3
- data/lib/runeblog.rb +24 -4
- data/lib/version.rb +1 -1
- data/runeblog.gemspec +4 -6
- data/test/repl.rb +12 -9
- metadata +3 -4
- data/lib/hmm +0 -102
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4f29cc12aa64b5f4cca11de957354c25078b3c8
|
4
|
+
data.tar.gz: 9d8667b9c143e2cf7552bda06107eec41d775e8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e32a753577f48d056b9c2b3a4bf1f9fbf1c267e9d73fe5e9bcac49758b1b1344c118e8b7ce2797ff67cc854db9555030ff559b3eb4d1165d3127ae39850b122a
|
7
|
+
data.tar.gz: edaf5b5aa7209bc640e3a743437c9818bc0587d3f37e39f15e0cfcc1bc89d973a18b53de96e5f6850e29a1ff283dc8b3cd920e4cefd2d3695594f55ad03b517a
|
data/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
RuneBlog v 0.0.
|
1
|
+
RuneBlog v 0.0.70 2018-10-01
|
data/lib/post.rb
CHANGED
@@ -11,7 +11,9 @@ class RuneBlog::Post
|
|
11
11
|
result
|
12
12
|
end
|
13
13
|
|
14
|
-
def initialize(title, view_name
|
14
|
+
def initialize(title, view_name,
|
15
|
+
teaser = "Teaser goes here.",
|
16
|
+
remainder = "Remainder of post goes here.")
|
15
17
|
raise "RuneBlog.blog is not set!" if RuneBlog.blog.nil?
|
16
18
|
@blog = RuneBlog.blog
|
17
19
|
@title = title
|
@@ -26,9 +28,9 @@ class RuneBlog::Post
|
|
26
28
|
.views #@view
|
27
29
|
|
28
30
|
.teaser
|
29
|
-
|
31
|
+
#{teaser}
|
30
32
|
.end
|
31
|
-
|
33
|
+
#{remainder}
|
32
34
|
EOS
|
33
35
|
|
34
36
|
@draft = "#{@blog.root}/src/#@slug.lt3"
|
data/lib/runeblog.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
require 'find'
|
2
|
-
require 'yaml'
|
2
|
+
require 'yaml' # get rid of YAML later
|
3
3
|
require 'livetext'
|
4
4
|
require 'skeleton'
|
5
5
|
require 'view'
|
6
6
|
require 'deploy'
|
7
7
|
require 'post'
|
8
|
-
require 'helpers-blog'
|
9
8
|
require 'version'
|
10
9
|
|
11
10
|
###
|
@@ -143,8 +142,10 @@ class RuneBlog
|
|
143
142
|
result
|
144
143
|
end
|
145
144
|
|
146
|
-
def create_new_post(title, testing = false)
|
147
|
-
|
145
|
+
def create_new_post(title, testing = false, teaser = nil, remainder = nil)
|
146
|
+
teaser ||= "Teaser goes here."
|
147
|
+
remainder ||= "Remainder of post goes here."
|
148
|
+
post = RuneBlog::Post.new(title, @view.to_s, teaser, remainder)
|
148
149
|
post.edit unless testing
|
149
150
|
post.publish
|
150
151
|
post.num
|
@@ -279,6 +280,8 @@ class RuneBlog
|
|
279
280
|
[postnum, "#{num}-#{slug}"]
|
280
281
|
end
|
281
282
|
|
283
|
+
private
|
284
|
+
|
282
285
|
def subdirs(dir)
|
283
286
|
dirs = Dir.entries(dir) - %w[. ..]
|
284
287
|
dirs.reject! {|x| ! File.directory?("#@root/views/#{x}") }
|
@@ -292,5 +295,22 @@ class RuneBlog
|
|
292
295
|
files
|
293
296
|
end
|
294
297
|
|
298
|
+
def create_dir(dir)
|
299
|
+
cmd = "mkdir -p #{dir} >/dev/null 2>&1"
|
300
|
+
result = system(cmd)
|
301
|
+
raise "Can't create #{dir}" unless result
|
302
|
+
end
|
303
|
+
|
304
|
+
def interpolate(str)
|
305
|
+
wrap = "<<-EOS\n#{str}\nEOS"
|
306
|
+
eval wrap
|
307
|
+
end
|
308
|
+
|
309
|
+
def error(err) # Hmm, this is duplicated
|
310
|
+
str = "\n Error: #{err}"
|
311
|
+
puts str
|
312
|
+
puts err.backtrace
|
313
|
+
end
|
314
|
+
|
295
315
|
end
|
296
316
|
|
data/lib/version.rb
CHANGED
data/runeblog.gemspec
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
require 'date'
|
2
2
|
require 'find'
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
$LOAD_PATH << "lib"
|
5
|
+
|
6
|
+
require "version"
|
6
7
|
|
7
8
|
Gem::Specification.new do |s|
|
8
9
|
system("rm -f *.gem")
|
@@ -25,9 +26,6 @@ Gem::Specification.new do |s|
|
|
25
26
|
test = Find.find("test").to_a
|
26
27
|
|
27
28
|
s.files = main + misc + test
|
28
|
-
STDERR.puts "Files are:"
|
29
|
-
s.files.each {|fn| STDERR.puts " " + fn }
|
30
|
-
STDERR.puts
|
31
29
|
s.homepage = 'https://github.com/Hal9000/runeblog'
|
32
|
-
s.license = "Ruby
|
30
|
+
s.license = "Ruby license"
|
33
31
|
end
|
data/test/repl.rb
CHANGED
@@ -9,8 +9,11 @@ class TestREPL < Minitest::Test
|
|
9
9
|
|
10
10
|
def setup
|
11
11
|
@blog = RuneBlog.new
|
12
|
+
# unpack a tarball here?? data_test
|
12
13
|
end
|
13
14
|
|
15
|
+
# Note: "Bang" methods depend on the data_test subtree
|
16
|
+
|
14
17
|
def test_001_cmd_help
|
15
18
|
out = cmd_help(nil)
|
16
19
|
assert out.is_a?(String), "Expected a string returned"
|
@@ -26,27 +29,27 @@ class TestREPL < Minitest::Test
|
|
26
29
|
"Couldn't find version number"
|
27
30
|
end
|
28
31
|
|
29
|
-
def test_003_list_views
|
32
|
+
def test_003_list_views!
|
30
33
|
out = cmd_list_views(nil)
|
31
34
|
assert out.is_a?(String), "Expected a string returned"
|
32
35
|
lines = out.split("\n").length
|
33
36
|
assert lines >= 2, "Expecting at least 2 lines"
|
34
37
|
end
|
35
38
|
|
36
|
-
def test_004_change_view
|
39
|
+
def test_004_change_view!
|
37
40
|
out = cmd_change_view(nil) # no param
|
38
41
|
assert out.is_a?(String), "Expected a string; got: #{out.inspect}"
|
39
42
|
assert out =~ /view1/m, "Expecting 'view1' as default; got: #{out.inspect}"
|
40
43
|
end
|
41
44
|
|
42
|
-
def test_005_lsd
|
45
|
+
def test_005_lsd!
|
43
46
|
out = cmd_list_drafts(nil)
|
44
47
|
assert out.is_a?(String), "Expected a string returned"
|
45
48
|
lines = out.split("\n").length
|
46
49
|
assert lines >= 2, "Expecting more lines; got: #{out.inspect}"
|
47
50
|
end
|
48
51
|
|
49
|
-
def test_006_lsp
|
52
|
+
def test_006_lsp!
|
50
53
|
out = cmd_list_posts(nil)
|
51
54
|
assert out.is_a?(String), "Expected a string returned; got: #{out.inspect}"
|
52
55
|
lines = out.split("\n").length
|
@@ -99,21 +102,21 @@ class TestREPL < Minitest::Test
|
|
99
102
|
end
|
100
103
|
end
|
101
104
|
|
102
|
-
def test_008_current_view
|
105
|
+
def test_008_current_view!
|
103
106
|
assert @blog.view.to_s == "view1", "Current view seems wrong (#{@blog.view}, not view1)"
|
104
107
|
end
|
105
108
|
|
106
|
-
def test_009_change_view
|
109
|
+
def test_009_change_view!
|
107
110
|
assert @blog.change_view("view2")
|
108
111
|
assert @blog.view.to_s == "view2", "Current view seems wrong (#{@blog.view}, not view2)"
|
109
112
|
end
|
110
113
|
|
111
|
-
def test_010_accessors
|
114
|
+
def test_010_accessors!
|
112
115
|
sorted_views = @blog.views.map(&:to_s).sort
|
113
116
|
assert sorted_views == ["view1", "view2"], "Got: #{sorted_views.inspect}"
|
114
117
|
end
|
115
118
|
|
116
|
-
def test_011_create_delete_view
|
119
|
+
def test_011_create_delete_view!
|
117
120
|
@blog.create_view("anotherview")
|
118
121
|
sorted_views = @blog.views.map(&:to_s).sort
|
119
122
|
assert sorted_views == ["anotherview", "view1", "view2"], "After create: #{sorted_views.inspect}"
|
@@ -122,7 +125,7 @@ class TestREPL < Minitest::Test
|
|
122
125
|
assert sorted_views == ["view1", "view2"], "After delete: #{sorted_views.inspect}"
|
123
126
|
end
|
124
127
|
|
125
|
-
def test_012_create_remove_post # FIXME - several problems here
|
128
|
+
def test_012_create_remove_post! # FIXME - several problems here
|
126
129
|
@blog.change_view("view2")
|
127
130
|
assert @blog.view.to_s == "view2", "Expected view2"
|
128
131
|
before = @blog.posts.size
|
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.0.
|
4
|
+
version: 0.0.70
|
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-
|
11
|
+
date: 2018-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|
@@ -50,7 +50,6 @@ files:
|
|
50
50
|
- lib/deploy.rb
|
51
51
|
- lib/helpers-blog.rb
|
52
52
|
- lib/helpers-repl.rb
|
53
|
-
- lib/hmm
|
54
53
|
- lib/post.rb
|
55
54
|
- lib/repl.rb
|
56
55
|
- lib/runeblog.rb
|
@@ -61,7 +60,7 @@ files:
|
|
61
60
|
- test/repl.rb
|
62
61
|
homepage: https://github.com/Hal9000/runeblog
|
63
62
|
licenses:
|
64
|
-
- Ruby
|
63
|
+
- Ruby license
|
65
64
|
metadata: {}
|
66
65
|
post_install_message:
|
67
66
|
rdoc_options: []
|
data/lib/hmm
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
helpers-repl.rb
|
2
|
-
67: def self.choose_method(cmd)
|
3
|
-
84: def error(err)
|
4
|
-
90: def ask(prompt, meth = :to_s)
|
5
|
-
96: def yesno(prompt, meth = :to_s)
|
6
|
-
102: def reset_output(initial = "")
|
7
|
-
107: def flush_output(initial = "")
|
8
|
-
113: def output(str) # \n and indent
|
9
|
-
118: def outstr(str) # \n and indent
|
10
|
-
123: def output!(str) # red, \n and indent
|
11
|
-
128: def output_newline(n = 1)
|
12
|
-
137: def check_empty(arg)
|
13
|
-
141: def get_integer(arg)
|
14
|
-
147: def check_file_exists(file)
|
15
|
-
151: def error_cant_delete(files)
|
16
|
-
160: def clear
|
17
|
-
164: def red(text)
|
18
|
-
168: def blue(text)
|
19
|
-
172: def bold(str)
|
20
|
-
176: def colored_slug(slug)
|
21
|
-
180: def import(arg = nil)
|
22
|
-
200: def ask_deployment_info # returns Deployment object
|
23
|
-
215:# def find_asset(asset) # , views)
|
24
|
-
241:# def find_all_assets(list, views)
|
25
|
-
|
26
|
-
repl.rb
|
27
|
-
7: def cmd_quit(arg)
|
28
|
-
12: def cmd_version(arg)
|
29
|
-
19: def cmd_browse
|
30
|
-
34: def cmd_preview(arg)
|
31
|
-
44: def cmd_deploy(arg) # FIXME non-string return expected in caller?
|
32
|
-
74: def old_cmd_deploy(arg) # FIXME non-string return expected in caller?
|
33
|
-
104: def cmd_rebuild(arg)
|
34
|
-
115: def cmd_relink(arg)
|
35
|
-
124: def cmd_list_views(arg)
|
36
|
-
136: def cmd_change_view(arg)
|
37
|
-
153: def cmd_new_view(arg)
|
38
|
-
163: def cmd_new_post(arg)
|
39
|
-
173: def cmd_kill(arg)
|
40
|
-
185: def cmd_remove_post(arg, safe=true)
|
41
|
-
226: def cmd_edit_post(arg)
|
42
|
-
247: def cmd_list_posts(arg)
|
43
|
-
262: def cmd_list_drafts(arg)
|
44
|
-
280: def cmd_INVALID(arg)
|
45
|
-
285: def cmd_help(arg)
|
46
|
-
|
47
|
-
runeblog.rb
|
48
|
-
5:def create_dir(dir) # FIXME move later
|
49
|
-
11:def interpolate(str)
|
50
|
-
16:def error(err) # FIXME - this is duplicated
|
51
|
-
43: def self.create_new_blog
|
52
|
-
55: def get_config(file)
|
53
|
-
60: def initialize(cfg_file = ".blog") # assumes existing blog
|
54
|
-
69: def view?(name)
|
55
|
-
73: def view(name = nil)
|
56
|
-
77: def str2view(str)
|
57
|
-
81: def view=(arg)
|
58
|
-
94: def get_sequence
|
59
|
-
98: def next_sequence
|
60
|
-
103: def viewdir(v)
|
61
|
-
107: def self.exist?
|
62
|
-
111: def create_view(arg)
|
63
|
-
127: def delete_view(name, force = false)
|
64
|
-
134: def deployment_url
|
65
|
-
141: def view_files
|
66
|
-
150: def files_by_id(id)
|
67
|
-
157: def create_new_post(title, testing = false)
|
68
|
-
166: def edit_initial_post(file)
|
69
|
-
174: def posts
|
70
|
-
180: def drafts
|
71
|
-
185: def change_view(view)
|
72
|
-
189: def process_post(file)
|
73
|
-
203: def publish_post(meta)
|
74
|
-
211: def link_post_view(view)
|
75
|
-
225: def generate_index(view)
|
76
|
-
248: def relink
|
77
|
-
252: def index_entry(view, meta)
|
78
|
-
267: def rebuild_post(file)
|
79
|
-
274: def remove_post(num)
|
80
|
-
281: def post_exists?(num)
|
81
|
-
286: def make_slug(title, postnum = nil)
|
82
|
-
293: def subdirs(dir)
|
83
|
-
299: def find_src_slugs
|
84
|
-
313: def initialize(user, server, root, path, protocol = "http")
|
85
|
-
319: def url
|
86
|
-
323: def deploy(files)
|
87
|
-
345: def initialize(name)
|
88
|
-
352: def dir
|
89
|
-
356: def index
|
90
|
-
360: def to_s
|
91
|
-
364: def files(recent = false)
|
92
|
-
373: def deploy
|
93
|
-
384: def recent?(file)
|
94
|
-
388: def read_config
|
95
|
-
395: def write_config
|
96
|
-
408: def self.files(num, root)
|
97
|
-
414: def initialize(title, view_name)
|
98
|
-
438: def edit
|
99
|
-
446: def publish
|
100
|
-
469: def create_post_subtree(vdir)
|
101
|
-
477: def make_slug(postnum = nil)
|
102
|
-
484: def tag(num)
|