lib/brief/cli/01_extensions.rb in brief-1.8.11 vs lib/brief/cli/01_extensions.rb in brief-1.8.12
- old
+ new
@@ -1,4 +1,17 @@
+class Commander::Command
+ def action(*args, &block)
+ Brief.default_cli_options(self)
+
+ when_called do |args, options|
+ options.default(root: Brief.pwd)
+ Brief.case = Brief::Briefcase.new(root: Pathname(options.root))
+
+ block.call(args, options)
+ end
+ end
+end
+
module Brief
def self.cli_action(c, &block)
c.action do |args, options|
options.default(root: Brief.pwd)