runeblog 0.1.46 → 0.1.47
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blog +9 -1
- data/lib/helpers-blog.rb +6 -0
- data/lib/runeblog_version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2965862bce8afd6ea12e340f098af1392bb90eed94d0df93b47d80ab737401ae
|
4
|
+
data.tar.gz: f88038430c43d5cbe0cab38965869d575d4e22e89a0a1877653c976d4c911b30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a20c5d7bb9566791f8eadd7830b0cb015e7d17424ed6169dfc24d5eacc1f0354bc95149b92bb323dc5ec73ff1d2153224d82b932db5b43558a08273a1e1d8a9b
|
7
|
+
data.tar.gz: e29d0e4c4040da7ef7190c973a0ed1b7b6e8317b95703a51fec3503e3cc2454014a5a9e801627611d79efc6b93a34605683766a0c73010b1861e749491c302b7
|
data/bin/blog
CHANGED
@@ -27,7 +27,15 @@ major, minor = RUBY_VERSION.split(".").values_at(0,1)
|
|
27
27
|
ver = major.to_i*10 + minor.to_i
|
28
28
|
abort "Need Ruby 2.4 or greater" unless ver >= 24
|
29
29
|
|
30
|
-
|
30
|
+
include RuneBlog::Helpers # for try_read_config
|
31
|
+
|
32
|
+
# read a .rubytext file here??
|
33
|
+
home = ENV['HOME']
|
34
|
+
@fg, @bg = try_read_config("#{home}/.rubytext", fg: Blue, bg: White)
|
35
|
+
@fg = @fg.downcase.to_sym
|
36
|
+
@bg = @bg.downcase.to_sym
|
37
|
+
|
38
|
+
RubyText.start(:_echo, :keypad, scroll: true, log: "blogcmd.txt", fg: @fg, bg: @bg)
|
31
39
|
|
32
40
|
if ! RuneBlog.exist?
|
33
41
|
print "No blog found. Create new one? (y/n) "
|
data/lib/helpers-blog.rb
CHANGED
@@ -27,6 +27,12 @@ module RuneBlog::Helpers
|
|
27
27
|
exit
|
28
28
|
end
|
29
29
|
|
30
|
+
def try_read_config(file, hash)
|
31
|
+
return hash.values unless File.exist?(file)
|
32
|
+
vals = read_config(file, *hash.keys)
|
33
|
+
vals
|
34
|
+
end
|
35
|
+
|
30
36
|
def write_config(obj, file)
|
31
37
|
hash = obj.to_h
|
32
38
|
File.open(file, "w") do |f|
|
data/lib/runeblog_version.rb
CHANGED