diff --git a/manifests/jruby.pp b/manifests/jruby.pp new file mode 100644 index 0000000..3dd018f --- /dev/null +++ b/manifests/jruby.pp @@ -0,0 +1,15 @@ +# Installs jruby 1.7.6 from rbenv and symlinks it as jruby. +# +# Usage: +# +# include ruby::jruby +class ruby::jruby { + require ruby + require ruby::jruby_1_7_6 + + file { "${ruby::rbenv_root}/versions/jruby": + ensure => symlink, + force => true, + target => "${ruby::rbenv_root}/versions/jruby-1.7.6" + } +} diff --git a/manifests/jruby_1_7_6.pp b/manifests/jruby_1_7_6.pp new file mode 100644 index 0000000..f211618 --- /dev/null +++ b/manifests/jruby_1_7_6.pp @@ -0,0 +1,10 @@ +# Installs jruby 1.7.6 from rbenv. +# +# Usage: +# +# include ruby::jruby_1_7_6 +class ruby::jruby_1_7_6 { + require java + + ruby::version { 'jruby-1.7.6': } +} diff --git a/spec/classes/ruby_jruby_1_7_6_spec.rb b/spec/classes/ruby_jruby_1_7_6_spec.rb new file mode 100644 index 0000000..8ba0ba6 --- /dev/null +++ b/spec/classes/ruby_jruby_1_7_6_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +describe 'ruby::jruby_1_7_6' do + let(:facts) do + { + :boxen_home => '/opt/boxen', + } + end + + it do + should contain_ruby__version('jruby-1.7.6') + end +end diff --git a/spec/classes/ruby_jruby_spec.rb b/spec/classes/ruby_jruby_spec.rb new file mode 100644 index 0000000..cb794e1 --- /dev/null +++ b/spec/classes/ruby_jruby_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe 'ruby::jruby' do + let(:facts) { default_test_facts } + + it do + should include_class('ruby::jruby_1_7_6') + + should contain_file('/test/boxen/rbenv/versions/jruby').with({ + :ensure => 'symlink', + :force => true, + :target => '/test/boxen/rbenv/versions/jruby-1.7.6' + }) + end +end diff --git a/spec/fixtures/Puppetfile b/spec/fixtures/Puppetfile index 197807e..2882eaf 100644 --- a/spec/fixtures/Puppetfile +++ b/spec/fixtures/Puppetfile @@ -6,3 +6,4 @@ mod "stdlib", "4.0.0", :github_tarball => "puppetlabs/puppetlabs-stdlib" mod "xquartz", "1.1.0", :github_tarball => "boxen/puppet-xquartz" mod "autoconf", "1.0.0", :github_tarball => "boxen/puppet-autoconf" mod "openssl", "1.0.0", :github_tarball => "boxen/puppet-openssl" +mod "java", "1.2.0", :github_tarball => "boxen/puppet-java" diff --git a/spec/fixtures/Puppetfile.lock b/spec/fixtures/Puppetfile.lock index ec407cd..a0444fb 100644 --- a/spec/fixtures/Puppetfile.lock +++ b/spec/fixtures/Puppetfile.lock @@ -18,6 +18,11 @@ GITHUBTARBALL specs: homebrew (1.1.2) +GITHUBTARBALL + remote: boxen/puppet-java + specs: + java (1.2.0) + GITHUBTARBALL remote: boxen/puppet-openssl specs: @@ -43,6 +48,7 @@ DEPENDENCIES boxen (= 3.1.0) gcc (= 1.0.0) homebrew (= 1.1.2) + java (= 1.2.0) openssl (= 1.0.0) repository (= 2.2.0) stdlib (= 4.0.0)