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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af8f6620a9c3d0d1acba409a8908f65dcd414712
4
- data.tar.gz: d89fc05cafeeb9d02579653c285ea1902e06932e
3
+ metadata.gz: d38a4c8ca29b37f67bbb33b0c054b38cbcac189c
4
+ data.tar.gz: 62a83e3273d7610bab0ce6d9eb68adabc8548cc4
5
5
  SHA512:
6
- metadata.gz: e7010d57e300a36f1b510e9a8053f1f87bcfb56f4ab0b7f1bb543194aaa96245d69aaeca7213bbd9b5e35813e63aa87e954681e6f92e7fd54e038fa7c0324d95
7
- data.tar.gz: 89f22f576bef984548377524e7feb203e386a6d39fad5f7c8923e5335864d5f67f1e35f2c205378261d39ffa2851c17c230eb461bcb14325a654021a0f4367d3
6
+ metadata.gz: e826a4c5b2fb3bf48d3c035feb681cf0766d5af304723b39610f6bb211029876655982f3395a3a773c37e3096605b8f0a84a3852291b294531c9a89bab70b372
7
+ data.tar.gz: c3365f3c0442111acdc882620d020de4d0f8fc2e22f2b4193951a0425cc797969fa44352008df8d38958377d62ef20a7021819c4c9fc0bf535446e8fa6a3cf10
data/bin/blog CHANGED
@@ -23,7 +23,7 @@ cmd, arg = get_argv
23
23
 
24
24
  @blog = RuneBlog.new
25
25
 
26
- puts red("\n RuneBlog v #{RuneBlog::VERSION}")
26
+ print red("\n RuneBlog v #{RuneBlog::VERSION}")
27
27
 
28
28
  if cmd.nil? # REPL
29
29
  puts
data/data/VERSION CHANGED
@@ -1 +1 @@
1
- RuneBlog v 0.0.71 2018-10-01
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}\n"
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
- depl = get_deployment_info
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("Title: ")
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 + ":\n"
250
+ output bold(@blog.view.name) + ":"
252
251
  if posts.empty?
253
- output! "No posts\n"
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
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.0.71"
3
+ VERSION = "0.0.72"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
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 =~ /view1/m, "Expecting 'view1' as default; got: #{out.inspect}"
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 view2" => [:cmd_change_view, "view2"],
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 == "view1", "Current view seems wrong (#{@blog.view}, not view1)"
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("view2")
111
- assert @blog.view.to_s == "view2", "Current view seems wrong (#{@blog.view}, not view2)"
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 == ["view1", "view2"], "Got: #{sorted_views.inspect}"
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", "view1", "view2"], "After create: #{sorted_views.inspect}"
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 == ["view1", "view2"], "After delete: #{sorted_views.inspect}"
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("view2")
130
- assert @blog.view.to_s == "view2", "Expected view2"
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.71
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-01 00:00:00.000000000 Z
11
+ date: 2018-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext