Sha256: 442dfe6c3efae1293cf44234dbdff8c2abfe0209be9fa0176c13b35e5c0df669
Contents?: true
Size: 794 Bytes
Versions: 4
Compression:
Stored size: 794 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) str = send(meth, params) puts str unless str.nil? 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
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
runeblog-0.0.57 | bin/blog |
runeblog-0.0.56 | bin/blog |
runeblog-0.0.55 | bin/blog |
runeblog-0.0.52 | bin/blog |