mirror of
https://github.com/lostisland/faraday.git
synced 2025-12-06 00:01:23 -05:00
Use Bundler install tasks
This commit is contained in:
parent
faab1b08cd
commit
55c2418031
46
Rakefile
46
Rakefile
@ -2,6 +2,8 @@ require 'date'
|
||||
require 'fileutils'
|
||||
require 'openssl'
|
||||
require 'rake/testtask'
|
||||
require 'bundler'
|
||||
Bundler::GemHelper.install_tasks
|
||||
|
||||
task :default => :test
|
||||
|
||||
@ -67,47 +69,3 @@ desc "Open an irb session preloaded with this library"
|
||||
task :console do
|
||||
sh "irb -rubygems -r ./lib/#{name}.rb"
|
||||
end
|
||||
|
||||
## release management tasks
|
||||
|
||||
desc "Commit, create tag v#{version} and build and push #{gem_file} to Rubygems"
|
||||
task :release => :build do
|
||||
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
||||
sh "git tag v#{version}"
|
||||
sh "git push origin"
|
||||
sh "git push origin v#{version}"
|
||||
sh "gem push pkg/#{gem_file}"
|
||||
end
|
||||
|
||||
desc "Build #{gem_file} into the pkg directory"
|
||||
task :build => :gemspec do
|
||||
FileUtils.mkdir_p 'pkg'
|
||||
sh "gem build #{gemspec_file}"
|
||||
sh "mv #{gem_file} pkg"
|
||||
end
|
||||
|
||||
desc "Generate #{gemspec_file}"
|
||||
task :gemspec do
|
||||
# read spec file and split out manifest section
|
||||
spec = File.read(gemspec_file)
|
||||
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
||||
|
||||
# replace name version and date
|
||||
replace_header(head, :name)
|
||||
replace_header(head, :version)
|
||||
|
||||
# determine file list from git ls-files
|
||||
files = `git ls-files`.
|
||||
split("\n").
|
||||
sort.
|
||||
reject { |file| file =~ /^\./ }.
|
||||
reject { |file| file =~ /^(rdoc|pkg)/ }.
|
||||
map { |file| " #{file}" }.
|
||||
join("\n")
|
||||
|
||||
# piece file back together and write
|
||||
manifest = " s.files = %w[\n#{files}\n ]\n"
|
||||
spec = [head, manifest, tail].join(" # = MANIFEST =\n")
|
||||
File.open(gemspec_file, 'w') { |io| io.write(spec) }
|
||||
puts "Updated #{gemspec_file}"
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user