-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.ruby-version | ||
.bundle | ||
*.gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
task default: :spec | ||
|
||
task :spec do | ||
sh "rspec" | ||
end | ||
|
||
task release: %i[clean spec git gem] do | ||
sh "echo gem push *.gem" | ||
|
||
sh "git tag v%s" % [version] | ||
sh "git push --tags" | ||
end | ||
|
||
task gem: %i[clean git] do | ||
version = ENV["VERSION"] || ENV["V"] | ||
abort "Specify VERSION=x.y.z to release" unless version | ||
|
||
require_relative "lib/faraday/restrict_ip_addresses/version" | ||
act = Faraday::RestrictIPAddresses::VERSION | ||
|
||
abort "Version specified doesn't match %p" % [act] unless act == version | ||
|
||
sh "gem build" | ||
end | ||
|
||
task :git do | ||
status = `git status --porcelain` | ||
abort "git looks dirty\n#{status}" unless status.lines.empty? | ||
end | ||
|
||
task :clean do | ||
rm_f Dir["**/*~", "*.gem"] | ||
end |