Closed lmarburger closed 7 years ago
What's wrong with rakegem?
I like the idea of gemspecs being self-contained and not depending on globs and file locations for things like versions.
As far as the scripts instead of rake tasks... I am not sure if I have a strong opinion of it — I can't see a compelling reason for one or the other. It seems like it's pretty much the same thing.
There's nothing wrong with rakegem. I just found it easier to handwrite simple gemspecs like this since the only thing that's variable is the file list and version number.
There isn't much of a difference between using rake or scripts for these things. In this case, the package and release tasks are just a series of shell commands. This is one less dependency and abstraction.
task :build => :gemspec do
sh "mkdir -p pkg"
sh "gem build #{gemspec_file}"
sh "mv #{gem_file} pkg"
end
task :release => :build do
sh "git commit --allow-empty -a -m 'Release #{version}'"
sh "git tag v#{version}"
sh "git push origin master"
sh "git push origin v#{version}"
sh "gem push pkg/#{name}-#{version}.gem"
end
# script/package
mkdir -p pkg
gem build *.gemspec
mv *.gem pkg
# script/release
git commit --allow-empty -a -m "Release #{version}"
git tag "v$version"
git push origin master
git push origin "v$version"
gem push pkg/*-${version}.gem
Rakegem isn't really getting us much. This commit replaces the generated gemspec with a simpler one. The
rake {build,release}
tasks have been moved toscript/{package,release}
.This is basically a direct copy from Faraday's gemspec and build scripts.