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 +4 -4
- data/lib/global.rb +0 -4
- data/lib/helpers-repl.rb +1 -1
- data/lib/repl.rb +5 -3
- data/lib/version.rb +1 -1
- data/lib/view.rb +4 -2
- data/test/general.rb +5 -1
- data/test/make_blog.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 948afa31335a283c1ff1cdc27a5f8ef6793efa6f901e074d8ec18152acd013d3
|
4
|
+
data.tar.gz: ad5f2733c771e431db6a949c087826f7fb90610b6185bafd13ff9f5e7d3b254f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 703583991e0b5b11f3b0287cc4a547777e86f7a60d9ed391e1e4817ed890e837173a6b79bf400b1dd5a935f6c4897f9e33d59057be26046a62902e0af6304992
|
7
|
+
data.tar.gz: c34abd037caaf49f0d0482093e27d0f87eea10d0e292876d6523cbaff2374d144dd5479caf0a31492d6592e2df3c5c3d6ac646a839ccc694ffee9e7d1bb51f0a
|
data/lib/global.rb
CHANGED
data/lib/helpers-repl.rb
CHANGED
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
|
-
|
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
|
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
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
|
-
|
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)
|
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
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.
|
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-
|
11
|
+
date: 2018-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|