Sha256: ad580757262be6dd00e4a2e3f55b64c1a4c5bda55eca6b66b5cf893cb7736a6d

Contents?: true

Size: 805 Bytes

Versions: 27

Compression:

Stored size: 805 Bytes

Contents

# Parses the configuration information and puts it into options
def parse_config!(options)
  config = YAML.load_file File.expand_path(options[:config])
  provider = (options[:provider] ||= config['default'] || config.keys.first)
  if provider and provider.length > 0
    options[:project] ||= config[provider]['project']
    options[:authentication] ||= config[provider]['authentication']
  end
  options
end

# A utility method used to separate name:value pairs
def attributes_hash(kvlist)
  require 'enumerator' if RUBY_VERSION < "1.8.7"
  if kvlist.is_a?(String)
    kvlist.split(',').inject({}) do |mem, kv|
      key, value = kv.split(':')
      mem[key] = value
      mem
    end
  elsif kvlist.is_a?(Array)
    mem = {}
    kvlist.each_slice(2) do |k, v|
      mem[k] = v
    end
    mem
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
taskmapper-0.8.1 lib/taskmapper/cli/common.rb
taskmapper-0.8.0 lib/taskmapper/cli/common.rb
ticketmaster-0.7.0 lib/ticketmaster/cli/common.rb
ticketmaster-0.6.10 lib/ticketmaster/cli/common.rb
ticketmaster-0.6.9 lib/ticketmaster/cli/common.rb
ticketmaster-0.6.8 lib/ticketmaster/cli/common.rb
ticketmaster-0.6.7 lib/ticketmaster/cli/common.rb
ticketmaster-0.6.6 lib/ticketmaster/cli/common.rb
ticketmaster-0.5.6 lib/ticketmaster/cli/common.rb
ticketmaster-0.5.5 lib/ticketmaster/cli/common.rb
ticketmaster-0.5.3 lib/ticketmaster/cli/common.rb
ticketmaster-0.5.2 lib/ticketmaster/cli/common.rb
ticketmaster-0.5.1 lib/ticketmaster/cli/common.rb
ticketmaster-0.5.0 lib/ticketmaster/cli/common.rb
ticketmaster-0.4.9 lib/ticketmaster/cli/common.rb
ticketmaster-0.4.8 lib/ticketmaster/cli/common.rb
ticketmaster-0.4.7 lib/ticketmaster/cli/common.rb
ticketmaster-0.4.6 lib/ticketmaster/cli/common.rb
ticketmaster-0.4.5 lib/ticketmaster/cli/common.rb
ticketmaster-0.4.3 lib/ticketmaster/cli/common.rb