Sha256: 1344d61065844529245048aee85d1ff85c07fa7077f8a6e197e0feb38268f6be

Contents?: true

Size: 826 Bytes

Versions: 7

Compression:

Stored size: 826 Bytes

Contents

Gemirro::CLI.options.command 'index' do
  banner 'Usage: gemirro index [OPTIONS]'
  description 'Retrieve specs list from source.'
  separator "\nOptions:\n"

  on :c=, :config=, 'Path to the configuration file'
  on :l=, :log_level=, 'Set logger level'
  on :u, :update, 'Update only'

  run do |opts, _args|
    Gemirro::CLI.load_configuration(opts[:c])
    config = Gemirro.configuration
    config.logger_level = opts[:l] if opts[:l]

    unless File.directory?(config.destination)
      config.logger.error("The directory #{config.destination} does not exist")
      abort
    end

    indexer    = Gemirro::Indexer.new(config.destination)
    indexer.ui = Gem::SilentUI.new

    config.logger.info('Generating indexes')
    indexer.generate_index if opts[:u].nil?
    indexer.update_index unless opts[:u].nil?
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gemirro-1.2.0 lib/gemirro/cli/index.rb
gemirro-1.1.1 lib/gemirro/cli/index.rb
gemirro-1.1.0 lib/gemirro/cli/index.rb
gemirro-1.0.0 lib/gemirro/cli/index.rb
gemirro-0.16.0 lib/gemirro/cli/index.rb
gemirro-0.15.0 lib/gemirro/cli/index.rb
gemirro-0.14.0 lib/gemirro/cli/index.rb