lib/headdesk.rb in headdesk-0.10.0 vs lib/headdesk.rb in headdesk-0.11.0
- old
+ new
@@ -20,6 +20,22 @@
#
# Error in CLI input
#
class CliError < StandardError
end
+
+ #
+ # Helper for CLI command modules
+ #
+ module CliCommand
+ extend Enumerable
+
+ def self.each(&block)
+ @commands.each(&block)
+ end
+
+ def self.included(cmd)
+ @commands ||= []
+ @commands << cmd
+ end
+ end
end