Sha256: 1cd7daf39853765cddbae84458a3630b4ff1f01c8d418da9cbce92b4ab62ccd0
Contents?: true
Size: 750 Bytes
Versions: 13
Compression:
Stored size: 750 Bytes
Contents
require "clamp" # require all the rubber commands files = Dir[File.expand_path(File.join(File.dirname(__FILE__), 'commands/*.rb'))] files.each do |f| require f end module Rubber class CLI < Clamp::Command # setup clamp subcommands for each rubber command Rubber::Commands.constants.each do |c| clazz = Rubber::Commands.const_get(c) if clazz.class == Class && clazz.ancestors.include?(Clamp::Command) && clazz.respond_to?(:subcommand_name) && clazz.respond_to?(:subcommand_description) subcommand clazz.subcommand_name, clazz.subcommand_description, clazz end end option ["-v", "--version"], :flag, "print version" do puts Rubber.version exit 0 end end end
Version data entries
13 entries across 13 versions & 1 rubygems