Skip to content
Newer
Older
100644 252 lines (202 sloc) 7.19 KB
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
1 # -*- ruby -*-
ea8e85c @jimweirich added copyright and license information, added datadir methods
jimweirich authored Jun 7, 2006
2
cf3df74 @jimweirich added Rakefile to package
jimweirich authored Nov 29, 2003
3 require 'rubygems'
374c6a2 @drbrain Trim off some stale code, switch to Manifest.txt
drbrain authored Apr 7, 2009
4 require 'rubygems/package_task'
3ab269d @jimweirich Fixed bug in release task so that the proper package versions are cre…
jimweirich authored Feb 27, 2005
5
0c3d9f2 @drbrain Bootstrap load_yaml
drbrain authored Jan 31, 2011
6 # HACK bootstrap load_yaml, remove after 1.5 release
7 def Gem.load_yaml; end unless Gem.respond_to? :load_yaml
8
fe55d5f @evanphx Add different yaml engines to the travis matrix
evanphx authored Mar 14, 2012
9 if ENV['YAML'] == "syck"
10 ENV['TEST_SYCK'] = "1"
11 end
12
0c3d9f2 @drbrain Bootstrap load_yaml
drbrain authored Jan 31, 2011
13 begin
14 require 'psych'
15 rescue ::LoadError
16 require 'yaml'
17 end
18
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
19 require 'hoe'
8182b44 @jimweirich Disabled CERTS for now.
jimweirich authored Feb 24, 2006
20
1ebe9f9 @jbarnette Pass --disable-gems when invoking tests.
jbarnette authored Nov 15, 2010
21 Hoe::RUBY_FLAGS << " --disable-gems" if RUBY_VERSION > "1.9"
22
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
23 Hoe.plugin :minitest
f195953 @zenspider - Fixed docs task with the world's worst rake hack
zenspider authored Jan 31, 2011
24 Hoe.plugin :git
bf55dc8 @drbrain Added hoe-travis plugin so we can yell at commiters who forget to upd…
drbrain authored Mar 26, 2012
25 Hoe.plugin :travis
f77a1ae @evanphx - Honor sysconfdir on 1.8. Fixes #291
evanphx authored Mar 6, 2012
26 # Hoe.plugin :isolate
3ab269d @jimweirich Fixed bug in release task so that the proper package versions are cre…
jimweirich authored Feb 27, 2005
27
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
28 hoe = Hoe.spec 'rubygems-update' do
29 self.rubyforge_name = 'rubygems'
30 self.author = ['Jim Weirich', 'Chad Fowler', 'Eric Hodel']
b0291cb @drbrain Merge release_notes/* into History.txt for Hoe. Streamlined setup.rb …
drbrain authored Jun 26, 2009
31 self.email = %w[rubygems-developers@rubyforge.org]
4b7c589 @jbarnette Update README contents and extension for our new GitHub home.
jbarnette authored Jul 1, 2010
32 self.readme_file = 'README.rdoc'
cf3df74 @jimweirich added Rakefile to package
jimweirich authored Nov 29, 2003
33
c6df065 @drbrain RubyGems doesn't require any previous version
drbrain authored Feb 12, 2010
34 spec_extras[:required_rubygems_version] = Gem::Requirement.default
80fa5ec @drbrain RubyGems 1.5 requires 1.8.7 or newer
drbrain authored Feb 1, 2011
35 spec_extras[:required_ruby_version] = Gem::Requirement.new '>= 1.8.7'
c6df065 @drbrain RubyGems doesn't require any previous version
drbrain authored Feb 12, 2010
36 spec_extras[:executables] = ['update_rubygems']
cf3df74 @jimweirich added Rakefile to package
jimweirich authored Nov 29, 2003
37
dc7bc84 @drbrain Add rdoc_location since the rubyforge plugin was removed
drbrain authored Mar 1, 2011
38 rdoc_locations <<
39 'rubyforge.org:/var/www/gforge-projects/rubygems/rubygems-update/'
40
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
41 clean_globs.push('**/debug.log',
42 '*.out',
43 '.config',
44 'data__',
45 'html',
46 'logs',
3aa56cf @drbrain Use rubygems, not rubygems-update when uploading
drbrain authored May 14, 2010
47 'graph.dot',
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
48 'pkgs/sources/sources*.gem',
d3a14e8 @drbrain No need to depend on util/gem_prelude.rb
drbrain authored Mar 26, 2010
49 'scripts/*.hieraki')
4c17ff0 @drbrain Switch to running all tests by default
drbrain authored Dec 21, 2006
50
ef53e55 @thewoolleyman working around bug in hoe check_extra_deps (http://rubyforge.org/trac…
thewoolleyman authored Jul 27, 2009
51 extra_dev_deps << ['builder', '~> 2.1']
52 extra_dev_deps << ['hoe-seattlerb', '~> 1.2']
53 extra_dev_deps << ['session', '~> 2.4']
fa6dd2b @zenspider Added isolate setup
zenspider authored Apr 15, 2011
54 extra_dev_deps << ['rdoc', '~> 3.0']
9d0daf5 @zenspider Added ZenTest to dev deps for isolate
zenspider authored May 3, 2011
55 extra_dev_deps << ['ZenTest', '~> 4.5']
2cc685b @drbrain Set title correctly, update ignore for Hoe
drbrain authored Jun 23, 2009
56
4b7c589 @jbarnette Update README contents and extension for our new GitHub home.
jbarnette authored Jul 1, 2010
57 self.extra_rdoc_files = Dir["*.rdoc"]
58
2cc685b @drbrain Set title correctly, update ignore for Hoe
drbrain authored Jun 23, 2009
59 spec_extras['rdoc_options'] = proc do |rdoc_options|
60 rdoc_options << "--title=RubyGems #{self.version} Documentation"
61 end
f195953 @zenspider - Fixed docs task with the world's worst rake hack
zenspider authored Jan 31, 2011
62
48a83c1 @evanphx Ignore setting times when publish docs
evanphx authored Mar 22, 2012
63 self.rsync_args += " --no-p -O"
639dd16 @evanphx Improve release process
evanphx authored Mar 22, 2012
64
f195953 @zenspider - Fixed docs task with the world's worst rake hack
zenspider authored Jan 31, 2011
65 # FIX: this exists because update --system installs the gem and
66 # doesn't uninstall it. It should uninstall or better, not install
67 # in the first place.
68 spec_extras['require_paths'] = %w[hide_lib_for_update] unless
69 ENV['RAKE_SUCKS']
70 end
71
72 task :docs => :rake_sucks
73 task :rake_sucks do
74 # This exists ENTIRELY because the rake design convention of
75 # RDocTask.new is broken. Because most of the work is being done
76 # inside initialize(?!?) BEFORE tasks are even running, too much
77 # stuff is set in stone, and we can't deal with the require_paths
78 # issue above.
79 unless ENV['RAKE_SUCKS'] then
80 ENV['RAKE_SUCKS'] = "1"
81 rm_rf "doc"
82 sh "rake docs"
83 end
cf3df74 @jimweirich added Rakefile to package
jimweirich authored Nov 29, 2003
84 end
039f311 @jimweirich Added generated test gem to clobber list.
jimweirich authored Apr 5, 2004
85
28a1432 @jimweirich release task ready for trying
jimweirich authored Dec 7, 2004
86 # --------------------------------------------------------------------
87 # Creating a release
88
b7f6270 @zenspider + Rewrote our last functional test suite to be happy and fast
zenspider authored Apr 12, 2011
89 task :prerelease => [:clobber, :check_manifest, :test]
6dadf01 @drbrain Fix some rake tasks for releasing
drbrain authored Apr 20, 2010
90
639dd16 @evanphx Improve release process
evanphx authored Mar 22, 2012
91 task :postrelease => [:publish_docs, :upload]
ac97012 @jimweirich Added rake task to create a new release (initial version).
jimweirich authored Dec 7, 2004
92
57d2a2a @drbrain Do our own tarring and zipping.
drbrain authored Jun 26, 2009
93 pkg_dir_path = "pkg/rubygems-update-#{hoe.version}"
ec2b2de @zenspider Fixed packaging breakage caused by us having a stupid gemname that do…
zenspider authored Dec 30, 2010
94 task :package do
57d2a2a @drbrain Do our own tarring and zipping.
drbrain authored Jun 26, 2009
95 mv pkg_dir_path, "pkg/rubygems-#{hoe.version}"
96 Dir.chdir 'pkg' do
97 sh "tar -czf rubygems-#{hoe.version}.tgz rubygems-#{hoe.version}"
98 sh "zip -q -r rubygems-#{hoe.version}.zip rubygems-#{hoe.version}"
d8fae3b @drbrain Rename packages from rubygems-update to rubygems
drbrain authored Jun 23, 2009
99 end
100 end
28a1432 @jimweirich release task ready for trying
jimweirich authored Dec 7, 2004
101
b246191 @evanphx Add gemcutter upload task using s3cmd
evanphx authored Feb 17, 2012
102 desc "Upload release to rubyforge"
39182ba @drbrain Add upload_to_rubyforge task for our unique scaling requirements
drbrain authored May 11, 2011
103 task :upload_to_rubyforge do
104 v = hoe.version
105 sh "rubyforge add_release rubygems rubygems #{v} pkg/rubygems-update-#{v}.gem"
106 sh "rubyforge add_file rubygems rubygems #{v} pkg/rubygems-#{v}.zip"
107 sh "rubyforge add_file rubygems rubygems #{v} pkg/rubygems-#{v}.tgz"
108 end
109
b246191 @evanphx Add gemcutter upload task using s3cmd
evanphx authored Feb 17, 2012
110 desc "Upload release to gemcutter S3"
111 task :upload_to_gemcutter do
112 v = hoe.version
113 sh "s3cmd put -P pkg/rubygems-update-#{v}.gem pkg/rubygems-#{v}.zip pkg/rubygems-#{v}.tgz s3://production.s3.rubygems.org/rubygems/"
114 end
115
116 desc "Upload release to rubyforge and gemcutter"
117 task :upload => [:upload_to_rubyforge, :upload_to_gemcutter]
118
f130ef7 @jimweirich Added Tasks to find FIXME and TODO notes.
jimweirich authored Oct 25, 2004
119 # Misc Tasks ---------------------------------------------------------
120
d81324d @drbrain Tasks for maintaining ruby trunk export of RubyGems.
drbrain authored Nov 12, 2007
121 # These tasks expect to have the following directory structure:
122 #
f8842c4 @drbrain Add special case for RUBY_ENGINE constant when setting Gem.dir.
drbrain authored Mar 9, 2008
123 # git/git.rubini.us/code # Rubinius git HEAD checkout
124 # svn/ruby/trunk # ruby subversion HEAD checkout
125 # svn/rubygems/trunk # RubyGems subversion HEAD checkout
64cac26 @drbrain Parameterize ruby path for Rakefile
drbrain authored Nov 12, 2007
126 #
f8842c4 @drbrain Add special case for RUBY_ENGINE constant when setting Gem.dir.
drbrain authored Mar 9, 2008
127 # If you don't have this directory structure, set RUBY_PATH and/or
128 # RUBINIUS_PATH.
d81324d @drbrain Tasks for maintaining ruby trunk export of RubyGems.
drbrain authored Nov 12, 2007
129
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
130 def rsync_with dir
131 rsync_options = "-avP --exclude '*svn*' --exclude '*swp' --exclude '*rbc'" +
37df5a6 @evanphx Fix typo
evanphx authored Apr 7, 2010
132 " --exclude '*.rej' --exclude '*.orig' --exclude 'lib/rubygems/defaults/*'"
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
133 sh "rsync #{rsync_options} bin/gem #{dir}/bin/gem"
134 sh "rsync #{rsync_options} lib/ #{dir}/lib"
3b1577a @drbrain Fix RUBY_PATH for me, gem_prelude is no longer rubygems' responsibility
drbrain authored Jul 26, 2011
135 sh "rsync #{rsync_options} test/ #{dir}/test"
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
136 end
64cac26 @drbrain Parameterize ruby path for Rakefile
drbrain authored Nov 12, 2007
137
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
138 def diff_with dir
139 diff_options = "-urpN --exclude '*svn*' --exclude '*swp' --exclude '*rbc'"
140 sh "diff #{diff_options} bin/gem #{dir}/bin/gem; true"
141 sh "diff #{diff_options} lib/ubygems.rb #{dir}/lib/ubygems.rb; true"
142 sh "diff #{diff_options} lib/rubygems.rb #{dir}/lib/rubygems.rb; true"
143 sh "diff #{diff_options} lib/rubygems #{dir}/lib/rubygems; true"
144 sh "diff #{diff_options} lib/rbconfig #{dir}/lib/rbconfig; true"
145 sh "diff #{diff_options} test #{dir}/test/rubygems; true"
7957649 @drbrain Send\! is gone again.
drbrain authored Nov 10, 2007
146 end
147
3b1577a @drbrain Fix RUBY_PATH for me, gem_prelude is no longer rubygems' responsibility
drbrain authored Jul 27, 2011
148 rubinius_dir = ENV['RUBINIUS_PATH'] || '../git.rubini.us/code'
149 ruby_dir = ENV['RUBY_PATH'] || '../../svn/ruby/trunk'
64cac26 @drbrain Parameterize ruby path for Rakefile
drbrain authored Nov 12, 2007
150
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
151 desc "Updates Ruby HEAD with the currently checked-out copy of RubyGems."
d3a14e8 @drbrain No need to depend on util/gem_prelude.rb
drbrain authored Mar 26, 2010
152 task :update_ruby do
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
153 rsync_with ruby_dir
f8842c4 @drbrain Add special case for RUBY_ENGINE constant when setting Gem.dir.
drbrain authored Mar 9, 2008
154 end
155
156 desc "Updates Rubinius HEAD with the currently checked-out copy of RubyGems."
d3a14e8 @drbrain No need to depend on util/gem_prelude.rb
drbrain authored Mar 26, 2010
157 task :update_rubinius do
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
158 rsync_with rubinius_dir
159 end
160
161 desc "Diffs Ruby HEAD with the currently checked-out copy of RubyGems."
d3a14e8 @drbrain No need to depend on util/gem_prelude.rb
drbrain authored Mar 26, 2010
162 task :diff_ruby do
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
163 diff_with ruby_dir
d81324d @drbrain Tasks for maintaining ruby trunk export of RubyGems.
drbrain authored Nov 12, 2007
164 end
165
f8842c4 @drbrain Add special case for RUBY_ENGINE constant when setting Gem.dir.
drbrain authored Mar 9, 2008
166 desc "Diffs Rubinius HEAD with the currently checked-out copy of RubyGems."
d3a14e8 @drbrain No need to depend on util/gem_prelude.rb
drbrain authored Mar 26, 2010
167 task :diff_rubinius do
67ef45a @zenspider hoe'd the rakefile
zenspider authored Jun 12, 2009
168 diff_with rubinius_dir
f8842c4 @drbrain Add special case for RUBY_ENGINE constant when setting Gem.dir.
drbrain authored Mar 9, 2008
169 end
9dca8ac @jbarnette Added 'rcov:for', a Rake task to help get coverage for a specific test.
jbarnette authored Sep 5, 2009
170
6acee29 @zenspider Added git:newchangelog task. much much improved
zenspider authored Mar 31, 2011
171 def changelog_section code
172 name = {
173 :major => "major enhancement",
174 :minor => "minor enhancement",
175 :bug => "bug fix",
176 :unknown => "unknown",
177 }[code]
178
179 changes = $changes[code]
180 count = changes.size
181 name += "s" if count > 1
182 name.sub!(/fixs/, 'fixes')
183
184 return if count < 1
185
186 puts "* #{count} #{name}:"
187 puts
188 changes.sort.each do |line|
189 puts " * #{line}"
190 end
191 puts
192 end
193
194 desc "Print the current changelog."
195 task "git:newchangelog" do
42ed898 Move code requiring a newer hoe inside task
Evan Phoenix authored Apr 1, 2011
196 # This must be in here until rubygems depends on the version of hoe that has
197 # git_tags
198 # TODO: get this code back into hoe-git
199 module Hoe::Git
200 module_function :git_tags, :git_svn?, :git_release_tag_prefix
201 end
202
6acee29 @zenspider Added git:newchangelog task. much much improved
zenspider authored Apr 1, 2011
203 tags = Hoe::Git.git_tags
204 tag = ENV["FROM"] || tags.last
205 range = [tag, "HEAD"].compact.join ".."
206 cmd = "git log #{range} '--format=tformat:%B|||%aN|||%aE|||'"
207 now = Time.new.strftime "%Y-%m-%d"
208
209 changes = `#{cmd}`.split(/\|\|\|/).each_slice(3).map do |msg, author, email|
210 msg.split(/\n/).reject { |s| s.empty? }
211 end
212
213 changes = changes.flatten
214
215 next if changes.empty?
216
217 $changes = Hash.new { |h,k| h[k] = [] }
218
219 codes = {
220 "!" => :major,
221 "+" => :minor,
222 "*" => :minor,
223 "-" => :bug,
224 "?" => :unknown,
225 }
226
227 codes_re = Regexp.escape codes.keys.join
228
229 changes.each do |change|
230 if change =~ /^\s*([#{codes_re}])\s*(.*)/ then
231 code, line = codes[$1], $2
232 else
233 code, line = codes["?"], change.chomp
234 end
235
236 $changes[code] << line
237 end
238
239 puts "=== #{ENV['VERSION'] || 'NEXT'} / #{now}"
240 puts
241 changelog_section :major
242 changelog_section :minor
243 changelog_section :bug
244 changelog_section :unknown
245 puts
246 end
86c7be0 @sferik Add task to remove trailing whitespace
sferik authored Jul 7, 2012
247
248 desc "Cleanup trailing whitespace"
249 task :whitespace do
250 system 'find . -not \( -name .svn -prune -o -name .git -prune \) -type f -print0 | xargs -0 sed -i "" -E "s/[[:space:]]*$//"'
251 end
Something went wrong with that request. Please try again.