lib/pennyworth/cli.rb in pennyworth-5.0.0 vs lib/pennyworth/cli.rb in pennyworth-6.0.0

- old
+ new

@@ -19,11 +19,11 @@ def self.source_root File.expand_path File.join(File.dirname(__FILE__), "templates") end def self.configuration - Runcom::Configuration.new file_name: Identity.file_name + Runcom::Configuration.new project_name: Identity.name end def initialize args = [], options = {}, config = {} super args, options, config end @@ -103,24 +103,25 @@ end say end - desc "-c, [--config]", %(Manage gem configuration ("#{configuration.computed_path}").) + desc "-c, [--config]", "Manage gem configuration." map %w[-c --config] => :config method_option :edit, aliases: "-e", desc: "Edit gem configuration.", type: :boolean, default: false method_option :info, aliases: "-i", desc: "Print gem configuration.", type: :boolean, default: false def config - path = self.class.configuration.computed_path + path = self.class.configuration.path if options.edit? then `#{editor} #{path}` - elsif options.info? then say(path) + elsif options.info? + path ? say(path) : say("Configuration doesn't exist.") else help(:config) end end desc "-v, [--version]", "Show gem version."