---
- name: Add Ruby ppa
  apt_repository: repo="ppa:brightbox/ruby-ng" update_cache=yes

- name: Install Rubies + Dependencies
  apt: name="{{ item }}" state=present force=yes
  with_items:
    - ruby2.2
    - ruby2.2-dev
    # For compiling ruby gems
    - libreadline6
    - libxslt-dev
    - libxml2-dev
    - zlib1g-dev
    - autoconf
    - libc6-dev
    - automake
    - libtool

- name: Correct ruby version selected
  shell: update-alternatives --set ruby /usr/bin/ruby2.2
  # This is disabled because atlas.hashicorp has problems with alternatives module
  # alternatives: name=ruby path=/usr/bin/ruby2.2

- name: Install Gems
  gem: name="{{ item }}" state=present user_install=no include_dependencies=yes
  with_items:
    - bundler
    # Compile Sass
    - compass
    - rmate
    # Testing
    - rspec
    - rspec-retry
    - poltergeist
    - capybara

- name: Install compass bash completion
  command: curl -L -o /usr/share/bash-completion/completions/compass https://raw.githubusercontent.com/piouPiouM/compass-completion/master/compass-completion.sh

---
- name: Add Ruby ppa
  apt_repository: repo="ppa:brightbox/ruby-ng" update_cache=yes

- name: Install Rubies + Dependencies
  apt: name="{{ item }}" state=present force=yes
  with_items:
    - ruby2.2
    - ruby2.2-dev
    # For compiling ruby gems
    - libreadline6
    - libxslt-dev
    - libxml2-dev
    - zlib1g-dev
    - autoconf
    - libc6-dev
    - automake
    - libtool

- name: Correct ruby version selected
  shell: update-alternatives --set ruby /usr/bin/ruby2.2
  # This is disabled because atlas.hashicorp has problems with alternatives module
  # alternatives: name=ruby path=/usr/bin/ruby2.2

- name: Install Gems
  gem: name="{{ item }}" state=present user_install=no include_dependencies=yes
  with_items:
    - bundler
    # Compile Sass
    - compass
    - rmate
    # Testing
    - rspec
    - rspec-retry
    - poltergeist
    - capybara
    - capybara-screenshot

- name: Install compass bash completion
  command: curl -L -o /usr/share/bash-completion/completions/compass https://raw.githubusercontent.com/piouPiouM/compass-completion/master/compass-completion.sh

Add capybara-screenshot for wp-test automatic screenshots
Add capybara-screenshot for wp-test automatic screenshots
