bin/caramelize in caramelize-1.1.1 vs bin/caramelize in caramelize-1.2.0

- old
+ new

@@ -1,6 +1,7 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require 'caramelize' require 'commander/import' # :name is optional, otherwise uses the basename of this executable @@ -18,14 +19,14 @@ c.summary = 'Create new configuration' c.description = 'Create a fresh configuration file for caramelize' c.option '--config STRING', String, 'The config file (default: caramel.rb)' c.example 'Create a fresh config file as "caramel.rb"', 'caramelize create' c.example 'Create a fresh config file as "config.rb"', 'caramelize create --config config.rb' - c.action do |args, options| - target_file ||= (options.config || 'caramel.rb') + c.action do |_args, options| + target_file || options.config || 'caramel.rb' options.default({ config: 'caramel.rb' }) - FileUtils.cp(File.dirname(__FILE__) + '/../lib/caramelize/caramel.rb', + FileUtils.cp("#{File.dirname(__FILE__)}/../lib/caramelize/#{target_file}", options.config) say "Created new configuration file: #{options.config}" end end alias_command :create, :new @@ -35,11 +36,11 @@ c.summary = 'Run wiki transfer' c.description = 'Run the wiki content transfer based on the given configuration file' c.option '--config STRING', String, 'The config file (default: caramel.rb)' c.example 'Run transfer for "caramel.rb"', 'caramelize run' c.example 'Run transfer for "config.rb"', 'caramelize run --config config.rb' - c.action do |args, options| + c.action do |_args, options| time_start = Time.now options.default({ config: 'caramel.rb', target: 'wiki-export' }) instance_eval(File.read(options.config)) @@ -61,10 +62,10 @@ c.syntax = 'caramelize doctor [options]' c.summary = 'Run wiki transfer' c.description = 'Run health-check' c.option '--target STRING', String, 'The target path to Gollum git repository (default: wiki-export)' c.example 'Run transfer for "caramel.rb"', 'caramelize doctor' - c.action do |args, options| + c.action do |_args, options| options.default(target: 'wiki-export') if File.exist?(options.target) Caramelize::HealthCheck.new(options.target).execute else