fabien / minigems

Lighweight drop-in replacement for rubygems.

This URL has Read+Write access

fabien (author)
Mon Oct 20 14:58:31 -0700 2008
commit  2d81a25e2a42ee6519c9c4f4c6eb6a1683245c42
tree    36849c6d89a76412936dab1d3092bbd11ad10a9d
parent  5a30de87f43dd2f96e8911c1a2f5ccc42d1dabb0
minigems / Rakefile
18702fea » fabien 2008-08-29 Initial commit 1 require 'rubygems'
2 require 'rake/gempackagetask'
3 require File.join(File.dirname(__FILE__), 'lib', 'minigems')
4
5 ##############################################################################
6 # Package && release
7 ##############################################################################
8 RUBY_FORGE_PROJECT = "merb"
9 PROJECT_URL = "http://merbivore.com"
10 PROJECT_SUMMARY = "Lighweight drop-in replacement for rubygems."
11 PROJECT_DESCRIPTION = PROJECT_SUMMARY
12
13 GEM_AUTHOR = "Fabien Franzen"
14 GEM_EMAIL = "info@atelierfabien.be"
15
16 GEM_NAME = "minigems"
17 PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
2d81a25e » fabien 2008-10-20 Misc. fixes to Gem activation 18 GEM_VERSION = (Gem::MiniGems::VERSION || "0.9.8") + PKG_BUILD
18702fea » fabien 2008-08-29 Initial commit 19
20 RELEASE_NAME = "REL #{GEM_VERSION}"
21
22 spec = Gem::Specification.new do |s|
23 s.rubyforge_project = RUBY_FORGE_PROJECT
24 s.name = GEM_NAME
25 s.version = GEM_VERSION
26 s.platform = Gem::Platform::RUBY
27 s.has_rdoc = true
28 s.extra_rdoc_files = ["README", "LICENSE"]
29 s.summary = PROJECT_SUMMARY
30 s.description = PROJECT_DESCRIPTION
31 s.author = GEM_AUTHOR
32 s.email = GEM_EMAIL
33 s.homepage = PROJECT_URL
34 s.bindir = "bin"
74c1106d » fabien 2008-08-30 Changed binary name bin/min... 35 s.executables = %w( minigem )
18702fea » fabien 2008-08-29 Initial commit 36 s.require_path = "lib"
37 s.files = %w(LICENSE README Rakefile) + Dir.glob("{lib,bin,spec}/**/*")
74c1106d » fabien 2008-08-30 Changed binary name bin/min... 38 s.post_install_message = "Run 'minigem' for instructions on how to proceed."
18702fea » fabien 2008-08-29 Initial commit 39 end
40
41 def sudo
42 ENV['MERB_SUDO'] ||= "sudo"
43 sudo = windows? ? "" : ENV['MERB_SUDO']
44 end
45
46 def windows?
47 (PLATFORM =~ /win32|cygwin/) rescue nil
48 end
49
50 def install_home
51 ENV['GEM_HOME'] ? "-i #{ENV['GEM_HOME']}" : ""
52 end
53
54 Rake::GemPackageTask.new(spec) do |pkg|
55 pkg.gem_spec = spec
56 end
57
58 desc "removes any generated content"
59 task :clean do
60 FileUtils.rm_rf "clobber/*"
61 FileUtils.rm_rf "pkg/*"
62 end
63
64 desc "create a gemspec file"
65 task :make_spec do
9e3a483d » wycats 2008-09-20 Adds gemspec for github 66 File.open("#{GEM_NAME}.gemspec", "w") do |file|
18702fea » fabien 2008-08-29 Initial commit 67 file.puts spec.to_ruby
68 end
69 end
70
71 desc "Install the gem"
72 task :install => [:clean, :package] do
732bf700 » wycats 2008-09-20 Fixes issue with JRuby 73 sh %{#{sudo} #{Gem.ruby} -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION} --no-wrapper --no-update-sources --no-rdoc --no-ri}
18702fea » fabien 2008-08-29 Initial commit 74 end
75
76 namespace :jruby do
77
78 desc "Run :package and install the resulting .gem with jruby"
79 task :install => :package do
80 sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-wrapper --no-rdoc --no-ri}
81 end
82
83 end