runeblog 0.1.11 → 0.1.12

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
  SHA256:
3
- metadata.gz: c8624c0cbf8355cc824d03ff97e2b60cd04e871bde7394731535e32504aa05ee
4
- data.tar.gz: 0f5323f78c46f801000269eff914eb024d2f8539b44531822d779c1549581f95
3
+ metadata.gz: 948afa31335a283c1ff1cdc27a5f8ef6793efa6f901e074d8ec18152acd013d3
4
+ data.tar.gz: ad5f2733c771e431db6a949c087826f7fb90610b6185bafd13ff9f5e7d3b254f
5
5
  SHA512:
6
- metadata.gz: 5cae9b867b30214856bb457b9cfc7d434691dc24aaeda63505d96c2377251e2280f28638dbd33360c762b41eb9d9ab8f6997170b9cea8db5921e8580e46347a9
7
- data.tar.gz: 824f8c428bed47e17bd373f63c4a69644d80d13277083a738ec635bf7ace2b836d7d96beac1b6119e46c0a70e27d929a5c4e197699687f603794c5beab048c58
6
+ metadata.gz: 703583991e0b5b11f3b0287cc4a547777e86f7a60d9ed391e1e4817ed890e837173a6b79bf400b1dd5a935f6c4897f9e33d59057be26046a62902e0af6304992
7
+ data.tar.gz: c34abd037caaf49f0d0482093e27d0f87eea10d0e292876d6523cbaff2374d144dd5479caf0a31492d6592e2df3c5c3d6ac646a839ccc694ffee9e7d1bb51f0a
data/lib/global.rb CHANGED
@@ -17,10 +17,6 @@ class RuneBlog
17
17
  end
18
18
  end
19
19
 
20
- def curses?
21
- true
22
- end
23
-
24
20
  def make_exception(sym, str)
25
21
  return if Object.constants.include?(sym)
26
22
  Object.const_set(sym, StandardError.dup)
data/lib/helpers-repl.rb CHANGED
@@ -59,7 +59,7 @@ end
59
59
 
60
60
 
61
61
  module RuneBlog::REPL
62
- include curses? ? NoANSI : WithANSI
62
+ include NoANSI
63
63
 
64
64
  Patterns =
65
65
  {"help" => :cmd_help,
data/lib/repl.rb CHANGED
@@ -119,15 +119,16 @@ module RuneBlog::REPL
119
119
  nil
120
120
  end
121
121
 
122
- def cmd_change_view(arg)
122
+ def cmd_change_view(arg, testing = false)
123
123
  reset_output
124
124
  # Simplify this
125
125
  if arg.nil?
126
126
  viewnames = @blog.views.map {|x| x.name }
127
127
  n = viewnames.find_index(@blog.view.name)
128
- k, name = STDSCR.menu(title: "Views", items: viewnames, curr: n)
128
+ name = @blog.view.name
129
+ k, name = STDSCR.menu(title: "Views", items: viewnames, curr: n) unless testing
129
130
  @blog.view = name
130
- output bold(@blog.view)
131
+ output name + "\n"
131
132
  puts "\n ", fx(name, :bold), "\n"
132
133
  return [false, @out]
133
134
  else
@@ -208,6 +209,7 @@ module RuneBlog::REPL
208
209
  v = v.to_s
209
210
  v = fx(v, :bold) if v == @blog.view.name
210
211
  print " "
212
+ output v + "\n"
211
213
  puts v
212
214
  end
213
215
  puts
data/lib/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.11"
3
+ VERSION = "0.1.12"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
data/lib/view.rb CHANGED
@@ -38,7 +38,7 @@ debug "Looking in #{vdir}"
38
38
  others = Dir.entries(vdir).grep(/^\d\d\d\d/)
39
39
  files += others.map {|x| "#{vdir}/#{x}" }
40
40
  debug "Found #{files.inspect}"
41
- # files.reject! {|f| recent?(f) } if recent
41
+ files.reject! {|f| ! recent?(f) } if recent
42
42
  debug "Now files = #{files.inspect}"
43
43
  files
44
44
  end
@@ -59,7 +59,9 @@ debug "Now files = #{files.inspect}"
59
59
  end
60
60
 
61
61
  def recent?(file)
62
- File.mtime(file) < File.mtime("#{dir()}/last_published")
62
+ File.mtime(file) > File.mtime("#{dir()}/last_published")
63
+ rescue
64
+ true
63
65
  end
64
66
 
65
67
  end
data/test/general.rb CHANGED
@@ -5,6 +5,8 @@ require "minitest/autorun"
5
5
  require 'lib/repl'
6
6
  require 'rubytext'
7
7
 
8
+ RubyText.start
9
+
8
10
  class TestREPL < Minitest::Test
9
11
  include RuneBlog::REPL
10
12
 
@@ -18,6 +20,7 @@ class TestREPL < Minitest::Test
18
20
  def setup
19
21
  # To be strictly correct in testing (though slower),
20
22
  # run make_blog here.
23
+ system("ruby test/make_blog.rb") if ARGV.first == "new"
21
24
  @blog = RuneBlog.new
22
25
  end
23
26
 
@@ -42,11 +45,12 @@ class TestREPL < Minitest::Test
42
45
  flag, out = cmd_list_views(nil)
43
46
  assert out.is_a?(String), "Expected a string returned"
44
47
  lines = out.split("\n").length
48
+ p out
45
49
  assert lines >= 2, "Expecting at least 2 lines"
46
50
  end
47
51
 
48
52
  def test_004_change_view!
49
- flag, out = cmd_change_view(nil) # no param
53
+ flag, out = cmd_change_view(nil, true) # no param, but testing
50
54
  assert out.is_a?(String), "Expected a string; got: #{out.inspect}"
51
55
  assert out =~ /alpha_view/m, "Expecting 'alpha_view' as default; got: #{out.inspect}"
52
56
  end
data/test/make_blog.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  $LOAD_PATH << "."
2
2
 
3
- require 'lib/repl'
3
+ require 'global'
4
+ require 'rubytext'
5
+ require 'repl'
4
6
 
5
7
  def make_post(x, title)
6
8
  meta = OpenStruct.new
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.1.11
4
+ version: 0.1.12
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-12-20 00:00:00.000000000 Z
11
+ date: 2018-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext