josh-vmparty 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc ADDED
@@ -0,0 +1,4 @@
1
+ VM Party
2
+ ========
3
+
4
+ A set of rake tasks to help you keep up to date with the Ruby VM scene
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "#{File.dirname(__FILE__)}/lib/vm_party/utilities.rb"
2
+ include VmParty::Utilities
3
+
4
+ Dir["#{File.dirname(__FILE__)}/lib/tasks/*.rake"].each { |lib| load(lib) }
5
+
6
+ task :default => [:jruby, :macruby, :ree, :rubinius, :ruby19, :rubygc]
data/bin/vmparty ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ system("rake -f #{File.dirname(__FILE__)}/../Rakefile #{ARGV}")
@@ -0,0 +1,52 @@
1
+ desc "Install or update JRuby"
2
+ task :jruby => "jruby:default"
3
+
4
+ namespace :jruby do
5
+ def jruby_version
6
+ "1.1.5"
7
+ end
8
+
9
+ task :default do
10
+ Rake::Task["jruby:install"].invoke
11
+ Rake::Task["jruby:gems"].invoke
12
+ end
13
+
14
+ desc "Download JRuby #{jruby_version} binary"
15
+ task :download do
16
+ chdir "/tmp" do
17
+ unless exists? "jruby-#{jruby_version}/"
18
+ puts "Downloading jruby-bin-#{jruby_version}.tar.gz"
19
+ download_and_unzip "http://dist.codehaus.org/jruby/jruby-bin-#{jruby_version}.tar.gz"
20
+ else
21
+ puts "jruby-bin-#{jruby_version}.tar.gz has already been downloaded"
22
+ end
23
+ end
24
+ end
25
+
26
+ desc "Install JRuby"
27
+ task :install do
28
+ unless exists? "#{prefix}/jruby-#{jruby_version}/"
29
+ Rake::Task["jruby:download"].invoke
30
+
31
+ puts "Installing jruby-#{jruby_version}"
32
+ sudo "mv /tmp/jruby-#{jruby_version} #{prefix}/"
33
+ sudo "ln -sf #{prefix}/jruby-#{jruby_version} #{prefix}/jruby"
34
+
35
+ sudo "ln -sf #{prefix}/jruby/bin/jruby #{prefix}/bin/jruby"
36
+
37
+ sudo "jruby -S gem install jruby-openssl"
38
+ sudo "jruby -S gem install rails"
39
+ sudo "jruby -S gem install activerecord-jdbcmysql-adapter"
40
+ sudo "jruby -S gem install buildr rack"
41
+ sudo "jruby -S warble pluginize"
42
+ sudo "jruby -S gem install jetty-rails"
43
+ else
44
+ puts "JRuby #{jruby_version} has already been installed"
45
+ end
46
+ end
47
+
48
+ desc "Update JRuby gems"
49
+ task :gems => :install do
50
+ sudo "jruby -S gem update"
51
+ end
52
+ end
@@ -0,0 +1,56 @@
1
+ desc "Install or update MacRuby"
2
+ task :macruby => "macruby:default"
3
+
4
+ namespace :macruby do
5
+ def macruby_version
6
+ "0.3"
7
+ end
8
+
9
+ task :default do
10
+ if has_system_utility? "macruby"
11
+ puts "MacRuby has already been installed"
12
+ else
13
+ Rake::Task["macruby:install"].invoke
14
+ Rake::Task["macruby:clean"].invoke
15
+ end
16
+ end
17
+
18
+ desc "Download MacRuby source"
19
+ task :download do
20
+ chdir "/tmp" do
21
+ unless exists? "MacRuby/"
22
+ puts "Downloading MacRuby"
23
+ system "svn co http://svn.macosforge.org/repository/ruby/MacRuby/tags/#{macruby_version} MacRuby"
24
+ else
25
+ puts "MacRuby has already been downloaded"
26
+ end
27
+ end
28
+ end
29
+
30
+ desc "Build MacRuby"
31
+ task :make => :download do
32
+ open_macruby_folder do
33
+ if exists? "macruby"
34
+ puts "MacRuby has already been built"
35
+ else
36
+ system "rake"
37
+ end
38
+ end
39
+ end
40
+
41
+ desc "Install MacRuby"
42
+ task :install => :make do
43
+ open_macruby_folder do
44
+ system "sudo rake install"
45
+ end
46
+ end
47
+
48
+ desc "Cleanup MacRuby source"
49
+ task :cleanup do
50
+ remove "/tmp/MacRuby/"
51
+ end
52
+
53
+ def open_macruby_folder(&block)
54
+ chdir("/tmp/MacRuby/", &block)
55
+ end
56
+ end
@@ -0,0 +1,41 @@
1
+ task :ree => "ree:default"
2
+
3
+ namespace :ree do
4
+ REE_VERSION = "1.8.6-20080810"
5
+ REE_PREFIX = "#{prefix}/ruby-enterprise-#{REE_VERSION}"
6
+
7
+ desc "Install or update Ruby Enterprise Edition"
8
+ task :default do
9
+ if has_system_utility? "ree"
10
+ puts "Ruby Enterprise Edition has already been installed"
11
+ else
12
+ Rake::Task["ree:install"].invoke
13
+ Rake::Task["ree:clean"].invoke
14
+ end
15
+ end
16
+
17
+ desc "Download Ruby Enterprise Edition source"
18
+ task :download do
19
+ chdir "/tmp" do
20
+ unless exists? "ruby-enterprise-#{REE_VERSION}/"
21
+ puts "Downloading ruby-enterprise-#{REE_VERSION}.tar.gz"
22
+ download_and_unzip "http://rubyforge.iasi.roedu.net/files/emm-ruby/ruby-enterprise-#{REE_VERSION}.tar.gz"
23
+ else
24
+ puts "ruby-enterprise-#{REE_VERSION}.tar.gz has already been downloaded"
25
+ end
26
+ end
27
+ end
28
+
29
+ desc "Install Ruby Enterprise Edition"
30
+ task :install => :download do
31
+ chdir "/tmp" do
32
+ system "sudo ./ruby-enterprise-#{REE_VERSION}/installer --auto #{REE_PREFIX}"
33
+ system "sudo ln -sf #{REE_PREFIX}/bin/ruby #{prefix}/bin/ree"
34
+ end
35
+ end
36
+
37
+ desc "Cleanup Ruby Enterprise Edition source"
38
+ task :cleanup do
39
+ remove "/tmp/ruby-enterprise-#{REE_VERSION}/"
40
+ end
41
+ end
@@ -0,0 +1,29 @@
1
+ desc "Install or update Rubinius"
2
+ task :rubinius => "rubinius:default"
3
+
4
+ namespace :rubinius do
5
+ task :default do
6
+ Rake::Task["rubinius:update"].invoke
7
+ end
8
+
9
+ desc "Download Rubinius source"
10
+ task :download do
11
+ chdir(prefix) do
12
+ unless exists? "rubinius/"
13
+ puts "Checking out Rubinius"
14
+ system "sudo git clone git://github.com/evanphx/rubinius.git"
15
+ end
16
+ end
17
+ end
18
+
19
+ desc "Update Rubinius source"
20
+ task :update => :download do
21
+ chdir "#{prefix}/rubinius" do
22
+ puts "Updating Rubinius"
23
+ system "sudo git pull"
24
+ system "sudo rake build"
25
+ end
26
+
27
+ system "sudo ln -sf #{prefix}/rubinius/bin/rbx #{prefix}/bin/rbx"
28
+ end
29
+ end
@@ -0,0 +1,63 @@
1
+ task :ruby19 => "ruby19:default"
2
+
3
+ namespace :ruby19 do
4
+ desc "Install or update Ruby 1.9"
5
+ task :default do
6
+ if has_system_utility? "ruby1.9"
7
+ puts "Ruby 1.9 has already been installed"
8
+ else
9
+ Rake::Task["ruby19:install"].invoke
10
+ Rake::Task["ruby19:clean"].invoke
11
+ end
12
+ end
13
+
14
+ desc "Download Ruby 1.9 source"
15
+ task :download do
16
+ chdir "/tmp" do
17
+ unless exists? "ruby-1.9.1-preview1/"
18
+ puts "Downloading ruby-1.9.1-preview1.tar.gz"
19
+ download_and_unzip "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-preview1.tar.gz"
20
+ else
21
+ puts "ruby-1.9.1-preview1.tar.gz has already been downloaded"
22
+ end
23
+ end
24
+ end
25
+
26
+ desc "Configure Ruby 1.9 source"
27
+ task :configure => :download do
28
+ open_ruby19_folder do
29
+ if configure?
30
+ puts "Ruby 1.9 Makefile already created"
31
+ else
32
+ configure :prefix => prefix, :program_suffix => "1.9"
33
+ end
34
+ end
35
+ end
36
+
37
+ desc "Build Ruby 1.9"
38
+ task :make => :configure do
39
+ open_ruby19_folder do
40
+ if exists? "ruby1.9"
41
+ puts "Ruby 1.9 has already been built"
42
+ else
43
+ make
44
+ end
45
+ end
46
+ end
47
+
48
+ desc "Install Ruby 1.9"
49
+ task :install => :make do
50
+ open_ruby19_folder do
51
+ install
52
+ end
53
+ end
54
+
55
+ desc "Cleanup Ruby 1.9 source"
56
+ task :cleanup do
57
+ remove "/tmp/ruby-1.9.1-preview1/"
58
+ end
59
+
60
+ def open_ruby19_folder(&block)
61
+ chdir("/tmp/ruby-1.9.1-preview1/", &block)
62
+ end
63
+ end
@@ -0,0 +1,81 @@
1
+ task :rubygc => "rubygc:default"
2
+
3
+ namespace :rubygc do
4
+ desc "Install or update Ruby GC"
5
+ task :default do
6
+ if has_system_utility? "ruby-gc"
7
+ puts "Ruby GC has already been installed"
8
+ else
9
+ Rake::Task["rubygc:install"].invoke
10
+ Rake::Task["rubygc:clean"].invoke
11
+ end
12
+ end
13
+
14
+ desc "Download Ruby GC source"
15
+ task :download do
16
+ chdir "/tmp" do
17
+ unless exists? "ruby-1.8.6-p111/"
18
+ puts "Downloading ruby-1.8.6-p111.tar.gz"
19
+ download_and_unzip "http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p111.tar.gz"
20
+ else
21
+ puts "ruby-1.8.6-p111.tar.gz has already been downloaded"
22
+ end
23
+ end
24
+ end
25
+
26
+ desc "Patch Ruby GC source"
27
+ task :patch => :download do
28
+ open_rubygc_folder do
29
+ system "curl -s http://rubyforge.org/tracker/download.php/1814/7062/17676/3291/ruby186gc.patch | patch -p0"
30
+ end
31
+ end
32
+
33
+ desc "Configure Ruby GC source"
34
+ task :configure => :patch do
35
+ open_rubygc_folder do
36
+ if configure?
37
+ puts "Ruby GC Makefile already created"
38
+ else
39
+ configure :prefix => prefix, :program_suffix => "-gc"
40
+ end
41
+ end
42
+ end
43
+
44
+ desc "Build Ruby GC"
45
+ task :make => :configure do
46
+ open_rubygc_folder do
47
+ if exists? "ruby-gc"
48
+ puts "Ruby GC has already been built"
49
+ else
50
+ make
51
+ end
52
+ end
53
+ end
54
+
55
+ desc "Install Ruby GC"
56
+ task :install => :make do
57
+ open_rubygc_folder do
58
+ install
59
+ end
60
+ end
61
+
62
+ desc "Install Ruby Gems for Ruby GC"
63
+ task :install_gems do
64
+ chdir "/tmp" do
65
+ download_and_unzip "http://rubyforge.iasi.roedu.net/files/rubygems/rubygems-1.3.1.tgz"
66
+
67
+ chdir "rubygems-1.3.1/" do
68
+ system "sudo ruby-gc setup.rb"
69
+ end
70
+ end
71
+ end
72
+
73
+ desc "Cleanup Ruby GC source"
74
+ task :cleanup do
75
+ remove "/tmp/ruby-1.8.6-p111/"
76
+ end
77
+
78
+ def open_rubygc_folder(&block)
79
+ chdir("/tmp/ruby-1.8.6-p111/", &block)
80
+ end
81
+ end
@@ -0,0 +1,64 @@
1
+ module VmParty
2
+ module Utilities
3
+ def prefix
4
+ "/usr/local"
5
+ end
6
+
7
+ def run(command)
8
+ system(command)
9
+ end
10
+
11
+ def sudo(command)
12
+ run("sudo #{command}")
13
+ end
14
+
15
+ def exists?(file)
16
+ File.exist?(file)
17
+ end
18
+
19
+ def chdir(path, &block)
20
+ Dir.chdir(path, &block)
21
+ end
22
+
23
+ def download_and_unzip(url)
24
+ if has_system_utility? :curl
25
+ Dir.chdir("/tmp") do
26
+ system("curl -s #{url} | tar -xz")
27
+ end
28
+ else
29
+ raise RuntimeError, "curl not found"
30
+ end
31
+ end
32
+
33
+ def has_system_utility?(command)
34
+ unless `which #{command}` == ""
35
+ true
36
+ else
37
+ false
38
+ end
39
+ end
40
+
41
+ def configure?
42
+ exists? "Makefile"
43
+ end
44
+
45
+ def configure(flags = {})
46
+ flags = flags.map { |k,v| "--#{k.to_s.gsub(/_/, "-")}=#{v}" }.join(" ")
47
+ system "./configure #{flags}"
48
+ end
49
+
50
+ def make
51
+ system "make"
52
+ end
53
+
54
+ def install
55
+ system "sudo make install"
56
+ end
57
+
58
+ def remove(folder)
59
+ if exists?(folder)
60
+ system "sudo rm -r #{folder}"
61
+ end
62
+ end
63
+ end
64
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: josh-vmparty
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Joshua Peek
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-11-09 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: josh@joshpeek.com
18
+ executables:
19
+ - vmparty
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README.rdoc
24
+ files:
25
+ - Rakefile
26
+ - lib/tasks/jruby.rake
27
+ - lib/tasks/macruby.rake
28
+ - lib/tasks/ree.rake
29
+ - lib/tasks/rubinius.rake
30
+ - lib/tasks/ruby19.rake
31
+ - lib/tasks/rubygc.rake
32
+ - lib/vm_party/utilities.rb
33
+ - README.rdoc
34
+ has_rdoc: true
35
+ homepage: http://github.com/josh/vmparty
36
+ post_install_message:
37
+ rdoc_options:
38
+ - --main
39
+ - README.rdoc
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "0"
47
+ version:
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: "0"
53
+ version:
54
+ requirements: []
55
+
56
+ rubyforge_project:
57
+ rubygems_version: 1.2.0
58
+ signing_key:
59
+ specification_version: 2
60
+ summary: A set of rake tasks to keep up to date with the Ruby VM scene
61
+ test_files: []
62
+