lib/asproject_utils.rb in asproject-0.1.28 vs lib/asproject_utils.rb in asproject-0.1.29
- old
+ new
@@ -1,14 +1,26 @@
module AsProject
##########################
# Custom Errors
- class ProjectError < StandardError; end
+ class ProjectError < StandardError; end
class UsageError < ProjectError; end
+ class BuildError < StandardError; end
end
RAND_CHARS = ['A','B','C','D','E','F','a','b','c','d','e','f']
+
+def AsProject::windowize_cygwin_path(name)
+ expr = /\/cygdrive\/([a-z]|[A-Z])/
+ matched = name.match(expr)
+ if(matched)
+ prefix = matched.captures[0].upcase + ':'
+ name.gsub!(expr, prefix)
+ end
+ name = name.split('/').join('\\')
+ return name
+end
def Dir::unique_tmpdir(application='RubyApplication')
rand_max = RAND_CHARS.size
uniqueish_name = ''
24.times{ uniqueish_name << RAND_CHARS[rand(rand_max)] }