runeblog 0.0.71 → 0.0.72
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blog +1 -1
- data/data/VERSION +1 -1
- data/lib/helpers-repl.rb +1 -3
- data/lib/repl.rb +7 -7
- data/lib/version.rb +1 -1
- data/test/repl.rb +15 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d38a4c8ca29b37f67bbb33b0c054b38cbcac189c
|
4
|
+
data.tar.gz: 62a83e3273d7610bab0ce6d9eb68adabc8548cc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e826a4c5b2fb3bf48d3c035feb681cf0766d5af304723b39610f6bb211029876655982f3395a3a773c37e3096605b8f0a84a3852291b294531c9a89bab70b372
|
7
|
+
data.tar.gz: c3365f3c0442111acdc882620d020de4d0f8fc2e22f2b4193951a0425cc797969fa44352008df8d38958377d62ef20a7021819c4c9fc0bf535446e8fa6a3cf10
|
data/bin/blog
CHANGED
data/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
RuneBlog v 0.0.
|
1
|
+
RuneBlog v 0.0.72 2018-10-02
|
data/lib/helpers-repl.rb
CHANGED
@@ -5,10 +5,8 @@ module RuneBlog::REPL
|
|
5
5
|
Patterns =
|
6
6
|
{"help" => :cmd_help,
|
7
7
|
"h" => :cmd_help,
|
8
|
-
|
9
8
|
"version" => :cmd_version,
|
10
9
|
"v" => :cmd_version,
|
11
|
-
|
12
10
|
"list views" => :cmd_list_views,
|
13
11
|
"lsv" => :cmd_list_views,
|
14
12
|
|
@@ -67,7 +65,7 @@ module RuneBlog::REPL
|
|
67
65
|
def self.choose_method(cmd)
|
68
66
|
cmd = cmd.strip
|
69
67
|
found = nil
|
70
|
-
params =
|
68
|
+
params = nil
|
71
69
|
Regexes.each_pair do |rx, meth|
|
72
70
|
m = cmd.match(rx)
|
73
71
|
# puts "#{rx} =~ #{cmd.inspect} --> #{m.to_a.inspect}"
|
data/lib/repl.rb
CHANGED
@@ -142,7 +142,7 @@ module RuneBlog::REPL
|
|
142
142
|
else
|
143
143
|
if @blog.view?(arg)
|
144
144
|
@blog.view = arg
|
145
|
-
output! "View: #{@blog.view}
|
145
|
+
output! "View: #{@blog.view}"
|
146
146
|
end
|
147
147
|
end
|
148
148
|
@out
|
@@ -153,8 +153,7 @@ module RuneBlog::REPL
|
|
153
153
|
def cmd_new_view(arg)
|
154
154
|
reset_output
|
155
155
|
@blog.create_view(arg)
|
156
|
-
|
157
|
-
@blog.view(arg).deploy = depl
|
156
|
+
@blog.view.read_config # was: get_deployment_info
|
158
157
|
nil
|
159
158
|
rescue => err
|
160
159
|
error(err)
|
@@ -163,7 +162,7 @@ module RuneBlog::REPL
|
|
163
162
|
def cmd_new_post(arg)
|
164
163
|
reset_output
|
165
164
|
check_empty(arg)
|
166
|
-
title = ask("
|
165
|
+
title = ask("\nTitle: ")
|
167
166
|
@blog.create_new_post(title)
|
168
167
|
nil
|
169
168
|
rescue => err
|
@@ -248,10 +247,11 @@ module RuneBlog::REPL
|
|
248
247
|
check_empty(arg)
|
249
248
|
reset_output
|
250
249
|
posts = @blog.posts # current view
|
251
|
-
output @blog.view.name + "
|
250
|
+
output bold(@blog.view.name) + ":"
|
252
251
|
if posts.empty?
|
253
|
-
output! "No posts
|
252
|
+
output! bold("No posts")
|
254
253
|
else
|
254
|
+
output_newline
|
255
255
|
posts.each {|post| outstr " #{colored_slug(post)}\n" }
|
256
256
|
end
|
257
257
|
@out
|
@@ -262,12 +262,12 @@ module RuneBlog::REPL
|
|
262
262
|
def cmd_list_drafts(arg)
|
263
263
|
check_empty(arg)
|
264
264
|
reset_output
|
265
|
-
output_newline
|
266
265
|
drafts = @blog.drafts # current view
|
267
266
|
if drafts.empty?
|
268
267
|
output! "No drafts"
|
269
268
|
return @out
|
270
269
|
else
|
270
|
+
output_newline
|
271
271
|
drafts.each do |draft|
|
272
272
|
outstr " #{colored_slug(draft.sub(/.lt3$/, ""))}\n"
|
273
273
|
end
|
data/lib/version.rb
CHANGED
data/test/repl.rb
CHANGED
@@ -8,8 +8,9 @@ class TestREPL < Minitest::Test
|
|
8
8
|
include RuneBlog::REPL
|
9
9
|
|
10
10
|
def setup
|
11
|
+
system("rm -rf data_test")
|
12
|
+
system("tar xvf data_test.tar 2>/dev/null")
|
11
13
|
@blog = RuneBlog.new
|
12
|
-
# unpack a tarball here?? data_test
|
13
14
|
end
|
14
15
|
|
15
16
|
# Note: "Bang" methods depend on the data_test subtree
|
@@ -39,7 +40,7 @@ class TestREPL < Minitest::Test
|
|
39
40
|
def test_004_change_view!
|
40
41
|
out = cmd_change_view(nil) # no param
|
41
42
|
assert out.is_a?(String), "Expected a string; got: #{out.inspect}"
|
42
|
-
assert out =~ /
|
43
|
+
assert out =~ /alpha_view/m, "Expecting 'alpha_view' as default; got: #{out.inspect}"
|
43
44
|
end
|
44
45
|
|
45
46
|
def test_005_lsd!
|
@@ -73,7 +74,7 @@ class TestREPL < Minitest::Test
|
|
73
74
|
"new post" => [:cmd_new_post, nil],
|
74
75
|
"p" => [:cmd_new_post, nil],
|
75
76
|
"post" => [:cmd_new_post, nil],
|
76
|
-
"change view
|
77
|
+
"change view beta_view" => [:cmd_change_view, "beta_view"],
|
77
78
|
"cv" => [:cmd_change_view, nil], # 0-arity
|
78
79
|
"cv myview" => [:cmd_change_view, "myview"],
|
79
80
|
"list posts" => [:cmd_list_posts, nil],
|
@@ -103,31 +104,34 @@ class TestREPL < Minitest::Test
|
|
103
104
|
end
|
104
105
|
|
105
106
|
def test_008_current_view!
|
106
|
-
assert @blog.view.to_s == "
|
107
|
+
assert @blog.view.to_s == "alpha_view", "Current view seems wrong (#{@blog.view}, not alpha_view)"
|
107
108
|
end
|
108
109
|
|
109
110
|
def test_009_change_view!
|
110
|
-
assert @blog.change_view("
|
111
|
-
assert @blog.view.to_s == "
|
111
|
+
assert @blog.change_view("beta_view")
|
112
|
+
assert @blog.view.to_s == "beta_view", "Current view seems wrong (#{@blog.view}, not beta_view)"
|
112
113
|
end
|
113
114
|
|
114
115
|
def test_010_accessors!
|
115
116
|
sorted_views = @blog.views.map(&:to_s).sort
|
116
|
-
assert sorted_views == ["
|
117
|
+
assert sorted_views == ["alpha_view", "beta_view", "gamma_view"],
|
118
|
+
"Got: #{sorted_views.inspect}"
|
117
119
|
end
|
118
120
|
|
119
121
|
def test_011_create_delete_view!
|
120
122
|
@blog.create_view("anotherview")
|
121
123
|
sorted_views = @blog.views.map(&:to_s).sort
|
122
|
-
assert sorted_views == ["anotherview", "
|
124
|
+
assert sorted_views == ["alpha_view", "anotherview", "beta_view", "gamma_view"],
|
125
|
+
"After create: #{sorted_views.inspect}"
|
123
126
|
@blog.delete_view("anotherview", true)
|
124
127
|
sorted_views = @blog.views.map(&:to_s).sort
|
125
|
-
assert sorted_views == ["
|
128
|
+
assert sorted_views == ["alpha_view", "beta_view", "gamma_view"],
|
129
|
+
"After delete: #{sorted_views.inspect}"
|
126
130
|
end
|
127
131
|
|
128
132
|
def test_012_create_remove_post! # FIXME - several problems here
|
129
|
-
@blog.change_view("
|
130
|
-
assert @blog.view.to_s == "
|
133
|
+
@blog.change_view("beta_view")
|
134
|
+
assert @blog.view.to_s == "beta_view", "Expected beta_view"
|
131
135
|
before = @blog.posts.size
|
132
136
|
num = @blog.create_new_post("Uninteresting title", true)
|
133
137
|
assert @blog.posts.size == before + 1, "Don't see new post"
|
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.72
|
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-10-
|
11
|
+
date: 2018-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|