forked from remarkable-rb/remarkable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
66 lines (56 loc) · 1.58 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
# encoding: utf-8
current_dir = File.dirname(__FILE__)
require File.join(current_dir, "remarkable/lib/remarkable/core/version.rb")
require "rubygems"
require "fileutils"
include FileUtils
REMARKABLE_GEMS = [
:remarkable,
:remarkable_activemodel,
:remarkable_activerecord,
#:remarkable_datamapper,
#:remarkable_rails
]
REMARKABLE_GEMS_PATHS = REMARKABLE_GEMS.map{|g| File.join(current_dir, g.to_s)}
RUBY_FORGE_PROJECT = "remarkable"
GEM_VERSION = Remarkable::VERSION
PACKAGE_DIR = File.join(File.dirname(__FILE__), 'pkg')
# Create tasks that are called inside remarkable path
def self.unique_tasks(*names)
names.each do |name|
desc "Run #{name} tasks in remarkable core gem"
task name do
cd REMARKABLE_GEMS_PATHS[0]
system "rake #{name}"
end
end
end
# Create tasks that are called in each path
def self.recursive_tasks(*names)
names.each do |name|
desc "Run #{name} tasks in all remarkable gems"
task name do
REMARKABLE_GEMS_PATHS.each do |path|
cd path
system "rake #{name}"
puts
end
end
end
end
unique_tasks :clobber_package
recursive_tasks :clobber_rdoc, :gem, :gemspec, :install, :package, :pre_commit,
:rdoc, :repackage, :rerdoc, :spec, :uninstall, :build
desc "Default Task"
task :default do
Rake::Task[:spec].execute
end
desc "Publish release files to RubyForge"
task :release => [:gemspec, :package] do
REMARKABLE_GEMS.each do |gem|
path = File.join(PACKAGE_DIR, "#{gem}-#{GEM_VERSION}.gem")
command = "gem push #{path}"
puts command
system command
end
end