language: node_js
node_js:
  - 0.12
  - 4
  - 5

before_install:
# We need this line to have g++4.8 available in apt
  - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
  - sudo apt-get update -qq
  - sudo apt-get install -qq gcc-4.8 g++-4.8
# We want to compile with g++ 4.8 when rather than the default g++
  - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90

before_script:
  - npm install --dev

script:
  - npm test

os:
  - linux
  - osx
sudo: false
language: cpp
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - g++-4.8
env:
  matrix:
    - TRAVIS_NODE_VERSION="0.12"
    - TRAVIS_NODE_VERSION="4"
    - TRAVIS_NODE_VERSION="5"
cache:
  directories:
    - node_modules
install:
  - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
  - node --version
  - if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
  - $CXX --version
  - npm install
script:
  - npm test

Test Travis CI on OS X and Linux for multiple node versions on Docker.
Test Travis CI on OS X and Linux for multiple node versions on Docker.
