-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathRakefile
More file actions
53 lines (47 loc) · 1.45 KB
/
Rakefile
File metadata and controls
53 lines (47 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require 'rubygems'
require 'rake'
require 'rubygems/package_task'
require 'rspec/core/rake_task'
begin
load 'jrclj.gemspec'
rescue
$stderr.puts "WARN: not running in jruby, will not be able to perform some tasks."
end
SPEC_FILES = FileList['spec/*_spec.rb']
$jruby_version = "1.7.3"
namespace :jruby do
desc "install jruby"
task :install do
url = "http://jruby.org.s3.amazonaws.com/downloads/#{$jruby_version}/jruby-bin-#{$jruby_version}.tar.gz" # "http://jruby.org.s3.amazonaws.com/downloads/1.6.7.2/jruby-bin-1.6.7.2.tar.gz"
fname = File.basename(url)
unless File.exist? "software"
FileUtils.mkdir "software"
end
Dir.chdir("software") do
unless File.exist? File.basename(url)
unless system "wget", url
raise "Error executing wget #{url} : #$!"
end
end
unless File.exist? File.basename(fname, ".tar.gz")
unless system "tar", "xzf", fname
raise "Error extracting tar: #$!"
end
end
end
end
desc "run JRuby irb"
task :irb do |t,args|
cmd = "./software/jruby-#{$jruby_version}/bin/jruby -I lib ./software/jruby-#{$jruby_version}/bin/jirb"
unless system cmd
raise "Error executing jirb: #$! [#{cmd}]"
end
end
desc "run a JRuby script"
task :run, :script do |t,args|
cmd = "./software/jruby-#{$jruby_version}/bin/jruby -I lib #{args[:script]}"
unless system cmd
raise "Error executing jruby: #$! [#{cmd}]"
end
end
end