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

Use default Rake tasks and scripts #55

Merged
merged 3 commits into from
Feb 7, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/vendor/gems
.bundle
bin
/*.gem
Gemfile.lock
/tmp
/vendor/gems
bin
Gemfile.lock
pkg/*.gem
8 changes: 8 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

task :default => :spec
1 change: 1 addition & 0 deletions jekyll-mentions.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Gem::Specification.new do |s|
s.add_dependency "html-pipeline", "~> 2.3"
s.add_dependency "jekyll", "~> 3.0"

s.add_development_dependency "rake", "~> 12.0"
s.add_development_dependency "rspec", "~> 3.0"
s.add_development_dependency "rubocop", "0.51"
end
8 changes: 5 additions & 3 deletions script/cibuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#! /bin/sh

bundle exec rspec
bundle exec rubocop -S -D
gem build jekyll-mentions.gemspec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not want to test that dependencies resolve and that the Gem builds?

Copy link
Member

@DirtyF DirtyF Feb 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do, default bundler rake task bundle exec rake build should take care of that.

set -e

script/test
script/fmt
bundle exec rake build
10 changes: 10 additions & 0 deletions script/fmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

echo "Rubocop $(bundle exec rubocop --version)"
bundle exec rubocop -D -E $@
success=$?
if ((success != 0)); then
echo -e "\nTry running \`script/fmt -a\` to automatically fix errors"
fi
exit $success
7 changes: 7 additions & 0 deletions script/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
# Tag and push a release.

set -e

script/cibuild
bundle exec rake release
4 changes: 4 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -ex

bundle exec rspec "$@"