Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added rakefile #19

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.ruby-version
.bundle
*.gem
33 changes: 33 additions & 0 deletions Rakefile
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