Puppet Class: jruby

Defined in:
manifests/init.pp

Overview

Class: jruby

JRuby instalation

Parameters

version

Jruby version

Variables

jruby_home

Destination path

url

Download url

Examples

class { 'jruby':
  version => '1.7.0.preview1'
}

Authors

Jorge Falcão <falcao@intelie.com.br>

Copyright 2012 Intelie

Parameters:

  • version (Any) (defaults to: '1.7.11')
  • prefix (Any) (defaults to: '/opt')
  • url (Any) (defaults to: 'UNSET')


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'manifests/init.pp', line 32

class jruby (
  $version = '1.7.11',
  $prefix = '/opt',
  $url = 'UNSET'
) {

  $jruby_home = "${prefix}/jruby"
  $package = "jruby-bin-${version}.tar.gz"

  if $url == 'UNSET' {
    $real_url = "http://jruby.org.s3.amazonaws.com/downloads/${version}/${package}"
  } else {
    $real_url = $url
  }

  Exec { path => '/usr/bin:/bin:/usr/local/bin/' }

  exec { 'download_jruby':
    command     => "wget -O /tmp/${package} ${real_url}",
    unless      => "test -s /tmp/${package}"
  } -> exec { 'unpack_jruby':
    command => "tar -zxf /tmp/${package} -C ${prefix}",
    creates => "${prefix}/jruby-${version}"
  }

  file { $jruby_home:
    ensure  => link,
    target  => "${jruby_home}-${version}",
    require => Exec['unpack_jruby']
  }

  Jruby_Bin{ jruby_home => "${prefix}/jruby" }

  jruby_bin{['jgem', 'jirb', 'jruby', 'jrubyc']: }
}