Sha256: b97f792ff88ce5be2197caf352ef5d55b5df45cd2cf70d66c0e386098c53c8ab

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

require 'dry-configurable'
require 'arduino/library'
require 'yaml'

module Arli
  class Configuration

    DEFAULT_FILENAME    = 'Arlifile'.freeze
    ACTIONS_WHEN_EXISTS = %i(backup overwrite abort)
    ARLI_COMMAND        = 'arli'.freeze

    extend Dry::Configurable

    # These are populated during the parsing of the params
    setting :runtime do
      setting :argv
      setting :command do
        setting :name
        setting :instance
      end
    end

    setting :libraries do
      setting :path, ::Arduino::Library::DefaultDatabase.library_path
    end

    setting :database do
      setting :path, ::Arduino::Library::DefaultDatabase.library_index_path
      setting :url, ::Arduino::Library::DefaultDatabase.library_index_url
    end

    setting :arlifile do
      setting :path, ::Dir.pwd
      setting :name, ::Arli::Configuration::DEFAULT_FILENAME
    end

    setting :search do
      setting :default_field, :name
      setting :results do
        setting :limit, 100
        setting :format, :inspect
      end
    end

    setting :install do
      setting :library_names, []
      setting :if_exists do
        setting :overwrite, true
        setting :backup, false
        setting :abort, false
      end
    end

    setting :debug, ENV['ARLI_DEBUG'] || false
    setting :trace, false
    setting :verbose, false
    setting :help, false
    setting :quiet, false
  end
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
arli-0.7.0 lib/arli/configuration.rb
arli-0.6.2 lib/arli/configuration.rb