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
|
# File 'lib/tumbler/rake_tasks.rb', line 17
def activate_project_tasks(protect_namespace)
tasks = proc do
namespace :tumbler do
task :preflight do
end
end
namespace :gem do
desc "Build the gem"
task :build => 'tumbler:preflight' do
@manager.gem.build
end
desc "Push the gem"
task :push => 'tumbler:preflight' do
@manager.gem.push
end
desc "Install the gem"
task :install => 'tumbler:preflight' do
@manager.gem.install
end
end
namespace :version do
desc "Tag current version into git"
task :tag => 'tumbler:preflight' do
@manager.tag
end
desc "Push current version into git"
task :push => 'tumbler:preflight' do
@manager.tag_and_push
end
@manager.version.field_names.each do |field|
namespace field do
desc "Bump version from #{@manager.version.to_s} -> #{@manager.version.value.bump(field).to_s}"
task :bump => 'tumbler:preflight' do
@manager.bump_and_commit(field)
end
task :push => 'tumbler:preflight' do
@manager.tag_and_push(field)
end
desc "Bump version from #{@manager.version.to_s} -> #{@manager.version.value.bump(field).to_s} and push"
task :release => 'tumbler:preflight' do
@manager.bump_and_push(field)
end
end
end
end
end
if protect_namespace
namespace protect_namespace, &tasks
else
tasks.call
end
end
|