Permalink
Browse files

Extracted windows check to reusable Refinery::WINDOWS

  • Loading branch information...
Steven Heidel
Steven Heidel committed Sep 16, 2010
1 parent 228811a commit ebea868006844a89c248ac0a47458495e0134111
Showing with 6 additions and 3 deletions.
  1. +1 −2 bin/refinerycms
  2. +5 −1 vendor/refinerycms/refinery.rb
View
@@ -14,7 +14,6 @@ end
require 'pathname'
require 'fileutils'
require 'optparse'
-require 'rbconfig'
# Load refinerycms
require Pathname.new(File.expand_path(File.dirname(__FILE__) << "/..")).join('vendor', 'refinerycms', 'refinery.rb')
@@ -241,7 +240,7 @@ module Refinery
to_run << "cd \"#{@app_path}\" &&" if options[:cd]
to_run << command
- if RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
+ if Refinery::WINDOWS
to_run = %w(cmd /c) | to_run.map{|c| c.gsub(/\//m, '\\')}
end
@@ -1,5 +1,9 @@
-module Refinery
+require 'rbconfig'
+module Refinery
+
+ WINDOWS = !!(RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!)
+
class << self
attr_accessor :is_a_gem, :root, :s3_backend, :base_cache_key
def is_a_gem

0 comments on commit ebea868

Please sign in to comment.