forked from ianwhite/rspec-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
170 lines (136 loc) · 4.03 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
dir = File.dirname(__FILE__)
$:.unshift(File.expand_path("#{dir}/lib"))
$:.unshift(File.expand_path("#{dir}/example_rails_app/vendor/plugins/rspec/lib"))
require "rspec/git"
require 'rubyforge'
require 'spec'
def git
RSpec::Git.new
end
namespace :git do
desc "Update rspec-dev & sub-projects"
task :update do
git.update
end
desc "Update rspec-dev & sub-projects"
task :pull => :update
desc "Reset rspec-dev and sub-projects"
task :hard_reset do
git.hard_reset
end
desc "Tag rspec-dev and sub-projects"
task :tag do
git.tag
end
end
if git.plugins_fetched?
$LOAD_PATH.unshift(File.expand_path("#{dir}/pre_commit/lib"))
require "pre_commit"
task :default => :pre_commit
desc "Runs pre_commit_core and pre_commit_rails"
task :pre_commit do
pre_commit.pre_commit
end
desc "Runs pre_commit against rspec (core)"
task :pre_commit_core do
pre_commit.pre_commit_core
end
desc "Runs textmate bundle specs"
task :pre_commit_textmate_bundle do
pre_commit.pre_commit_textmate_bundle
end
desc "Runs pre_commit against example_rails_app (against all supported Rails versions)"
task :pre_commit_rails do
pre_commit.pre_commit_rails
end
task :ok_to_commit do |t|
pre_commit.ok_to_commit
end
desc "Touches files storing revisions so that svn will update $LastChangedRevision"
task :touch_revision_storing_files do
pre_commit.touch_revision_storing_files
end
desc "Deletes generated documentation"
task :clobber do
rm_rf 'doc/output'
end
desc "Installs dependencies for development environment"
task :install_dependencies do
pre_commit.install_dependencies
end
desc "Updates dependencies for development environment"
task :update_dependencies do
pre_commit.update_dependencies
end
desc "Build the website, but do not publish it"
task(:website) {core.website}
def pre_commit
PreCommit::Rspec.new(self)
end
desc "Fix line endings"
task(:fix_cr_lf) {pre_commit.fix_cr_lf}
namespace :git do
desc "Commit rspec-dev & sub-projects"
task :commit do
git.commit
end
desc "Show status of rspec-dev & sub-projects"
task :status do
git.status
end
desc "Push rspec-dev & sub-projects to github"
task :push do
git.push
end
desc "Add remote references to rspec-dev & sub-projects"
task :add_remotes do
git.add_remotes
end
end
end
# desc "Run all specs and store html output in doc/output/report.html"
# Spec::Rake::SpecTask.new('spec_html') do |t|
# t.spec_files = FileList['spec/**/*_spec.rb']
# t.spec_opts = ['--format html:../../../../doc/output/report.html', '--format progress','--backtrace']
# end
def assign_version
ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
end
desc "Package the RSpec.tmbundle"
task :package_tmbundle do
version = assign_version
mkdir 'pkg' rescue nil
rm_rf "pkg/RSpec-#{version}.tmbundle" rescue nil
`git clone RSpec.tmbundle pkg/RSpec-#{version}.tmbundle`
rm_rf "pkg/RSpec-#{version}.tmbundle/.git"
Dir.chdir 'pkg' do
`tar zcvf RSpec-#{version}.tmbundle.tgz RSpec-#{version}.tmbundle`
end
end
task :clobber_pkg do
rm_rf "pkg"
end
task :clobber => :clobber_pkg
task :release_rspec do
version = assign_version
Dir.chdir 'example_rails_app/vendor/plugins/rspec' do
sh 'rake release'
end
end
task :release_rspec_rails do
version = assign_version
Dir.chdir 'example_rails_app/vendor/plugins/rspec-rails' do
sh 'rake release'
end
end
task :release_tmbundle do |t|
version = assign_version
abort "Versions don't match #{version} vs #{Spec::VERSION::STRING}" unless version == Spec::VERSION::STRING
rubyforge = RubyForge.new.configure
puts "Logging in to rubyforge ..."
rubyforge.login
puts "Releasing RSpec-#{version}.tmbundle version #{version} ..."
rubyforge.add_file('rspec', 'rspec', Spec::VERSION::STRING, "pkg/RSpec-#{version}.tmbundle.tgz")
end
task :release_tmbundle => :package_tmbundle
task :release => [:release_rspec, :release_rspec_rails, :release_tmbundle]