lib/napkin/cli.rb in napkin-0.0.4 vs lib/napkin/cli.rb in napkin-0.0.5
- old
+ new
@@ -1,32 +1,20 @@
# encoding: utf-8
-require 'fileutils'
require 'thor'
+require_relative './cli/github'
+require_relative './cli/jenkins'
+require_relative './cli/tools'
+
module Napkin
class CLI < Thor
- include Thor::Actions
+ desc 'github', 'query github api'
+ subcommand 'github', Github
- def self.source_root
- File.join(File.dirname(__FILE__), 'files')
- end
+ desc 'jenkins', 'manage a jenkins instance'
+ subcommand 'jenkins', Jenkins
- desc 'setup TOOL', 'set up TOOL'
- method_option :bootstrap_file, :aliases => '-b', :desc => 'Bootstrap template for veronic/chef'
- def setup(tool)
- puts "Setting up #{tool}!"
-
- case tool
- when 'veronic'
- bootstrap_file = options[:bootstrap_file] || '/etc/veronic/bootstrap/lifted-chef.erb'
-
- FileUtils.mkdir_p(File.dirname(bootstrap_file))
- copy_file(File.basename(bootstrap_file), bootstrap_file, :force => true)
- else
- puts "#{tool} is not a recognized tool!"
- exit 1
- end
- end
-
+ desc 'tools', 'install and configure tools for builds'
+ subcommand 'tools', Tools
end
end