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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca2648e3bcca270f74671363c314ad6fad4b9807
4
- data.tar.gz: 36f7b4d7cb14e872848fb3348ee33f477718708c
3
+ metadata.gz: 853cc1fbf7aa876a9b64fd5610ed7ded80605015
4
+ data.tar.gz: 37eac8d1a538f3b2b8f960adf8e42528e9ca998c
5
5
  SHA512:
6
- metadata.gz: fdfe7950cd8d63d055216891a7dd4f260f92230af319bacb65b7483707750219cd603300a5ce990869c7d1a7f2ad0c0728970ae86b0276a481d62c2aeb0d5b4d
7
- data.tar.gz: e6f3d5e7d4b31c059a835c4d52c9e73a5f83222f8cdbaa83d8203164cef576b2dc9a47f1f9c965e8e5f266ca2fe1585f0b2a117fb7837879a311669692bf0e10
6
+ metadata.gz: 877f1dc5b92237f4e3064652917643a0360857bf449c818717ece811b7c94ae025a5a62798eb48391b90f48cf17510184c992d142350469fe2dcad6e643b073c
7
+ data.tar.gz: eadaa9244ba181f48aa50d28db84145b5eeba71c6c4ddbe028d3cca38c6ab998b853a107b93a71975d10ca78b6d490599839de38cf6b1a9d93d4dac8cb158b94
data/data/VERSION CHANGED
@@ -1 +1 @@
1
- RuneBlog v 0.0.61 2018-09-17
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
- yn = ask red(ques)
178
- if yn.downcase == "y"
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
- yn = yesno(red(" No .blog found. Create new blog? "))
300
- RuneBlog.create_new_blog if yn
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.61"
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 =~ /computing/m, "Expecting 'computing' as default; got: #{out.inspect}"
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 >= 15, "Expecting more lines; got: #{out.inspect}"
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 >= 20, "Expecting more lines; got: #{out.inspect}"
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.61
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-17 00:00:00.000000000 Z
11
+ date: 2018-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext