Last active
November 21, 2015 21:23
-
-
Save sondr3/c4739d6e17a6efdea4ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bin/test.rb | |
opts.on('--new:thing [NAME]', 'create a new thing') do |name| | |
if name.nil? | |
puts "you need to name your thing" | |
exit 0 | |
end | |
options[:name] = name | |
puts "#{name}" | |
Test::CLI::New::Thing.new | |
end | |
# lib/test/cli.rb | |
module Test | |
module CLI | |
module New | |
class Thing | |
def initialize(name) | |
@name = name | |
puts "it's a thing: #{name}'" | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment