Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Converted 'kernel' fact

  • Loading branch information...
commit 0a684e4836d2928dd1c6984898ad580fc0376a27 1 parent 55489de
@cosimo authored
Showing with 12 additions and 11 deletions.
  1. +12 −0 lib/Facter/kernel.pm
  2. +0 −11 lib/Facter/kernel.rb
View
12 lib/Facter/kernel.pm
@@ -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
11 lib/Facter/kernel.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.