lib/rubber/environment.rb in rubber-2.8.1 vs lib/rubber/environment.rb in rubber-2.9.0
- old
+ new
@@ -1,9 +1,10 @@
require 'yaml'
require 'socket'
require 'delegate'
require 'monitor'
+require 'rbconfig'
module Rubber
module Configuration
# Contains the configuration defined in rubber.yml
@@ -248,10 +249,22 @@
global[k] = Environment.combine(global[k], v)
end
global
end
-
+
+ def local_platform
+ RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'windows' : 'posix'
+ end
+
+ def local_windows?
+ local_platform == 'windows'
+ end
+
+ def local_posix?
+ local_platform == 'posix'
+ end
+
def method_missing(method_id)
self[method_id.id2name]
end
end