Sha256: 01c1314362c718780755bfb8a0fd18ebbcc8a7e46d246f3259bf2d2a40e2a659
Contents?: true
Size: 1.9 KB
Versions: 2
Compression:
Stored size: 1.9 KB
Contents
#!/usr/bin/env ruby # Requirements # ======================================================================= # Stdlib # ----------------------------------------------------------------------- # Deps # ----------------------------------------------------------------------- # Project / Package # ----------------------------------------------------------------------- require 'pathname' require 'pp' require 'yaml' require 'json' require 'fileutils' require 'thread' require 'nrser' require 'cmds' require 'qb' # QB::IPC.is_master_process! # Refinements # ======================================================================= using NRSER # Definitions # ======================================================================= def main *args Thread.current.name = 'main' logger = NRSER::Log['qb/exe/qb#main'] QB::CLI.set_debug! args NRSER::Log.setup_for_cli! application: 'qb' logger.debug args: args QB.check_ansible_version logger.debug "Main switch arg" => args[0] method_name, method_args = case args[0] when nil, '-h', '--help', 'help' [:help, []] when 'play' [:play, args.rest] when 'run' [:run, args.rest] when 'setup' [:setup, args.rest] when 'list', 'ls' [:list, *args.rest] when '.dev' [:dev, *args.rest] when 'root' puts QB::ROOT.to_s exit true when 'version' puts QB::VERSION exit true else # default to `run` on the full args [:run, args] end logger.debug "Calling QB::CLI.#{ method_name }", method_args: method_args status = begin QB::CLI.public_send method_name, method_args rescue Exception => error raise error end logger.debug "QB::CLI.#{ method_name } returned, exiting.", status: status exit status end # Execution # ============================================================================ main( *ARGV ) # if __FILE__ == $0 # doesn't work with gem stub or something?
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
qb-0.4.5 | exe/qb |
qb-0.4.4 | exe/qb |