Skip to content
This repository has been archived by the owner on Aug 6, 2018. It is now read-only.
Burgestrand edited this page Feb 24, 2012 · 31 revisions

How to run the examples

Hallons’ examples are actual examples that connect to Spotify. My goal with them is to provide, well, examples of how the API should be used. To run them, you’ll need:

These credentials are expected to be stored in environment variables for the examples. Personally, I set them using a configuration file inside spec/support/config.rb. The environment variables are:

  • HALLON_USERNAME (spotify username)
  • HALLON_PASSWORD (spotify password)
  • HALLON_APPKEY (path to spotify application key)

This is what my personal configuration file looks like (without my username and password ;)):

ENV['HALLON_USERNAME'] = ''
ENV['HALLON_PASSWORD'] = ''
ENV['HALLON_APPKEY']   = File.expand_path('~/.spotify_appkey.key')

The examples will try to require this file. So, to run the examples you’ll want to have the above file containing this data (or remove the require of the ./spec/support/config.rb in the examples). You then run them, from Hallons root directory, using the following command:

ruby examples/logging_in.rb