Sha256: e61b32888bb9ba08b5012e65865ce77632cc9e2abcf0bca06bedf82b3cc7a388
Contents?: true
Size: 759 Bytes
Versions: 1
Compression:
Stored size: 759 Bytes
Contents
#!/usr/bin/env ruby $: << "./lib" require 'repl' trap("INT") { } include RuneBlog::REPL def get_argv return nil if ARGV.size == 0 cmd = ARGV[0..1].join(" ") arg = ARGV[2] [cmd, arg] end ########### STDOUT.sync = true cmd, arg = get_argv open_blog puts red("\n RuneBlog v #{RuneBlog::VERSION}") if cmd.nil? # REPL puts loop do print red("\nblog> ") cmd = gets cmd_quit([]) if cmd.nil? # ^D cmd.chomp! meth, params = RuneBlog::REPL.choose_method(cmd) send(meth, params) end else # one command raise "Not working right now" file = File.open("/dev/tty") STDIN.reopen(file) # avoid ARGF dumbness meth, params = RuneBlog::Command.choose_method(cmd) parse_cmd(ARGV.join(" ")) execute_command end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
runeblog-0.0.51 | bin/blog |