Sha256: f577135450217b39ec5ddde768643b373b67d93262adafdb89636ec98794a052

Contents?: true

Size: 1002 Bytes

Versions: 5

Compression:

Stored size: 1002 Bytes

Contents

require "require_all"
require "thor"

module Screengem
  class CLI < Thor
    option :root, desc: "The directory to start scanning for Tasks and Questions"
    option :config, default: "dampen_configuration.yml", desc: "The name of the dampen configuration file"
    option :quiet, default: false, desc: "Suppress command output"
    desc "generate", "Create the sample dampening configuration"
    def generate
      root = options[:root]

      # Require all questions and tasks for inclusion in the sample configuration.
      require_all root

      Screengem.configure do |config|
        config.dampen_configuration_filename = File.join(root, options[:config])
      end

      sample_filename = Screengem.configuration.dampen_configuration_sample_filename

      puts "Regenerating #{sample_filename} ..." unless options[:quiet]

      sample_configuration = Screengem::DampenConfigurationGenerator.new.generate

      File.write(sample_filename, sample_configuration.to_yaml)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
screengem-0.6.0 lib/screengem/cli.rb
screengem-0.5.0 lib/screengem/cli.rb
screengem-0.4.0 lib/screengem/cli.rb
screengem-0.3.0 lib/screengem/cli.rb
screengem-0.2.0 lib/screengem/cli.rb