Permalink
Browse files

added Thor CLI scaffold

  • Loading branch information...
astockwell committed Apr 21, 2015
1 parent 3cb749e commit 1552fe8b166ffd3e15b07eb72f4d5e214d1d9422
Showing with 22 additions and 2 deletions.
  1. +5 −0 exe/gem_example
  2. +4 −2 gem_example.gemspec
  3. +1 −0 lib/gem_example.rb
  4. +12 −0 lib/gem_example/cli/application.rb
View
@@ -0,0 +1,5 @@
#!/usr/bin/env ruby
require 'gem_example'
GemExample::Cli::Application.start(ARGV)
View
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
spec.authors = ["Alex Stockwell"]
spec.email = ["astockwell@gmail.com"]
spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
spec.description = %q{TODO: Write a longer description or delete this line.}
spec.summary = %q{Example of CLI Gem with Bundler and Thor}
spec.description = %q{Example of CLI Gem with Bundler and Thor}
spec.homepage = "TODO: Put your gem's website or public repo URL here."
spec.license = "MIT"
@@ -27,6 +27,8 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_dependency 'thor', '~> 0.19'
spec.add_development_dependency "bundler", "~> 1.9"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 2.14"
View
@@ -1,4 +1,5 @@
require "gem_example/version"
require "gem_example/cli/application"
module GemExample
# Your code goes here...
@@ -0,0 +1,12 @@
require "thor"
module GemExample
module Cli
class Application < Thor
desc 'hello NAME', 'Display greeting with given NAME'
def hello(name)
puts "Hello #{name}"
end
end
end
end

0 comments on commit 1552fe8

Please sign in to comment.