Method: RC::Configuration#config

Defined in:
lib/rc/configuration.rb

#config(target, options = {}, &block) ⇒ Object

Configure a commandline tool or feature.

Examples:

profile :coverage do
  config :qed, :from=>'qed'
end

Parameters:

  • target (Symbol)

    The name of the command or feature to configure.

  • opts (Hash)

    Configuration options.



199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/rc/configuration.rb', line 199

def config(target, options={}, &block)
  #options[:profile] = (options[:profile] || 'default').to_s
  #options[:command] = command.to_s unless options.key?(:command)
  #options[:feature] = command.to_s unless options.key?(:feature)
  #command = options[:command].to_s

  # IDEA: other import options such as local file?

  configs_from(options).each do |c|
    @_config[target.to_s] << c.copy(options)
  end

  return unless block

  @_config[target.to_s] << Config.new(target, options, &block)
end