Skip to content

Setting up your config file

kiafaldorius edited this page Sep 14, 2010 · 3 revisions

TicketMaster uses a YAML configuration file to load default settings.

Format

It’s YAML, so should look familiar to most of the ruby folk.

--- 
default: provider
provider: 
  project: 123
  authentication: 
    token: abcdef
    account: untitled

In this example, ‘provider’ is the name of the provider and authentication is the authentication credentials. All providers should have at least the authentication section defined. If your provider does not take any credentials, set authentication to an empty hash (“authentication: {}”).

~/.ticketmaster.yml

The default configuration when calling TicketMaster.new is loaded from a file in the current user’s home directory named ‘.ticketmaster.yml’. It’s location and name can be changed by setting the TICKETMASTER_CONFIG environment variable.

Use with the CLI (Command-Line Interface)

TicketMaster provides a convenient CLI interface that you can access from your terminal using the tm command. The CLI interface uses configuration files to shorten the required input parameters. By default it will search for a ‘ticketmaster.yml’ file in the current directory, then for a ‘config/ticketmaster.yml’, then the file specified in TICKETMASTER_CONFIG and lastly, it will use the user’s ‘~/.ticketmaster.yml’.

You can also set the configuration file through the —config parameter.

Creating with tm config

You can create the configuration file from the tm command like so:

tm --provider dummy --authentication user:username,pass:password config --add
tm --provider dummy config --set-default-provider

which will create or edit your ~/.ticketmaster.yml and add the credentials like so:

---
default: dummy
dummy:
  authentication:
    user: username
    pass: password

Please not that due to the way the authentication credentials are parsed, if any of the authentication information contains a comma (,) you will have to manually input it to the config.