public
Description: Lighweight drop-in replacement for rubygems.
Homepage:
Clone URL: git://github.com/fabien/minigems.git
fabien (author)
Mon Oct 20 14:58:31 -0700 2008
commit  2d81a25e2a42ee6519c9c4f4c6eb6a1683245c42
tree    36849c6d89a76412936dab1d3092bbd11ad10a9d
parent  5a30de87f43dd2f96e8911c1a2f5ccc42d1dabb0
minigems / Rakefile
100644 84 lines (68 sloc) 2.32 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
require 'rubygems'
require 'rake/gempackagetask'
require File.join(File.dirname(__FILE__), 'lib', 'minigems')
 
##############################################################################
# Package && release
##############################################################################
RUBY_FORGE_PROJECT = "merb"
PROJECT_URL = "http://merbivore.com"
PROJECT_SUMMARY = "Lighweight drop-in replacement for rubygems."
PROJECT_DESCRIPTION = PROJECT_SUMMARY
 
GEM_AUTHOR = "Fabien Franzen"
GEM_EMAIL = "info@atelierfabien.be"
 
GEM_NAME = "minigems"
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
GEM_VERSION = (Gem::MiniGems::VERSION || "0.9.8") + PKG_BUILD
 
RELEASE_NAME = "REL #{GEM_VERSION}"
 
spec = Gem::Specification.new do |s|
  s.rubyforge_project = RUBY_FORGE_PROJECT
  s.name = GEM_NAME
  s.version = GEM_VERSION
  s.platform = Gem::Platform::RUBY
  s.has_rdoc = true
  s.extra_rdoc_files = ["README", "LICENSE"]
  s.summary = PROJECT_SUMMARY
  s.description = PROJECT_DESCRIPTION
  s.author = GEM_AUTHOR
  s.email = GEM_EMAIL
  s.homepage = PROJECT_URL
  s.bindir = "bin"
  s.executables = %w( minigem )
  s.require_path = "lib"
  s.files = %w(LICENSE README Rakefile) + Dir.glob("{lib,bin,spec}/**/*")
  s.post_install_message = "Run 'minigem' for instructions on how to proceed."
end
 
def sudo
  ENV['MERB_SUDO'] ||= "sudo"
  sudo = windows? ? "" : ENV['MERB_SUDO']
end
 
def windows?
  (PLATFORM =~ /win32|cygwin/) rescue nil
end
 
def install_home
  ENV['GEM_HOME'] ? "-i #{ENV['GEM_HOME']}" : ""
end
 
Rake::GemPackageTask.new(spec) do |pkg|
  pkg.gem_spec = spec
end
 
desc "removes any generated content"
task :clean do
  FileUtils.rm_rf "clobber/*"
  FileUtils.rm_rf "pkg/*"
end
 
desc "create a gemspec file"
task :make_spec do
  File.open("#{GEM_NAME}.gemspec", "w") do |file|
    file.puts spec.to_ruby
  end
end
 
desc "Install the gem"
task :install => [:clean, :package] do
  sh %{#{sudo} #{Gem.ruby} -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION} --no-wrapper --no-update-sources --no-rdoc --no-ri}
end
 
namespace :jruby do
 
  desc "Run :package and install the resulting .gem with jruby"
  task :install => :package do
    sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-wrapper --no-rdoc --no-ri}
  end
 
end