Permalink
Browse files

Converted 'kernel' fact

  • Loading branch information...
1 parent 55489de commit 0a684e4836d2928dd1c6984898ad580fc0376a27 @cosimo committed Dec 5, 2010
Showing with 12 additions and 11 deletions.
  1. +12 −0 lib/Facter/kernel.pm
  2. +0 −11 lib/Facter/kernel.rb
View
@@ -0,0 +1,12 @@
+Facter.add("kernel", sub ($f) {
+ $f.setcode(block => sub {
+ given $*OS {
+ when m:i/mswin|win32|dos|cygwin|mingw/ {
+ "windows"
+ }
+ default {
+ Facter::Util::Resolution.exec("uname -s")
+ }
+ }
+ });
+});
View
@@ -1,11 +0,0 @@
-Facter.add(:kernel) do
- setcode do
- require 'rbconfig'
- case Config::CONFIG['host_os']
- when /mswin|win32|dos|cygwin|mingw/i
- 'windows'
- else
- Facter::Util::Resolution.exec("uname -s")
- end
- end
-end

0 comments on commit 0a684e4

Please sign in to comment.