---
- name: Create workspace directory
  file: >
    path={{ turnip_workspace }}
    state=directory
    mode=0755

- name: Create spec directory
  file: >
    path={{ turnip_workspace }}/spec
    state=directory
    mode=0755

- name: Set default-files
  copy: >
    src={{ item }}
    dest={{ turnip_workspace }}
  with_items:
    - Gemfile
    - .rspec

- name: Set spec_helper.rb
  copy: >
    src=spec_helper.rb
    dest={{ turnip_workspace }}/spec

- name: Install Bundler gem
  gem: >
    name=bundler
    executable={{ turnip_rbenv }}/shims/gem
    user_install=false

- name: Install turnip for Ruby using the Bundler gem
  command: "{{ turnip_rbenv }}/bin/rbenv exec bundler install --path vendor/bundle"
  environment:
    RBENV_ROOT: "{{ turnip_rbenv }}"
  args:
    chdir: "{{ turnip_workspace }}"
    creates: "{{ turnip_workspace }}/vendor"

- name: Set bundler path
  command: bash -lc "rbenv rehash"
  args:
    chdir: "{{ turnip_workspace }}"
    creates: /usr/local/rbenv/shims/bundle

---
- name: Create workspace directory
  file: >
    path={{ turnip_workspace }}
    state=directory
    mode=0755

- name: Create spec directory
  file: >
    path={{ turnip_workspace }}/spec
    state=directory
    mode=0755

- name: Set default-files
  copy: >
    src={{ item }}
    dest={{ turnip_workspace }}
  with_items:
    - Gemfile
    - .rspec

- name: Set spec_helper.rb
  copy: >
    src=spec_helper.rb
    dest={{ turnip_workspace }}/spec

- name: Install Bundler gem
  gem: >
    name=bundler
    executable={{ turnip_rbenv }}/shims/gem
    user_install=false

- name: Install turnip for Ruby using the Bundler gem
  command: "{{ turnip_rbenv }}/bin/rbenv exec bundle install --path vendor/bundle"
  environment:
    RBENV_ROOT: "{{ turnip_rbenv }}"
  args:
    chdir: "{{ turnip_workspace }}"
    creates: "{{ turnip_workspace }}/vendor"

- name: Set bundler path
  command: bash -lc "rbenv rehash"
  args:
    chdir: "{{ turnip_workspace }}"
    creates: /usr/local/rbenv/shims/bundle

Change command name bundler to bundle
Change command name bundler to bundle
