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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12c39cc0e7de67027318b35bec295387320dc8765063676869476d7817f5aa0e
4
- data.tar.gz: 77a95730bc66eaca5767b66ca1077737b8878388fb18ba6c7eadfde6ebebf465
3
+ metadata.gz: 2965862bce8afd6ea12e340f098af1392bb90eed94d0df93b47d80ab737401ae
4
+ data.tar.gz: f88038430c43d5cbe0cab38965869d575d4e22e89a0a1877653c976d4c911b30
5
5
  SHA512:
6
- metadata.gz: f2cebaa97962729bcffc0bedcfec99f22a95ec043cd93fa4d0962376f17d101dcdfd50a5f2c425a9844bdc719e2b903397e678002682cc869150ae1ae071db3b
7
- data.tar.gz: 8ea682514616795216e2e5e72f0b20e798fd5bd8e5af33e575d860a547c8d8f8e7efa20c9c8c423c292f33bb193e3335d6e9b288ae5e77f7f5df1e099b6d844c
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
- RubyText.start(:_echo, :keypad, scroll: true, log: "blogcmd.txt", fg: Blue, bg: White)
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|
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.46"
3
+ VERSION = "0.1.47"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.46
4
+ version: 0.1.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton