-
Notifications
You must be signed in to change notification settings - Fork 296
Expand file tree
/
Copy pathrbreadline.rake
More file actions
60 lines (51 loc) · 1.89 KB
/
rbreadline.rake
File metadata and controls
60 lines (51 loc) · 1.89 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
54
55
56
57
58
59
60
require 'rake'
require 'rake/clean'
namespace(:dependencies) do
namespace(:rbreadline) do
package = RubyInstaller::PureReadline
directory package.target
CLEAN.include(package.target)
# Put files for the :download task
package.files.each do |f|
file_source = "#{package.url}/#{f}"
file_target = "#{RubyInstaller::DOWNLOADS}/#{f}"
download file_target => file_source
# depend on downloads directory
file file_target => RubyInstaller::DOWNLOADS
# download task need these files as pre-requisites
task :download => file_target
end
# Prepare the :sandbox, it requires the :download task
task :extract => [:extract_utils, :download, package.target] do
# grab the files from the download task
files = Rake::Task['dependencies:rbreadline:download'].prerequisites
files.each { |f|
extract(f, package.target)
}
end
RubyInstaller::BaseVersions.each do |ver|
interpreter = RubyInstaller.const_get("Ruby#{ver}")
task "install#{ver}" => [package.target] do
new_ruby = File.join(RubyInstaller::ROOT, interpreter.install_target, "bin").gsub(File::SEPARATOR, File::ALT_SEPARATOR)
ENV['PATH'] = "#{new_ruby};#{ENV['PATH']}"
ENV.delete("RUBYOPT")
cd package.target do
sh "ruby setup.rb #{(package.configure_options || []).join(' ')}"
end
end
end
task :install22 => [package.target] do
interpreter = RubyInstaller::Ruby22
new_ruby = File.join(RubyInstaller::ROOT, interpreter.install_target, "bin").gsub(File::SEPARATOR, File::ALT_SEPARATOR)
ENV['PATH'] = "#{new_ruby};#{ENV['PATH']}"
ENV.delete("RUBYOPT")
cd package.target do
sh "ruby setup.rb #{(package.configure_options || []).join(' ')}"
end
end
end
end
task :rbreadline => [
'dependencies:rbreadline:download',
'dependencies:rbreadline:extract'
]