-
Notifications
You must be signed in to change notification settings - Fork 6
/
Rakefile
91 lines (76 loc) · 2.42 KB
/
Rakefile
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
85
86
87
88
89
90
91
require File.join(File.dirname(__FILE__), "../merb-core/lib/merb-core/version.rb")
GEM_VERSION = Merb::VERSION
GEM_NAME = "merb-auth"
require "rake/clean"
require "rake/gempackagetask"
require 'rubygems/specification'
require "spec/rake/spectask"
require 'merb-core/tasks/merb_rake_helper'
require 'fileutils'
include FileUtils
require "extlib/tasks/release"
RUBY_FORGE_PROJECT = "merb-auth"
PROJECT_URL = "http://merbivore.com"
PROJECT_SUMMARY = "merb-auth. The official authentication plugin for merb. Setup for the default stack"
PROJECT_DESCRIPTION = PROJECT_SUMMARY
GEM_AUTHOR = "Daniel Neighman"
GEM_EMAIL = "has.sox@gmail.com"
GEM_NAME = "merb-auth"
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
GEM_VERSION = Merb::VERSION + PKG_BUILD
RELEASE_NAME = "REL #{GEM_VERSION}"
gems = %w[
merb-auth-core merb-auth-more merb-auth-slice-password
]
merb_auth_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.author = GEM_AUTHOR
s.email = GEM_EMAIL
s.homepage = "http://www.merbivore.com"
s.summary = PROJECT_SUMMARY
s.description = PROJECT_SUMMARY
s.files = %w(LICENSE README.textile Rakefile TODO) + Dir.glob("{lib,spec}/**/*")
s.add_dependency "merb-core", "~> #{GEM_VERSION}"
gems.each do |gem|
s.add_dependency gem, "~> #{GEM_VERSION}"
end
end
CLEAN.include ["**/.*.sw?", "pkg", "lib/*.bundle", "*.gem", "doc/rdoc", ".config", "coverage", "cache"]
Rake::GemPackageTask.new(merb_auth_spec) do |package|
package.gem_spec = merb_auth_spec
end
task :package => ["lib/merb-auth.rb"]
desc "Create merb-auth.rb"
task "lib/merb-auth.rb" do
mkdir_p "lib"
File.open("lib/merb-auth.rb","w+") do |file|
file.puts "### AUTOMATICALLY GENERATED. DO NOT EDIT!"
gems.each do |gem|
next if gem == "merb-gen"
file.puts "require '#{gem}'"
end
end
end
desc "install the plugin as a gem"
task :install do
Merb::RakeHelper.install(GEM_NAME, :version => GEM_VERSION)
end
desc "Uninstall the gem"
task :uninstall do
Merb::RakeHelper.uninstall(GEM_NAME, :version => GEM_VERSION)
end
desc "Create a gemspec file"
task :gemspec do
File.open("#{GEM_NAME}.gemspec", "w") do |file|
file.puts spec.to_ruby
end
end
desc "Run all specs"
task :spec do
gems.each do |gem|
Dir.chdir(gem) { sh "#{Gem.ruby} -S rake spec" }
end
end