lib/dev/Environment.rb in dev-1.0.237 vs lib/dev/Environment.rb in dev-1.0.238

- old
+ new

@@ -1,6 +1,6 @@ -puts_debug "read " + __FILE__.foreground(:green) +puts_debug "read " + __FILE__ module Dev class Environment def self.replace_text_in_glob(glob,search,replace) @@ -31,27 +31,29 @@ dir="~" dir=ENV["HOME"] unless ENV["HOME"].nil? dir=ENV["USERPROFILE"].gsub('\\','/') unless ENV["USERPROFILE"].nil? dir=ENV["DEV_ROOT"].gsub('\\','/') unless ENV["DEV_ROOT"].nil? - reg_exp = /(\/(wrk|dep|exp)\/[.\w\d-]+\/[.\w\d-]+\/[.\w\d-@]+)/ - unless(Rake.original_dir().match(reg_exp).nil?) - wrk_rel = Rake.original_dir().match(reg_exp)[1] if Rake.original_dir().match(reg_exp).length > 0 - if(!wrk_rel.nil? && wrk_rel.length > 0) - dir = Rake.original_dir().gsub(wrk_rel,""); - return dir - end - end + return dir if(RUBY_VERSION == "1.8.7") - reg_exp = /(\/(Dropbox)\/[.\w\d-]+\/[.\w\d-]+\/[.\w\d-@]+)/ - unless(Rake.original_dir().match(reg_exp).nil?) - wrk_rel = Rake.original_dir().match(reg_exp)[1] if Rake.original_dir().match(reg_exp).length > 0 - if(!wrk_rel.nil? && wrk_rel.length > 0) - dir = Rake.original_dir().gsub(wrk_rel,""); - return dir - end - end +# reg_exp = /(\/(wrk|dep|exp)\/[.\w\d-]+\/[.\w\d-]+\/[.\w\d-@]+)/ if(RUBY_VERSION != "1.8.6") +# unless(Rake.original_dir().match(reg_exp).nil?) +# wrk_rel = Rake.original_dir().match(reg_exp)[1] if Rake.original_dir().match(reg_exp).length > 0 +# if(!wrk_rel.nil? && wrk_rel.length > 0) +# dir = Rake.original_dir().gsub(wrk_rel,""); +# return dir +# end + +# reg_exp = /(\/(Dropbox)\/[.\w\d-]+\/[.\w\d-]+\/[.\w\d-@]+)/ +# unless(Rake.original_dir().match(reg_exp).nil?) +# wrk_rel = Rake.original_dir().match(reg_exp)[1] if Rake.original_dir().match(reg_exp).length > 0 +# if(!wrk_rel.nil? && wrk_rel.length > 0) +# dir = Rake.original_dir().gsub(wrk_rel,""); +# return dir +# end +# end + #end return dir end def self.expand_string_variables(str) eval("\"#{str.gsub('"','\"')}\"")