Skip to content

Commit

Permalink
Merge pull request #19 from bhuga/zenspider/rakefile
Browse files Browse the repository at this point in the history
Added rakefile
  • Loading branch information
zenspider authored Sep 30, 2024
2 parents d1b424c + dde0494 commit 572dda1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
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

0 comments on commit 572dda1

Please sign in to comment.