summaryrefslogtreecommitdiffhomepage
path: root/tasks/ruby_ext.rake
diff options
context:
space:
mode:
authorYuichiro MASUI <[email protected]>2012-12-29 05:37:55 +0900
committerYuichiro MASUI <[email protected]>2013-01-03 02:24:15 +0900
commit7c469c0b9dadd1de09fed18c3e5cc551012c38c1 (patch)
treeb79aa703ef7c528896c4f1be8280d0691314008b /tasks/ruby_ext.rake
parenta48fc0d7952ad1f10ae777637269fe6a3f9ad0a2 (diff)
downloadmruby-7c469c0b9dadd1de09fed18c3e5cc551012c38c1.tar.gz
mruby-7c469c0b9dadd1de09fed18c3e5cc551012c38c1.zip
Rebuild CRuby based building script without Makefile
Tested CRuby 1.8.6 and 1.9.3 You can see building configuration in build_config.rb
Diffstat (limited to 'tasks/ruby_ext.rake')
-rw-r--r--tasks/ruby_ext.rake24
1 files changed, 24 insertions, 0 deletions
diff --git a/tasks/ruby_ext.rake b/tasks/ruby_ext.rake
new file mode 100644
index 000000000..08633b4da
--- /dev/null
+++ b/tasks/ruby_ext.rake
@@ -0,0 +1,24 @@
+def exefile(filename)
+ if ENV['OS'] == 'Windows_NT'
+ "#{filename}.exe"
+ else
+ filename
+ end
+end
+
+def filename(name)
+ if ENV['OS'] == 'Windows_NT'
+ '"'+name.gsub('/', '\\')+'"'
+ end
+ '"'+name+'"'
+end
+
+def filenames(names)
+ [names].flatten.map { |n| filename(n) }.join(' ')
+end
+
+class String
+ def relative_path_from(dir)
+ Pathname.new(self).relative_path_from(Pathname.new(dir)).to_s
+ end
+end