Isolate CLI required resources #84

merged 1 commit into from Nov 17, 2013


None yet

2 participants

mhupman commented Nov 13, 2013

This change allows for programmatic usage of cupertino without including Term and Commander. The Commander include was particularly tricky for programmatic usage as it requires that you set :version, :description, and automatically adds an at_exit {} block. Previous to this change, my code that used cupertino looked like this:

# Required by Cupertino
require 'term/ansicolor'

# Required by Cupertino
require 'commander/import'
program :version, '1.0.0' # Required by Commander
program :description, '.' # Required by Commander
# Suppress Commander's at_exit block that will always throw an error since this isn't a real Commander program
at_exit { exit! }

require 'cupertino/provisioning_portal'

@mattt mattt merged commit b9ce097 into nomad:master Nov 17, 2013
mattt commented Nov 17, 2013

Ah, thanks for this, @mhupman! It was always my intention to allow Cupertino to be incorporated as a regular Ruby gem, but I guess I never went so far as to kick the tires myself. Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment