source code style
authorSimon Josi <josi@puzzle.ch>
Mon, 29 Mar 2010 16:19:14 +0000 (18:19 +0200)
committerSimon Josi <josi@puzzle.ch>
Mon, 29 Mar 2010 16:19:14 +0000 (18:19 +0200)
manifests/brokengem.pp
manifests/defines.pp [deleted file]
manifests/fastercsv.pp
manifests/init.pp
manifests/mysql.pp

index 466a66b..7fd6080 100644 (file)
@@ -1,8 +1,15 @@
-define rubygems::brokengem($source,$ensure) {
-    exec { "get-gem-$name":
-        command => "/usr/bin/wget --output-document=/tmp/$name.gem $source",
+define rubygems::brokengem(
+    $source,
+    $ensure = 'present',
+) {
+    exec{"get-gem-$name":
+        command => "/usr/bin/wget -O /tmp/$name.gem $source",
         creates => "/tmp/$name.gem",
-        before => Package[$name]
+        before => Package[$name],
+    }
+    package{$name:
+        ensure => $ensure,
+        provider => gem,
+        source => "/tmp/$name.gem",
     }
-    package { $name: ensure => $ensure, provider => gem, source => "/tmp/$name.gem" }
 }
diff --git a/manifests/defines.pp b/manifests/defines.pp
deleted file mode 100644 (file)
index f3456fa..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-define rubygems::package(
-   $ensure = 'present' 
-){
-    package{$name:
-        provider => gem,
-        ensure => $ensure,
-        require => Package['rubygems'],
-    }
-}
index 860b84d..1e6c364 100644 (file)
@@ -1,6 +1,6 @@
 class rubygems::fastercsv {
     rubygems::brokengem{'fastercsv':
-        source => 'http://rubyforge.org/frs/download.php/43190/fastercsv-1.4.0.gem',
         ensure => present,
+        source => 'http://rubyforge.org/frs/download.php/43190/fastercsv-1.4.0.gem',
     }
 }
index 1b55809..9f24b15 100644 (file)
 # the Free Software Foundation.
 #
 
-import 'defines.pp'
-
 class rubygems {
-    include rubygems::base
-}
-
-class rubygems::base {
-    package { rubygems: 
+    package{'rubygems': 
         ensure => present
     }
 }
-
index 0c66851..bdfb840 100644 (file)
@@ -1,4 +1,4 @@
 class rubygems::mysql {
     include mysql::devel
-    rubygems::package{'mysql': }
+    rubygems::package{'mysql':}
 }