Sha256: 487b3436a6e2b770e76aa9ce0e23e0f4b29bf51f476801e84d2bdd14af962f6c

Contents?: true

Size: 829 Bytes

Versions: 3

Compression:

Stored size: 829 Bytes

Contents

#!/usr/bin/env ruby

# $LOAD_PATH << "./lib"

require 'runeblog'
require 'rubytext'

require 'repl'

include RuneBlog::REPL

def mainloop
  print fx("blog> ", Red, :bold)
  cmd = STDSCR.gets(history: @cmdhist)
  cmd_quit(nil) if cmd.nil?   # ^D
  cmd.chomp!
  return if cmd.empty?   # CR does nothing
  meth, params = RuneBlog::REPL.choose_method(cmd)
  ret, str = send(meth, params)
rescue => err
  puts err
end

###

RubyText.start(:_echo, :keypad, scroll: true, log: "blogcmd.txt", fg: Blue, bg: White)

if ! RuneBlog.exist?
  print "No blog found. Create new one? (y/n) "
  resp = gets.chomp
  if resp == "y"
    RuneBlog.create_new_blog
  else
    exit
  end
end

@blog = RuneBlog.new

puts fx("\n  RuneBlog", :bold), fx(" v #{RuneBlog::VERSION}\n", Red)
@cmdhist = []
loop { mainloop }
sleep 0.2
system("tput clear")
puts

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
runeblog-0.1.27 bin/blog
runeblog-0.1.26 bin/blog
runeblog-0.1.25 bin/blog