runeblog 0.0.61 → 0.0.62
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/repl.rb +9 -5
- data/lib/runeblog.rb +5 -1
- data/test/repl.rb +17 -4
- 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: 853cc1fbf7aa876a9b64fd5610ed7ded80605015
|
4
|
+
data.tar.gz: 37eac8d1a538f3b2b8f960adf8e42528e9ca998c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 877f1dc5b92237f4e3064652917643a0360857bf449c818717ece811b7c94ae025a5a62798eb48391b90f48cf17510184c992d142350469fe2dcad6e643b073c
|
7
|
+
data.tar.gz: eadaa9244ba181f48aa50d28db84145b5eeba71c6c4ddbe028d3cca38c6ab998b853a107b93a71975d10ca78b6d490599839de38cf6b1a9d93d4dac8cb158b94
|
data/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
RuneBlog v 0.0.
|
1
|
+
RuneBlog v 0.0.62 2018-09-18
|
data/lib/repl.rb
CHANGED
@@ -170,12 +170,11 @@ module RuneBlog::REPL
|
|
170
170
|
if safe
|
171
171
|
output_newline
|
172
172
|
files.each {|f| outstr " #{f}\n" }
|
173
|
-
# puts @out # ??
|
174
173
|
reset_output
|
175
174
|
ques = "\n Delete?\n "
|
176
175
|
ques.sub!(/\?/, " all these?") if files.size > 1
|
177
|
-
|
178
|
-
if
|
176
|
+
yes = yesno red(ques)
|
177
|
+
if yes
|
179
178
|
result = system("rm -rf #{files.join(' ')}")
|
180
179
|
error_cant_delete(files) unless result
|
181
180
|
output! "Deleted\n"
|
@@ -270,16 +269,21 @@ module RuneBlog::REPL
|
|
270
269
|
|
271
270
|
#{red('change view VIEW ')} Change current view
|
272
271
|
#{red('cv VIEW ')} Change current view
|
272
|
+
|
273
273
|
#{red('new view ')} Create a new view
|
274
|
+
|
274
275
|
#{red('list views ')} List all views available
|
275
276
|
#{red('lsv ')} Same as: list views
|
276
277
|
|
277
278
|
#{red('p, post ')} Create a new post
|
278
279
|
#{red('new post ')} Same as post (create a post)
|
280
|
+
|
279
281
|
#{red('lsp, list posts ')} List posts in current view
|
282
|
+
|
280
283
|
#{red('lsd, list drafts ')} List all posts regardless of view
|
281
284
|
|
282
285
|
#{red('rm ID ')} Remove a post
|
286
|
+
#{red('kill ID ID ID... ')} Remove multiple posts
|
283
287
|
#{red('edit ID ')} Edit a post
|
284
288
|
|
285
289
|
#{red('preview ')} Look at current (local) view in browser
|
@@ -296,8 +300,8 @@ module RuneBlog::REPL
|
|
296
300
|
def new_blog!(arg) # FIXME weird?
|
297
301
|
check_empty(arg)
|
298
302
|
return if RuneBlog.exist?
|
299
|
-
|
300
|
-
RuneBlog.create_new_blog if
|
303
|
+
yes = yesno(red(" No .blog found. Create new blog? "))
|
304
|
+
RuneBlog.create_new_blog if yes
|
301
305
|
rescue => err
|
302
306
|
error(err)
|
303
307
|
end
|
data/lib/runeblog.rb
CHANGED
@@ -3,7 +3,7 @@ require 'yaml'
|
|
3
3
|
require 'livetext'
|
4
4
|
|
5
5
|
class RuneBlog
|
6
|
-
VERSION = "0.0.
|
6
|
+
VERSION = "0.0.62"
|
7
7
|
|
8
8
|
Path = File.expand_path(File.join(File.dirname(__FILE__)))
|
9
9
|
DefaultData = Path + "/../data"
|
@@ -138,6 +138,10 @@ EOS
|
|
138
138
|
drafts = Dir.entries(dir).grep(/^0.*.lt3/)
|
139
139
|
end
|
140
140
|
|
141
|
+
def change_view(view)
|
142
|
+
@view = view
|
143
|
+
end
|
144
|
+
|
141
145
|
def process_post(file)
|
142
146
|
@main ||= Livetext.new
|
143
147
|
@main.main.output = File.new("/tmp/WHOA","w")
|
data/test/repl.rb
CHANGED
@@ -8,7 +8,6 @@ class TestREPL < Minitest::Test
|
|
8
8
|
include RuneBlog::REPL
|
9
9
|
|
10
10
|
def setup
|
11
|
-
Dir.chdir("/Users/Hal/Dropbox/files/blog") # temp code!!
|
12
11
|
@blog = open_blog
|
13
12
|
end
|
14
13
|
|
@@ -37,21 +36,21 @@ class TestREPL < Minitest::Test
|
|
37
36
|
def test_004_change_view
|
38
37
|
out = cmd_change_view(nil) # no param
|
39
38
|
assert out.is_a?(String), "Expected a string; got: #{out.inspect}"
|
40
|
-
assert out =~ /
|
39
|
+
assert out =~ /view1/m, "Expecting 'view1' as default; got: #{out.inspect}"
|
41
40
|
end
|
42
41
|
|
43
42
|
def test_005_lsd
|
44
43
|
out = cmd_list_drafts(nil)
|
45
44
|
assert out.is_a?(String), "Expected a string returned"
|
46
45
|
lines = out.split("\n").length
|
47
|
-
assert lines >=
|
46
|
+
assert lines >= 2, "Expecting more lines; got: #{out.inspect}"
|
48
47
|
end
|
49
48
|
|
50
49
|
def test_006_lsp
|
51
50
|
out = cmd_list_posts(nil)
|
52
51
|
assert out.is_a?(String), "Expected a string returned; got: #{out.inspect}"
|
53
52
|
lines = out.split("\n").length
|
54
|
-
assert lines >=
|
53
|
+
assert lines >= 2, "Expecting more lines; got: #{out.inspect}"
|
55
54
|
end
|
56
55
|
|
57
56
|
def test_007_parser
|
@@ -99,5 +98,19 @@ class TestREPL < Minitest::Test
|
|
99
98
|
assert result == expected, "Expected #{expected.inspect} but got #{result.inspect}"
|
100
99
|
end
|
101
100
|
end
|
101
|
+
|
102
|
+
def test_008_current_view
|
103
|
+
assert @blog.view == "view1", "Current view seems wrong (#{@blog.view}, not view1)"
|
104
|
+
end
|
105
|
+
|
106
|
+
def test_009_change_view
|
107
|
+
assert @blog.change_view("view2")
|
108
|
+
assert @blog.view == "view2", "Current view seems wrong (#{@blog.view}, not view2)"
|
109
|
+
end
|
110
|
+
|
111
|
+
def test_010_accessors
|
112
|
+
assert @blog.views.sort == ["view1", "view2"]
|
113
|
+
end
|
114
|
+
|
102
115
|
end
|
103
116
|
|
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.62
|
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-09-
|
11
|
+
date: 2018-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|