Skip to content

Commit

Permalink
Activate related Ruby version to install Bundler
Browse files Browse the repository at this point in the history
Without this change, the Bundler installation introduced by rvm#40 and rvm#41
fails when the `rvm_rubies` list contains valid RVM aliases, like
following examples:

 - ruby-1.9.3 (→ ruby-1.9.3-p551)
 - ruby-2.0   (→ ruby-2.0.0-p643)
 - 2.1        (→ ruby-2.1.5)
 - ruby       (→ ruby-2.2.0)
 - jruby      (→ jruby-1.7.18)
 - etc.

Add more test coverage to `.travis.yml`.
  • Loading branch information
gildegoma committed Jun 30, 2015
1 parent 26bf7f9 commit 3ac1c63
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ script:
| grep -q 'ruby-2.1.0'
&& (echo 'Multiple rubies test: pass' && exit 0)
|| (echo 'Multiple rubies test: fail' && exit 1)
- >
~/.rvm/gems/ruby-2.1.2@global/bin/bundle -v
| grep -q 'Bundler version'
&& (echo 'Bundler setup test: pass' && exit 0)
|| (echo 'Bundler setup test: fail' && exit 1)
- >
ansible-playbook $SITE_AND_INVENTORY --connection=local --extra-vars='rvm1_delete_ruby=ruby-2.1.0'
| grep -q 'ok=1.*failed=0'
Expand Down
4 changes: 1 addition & 3 deletions tasks/rubies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
rvm1_default_ruby_version not in detect_default_ruby_version.stdout

- name: Install bundler if not installed
shell: >
{{ rvm1_install_path }}/wrappers/{{ item }}/gem list
| if ! grep "^bundler " ; then {{ rvm1_install_path }}/wrappers/{{ item }}/gem install bundler ; fi
shell: bash -lc 'cd; rvm use {{ item }}; gem list | if ! grep "^bundler " ; then gem install bundler ; fi'
args:
creates: '{{ rvm1_install_path }}/wrappers/{{ item }}/bundler'
with_items: rvm1_rubies
Expand Down
2 changes: 1 addition & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
vars:
rvm1_rubies:
- 'ruby-2.1.0'
- 'ruby-2.1.2'
- '2.1.2'
rvm1_install_path: '/home/travis/.rvm'
rvm1_install_flags: '--auto-dotfiles --user-install'

Expand Down

0 comments on commit 3ac1c63

Please sign in to comment.