Merge branch 'develop' into unstable

This commit is contained in:
Luca Guidi 2017-11-29 11:17:06 +01:00
commit 61bb681178
No known key found for this signature in database
GPG Key ID: 6DD4B47E0C5657B4
12 changed files with 78 additions and 15 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@
.greenbar
.rubocop-*
measurements
.byebug_history

4
.rubocop.yml Normal file
View File

@ -0,0 +1,4 @@
# Please keep AllCops, Bundler, Style, Metrics groups and then order cops
# alphabetically
inherit_from:
- https://raw.githubusercontent.com/hanami/devtools/master/.rubocop.yml

View File

@ -1,16 +1,12 @@
language: ruby
sudo: false
cache: bundler
before_install:
- gem update --system
- rvm @global do gem uninstall bundler -a -x
- rvm @global do gem install bundler -v 1.13.7
script: 'bundle exec rake --trace'
script: ./script/ci
rvm:
- 2.3.3
- 2.4.0
- 2.3.5
- 2.4.2
- ruby-head
- jruby-9.1.6.0
- jruby-9.1.13.0
- jruby-head
matrix:

View File

@ -1,6 +1,16 @@
# Hanami::Mailer
Mail for Ruby applications
## v1.1.0 - 2017-10-25
## v1.1.0.rc1 - 2017-10-16
## v1.1.0.beta3 - 2017-10-04
## v1.1.0.beta2 - 2017-10-03
## v1.1.0.beta1 - 2017-08-11
## v1.0.0 - 2017-04-06
## v1.0.0.rc1 - 2017-03-31

View File

@ -6,7 +6,8 @@ unless ENV['TRAVIS']
gem 'yard', require: false
end
gem 'hanami-utils', '~> 1.0', require: false, git: 'https://github.com/hanami/utils.git', branch: '1.0.x'
gem 'hanami-utils', '~> 1.1', require: false, git: 'https://github.com/hanami/utils.git', branch: 'unstable'
gem 'haml'
gem 'hanami-devtools', require: false, git: 'https://github.com/hanami/devtools.git'
gem 'coveralls', require: false

View File

@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 2.3.0'
spec.add_dependency 'hanami-utils', '~> 1.0'
spec.add_dependency 'hanami-utils', '~> 1.1'
spec.add_dependency 'tilt', '~> 2.0', '>= 2.0.1'
spec.add_dependency 'mail', '~> 2.6'

View File

@ -1 +1 @@
require 'hanami/mailer' # rubocop:disable Style/FileName
require 'hanami/mailer' # rubocop:disable Naming/FileName

View File

@ -31,7 +31,7 @@ module Hanami
# @api private
def compile!(namespace)
tokens(namespace) { |token| replace!(token) }
@name = Utils::String.new(@name).underscore
@name = Utils::String.underscore(@name)
end
# @since 0.1.0

View File

@ -1,6 +1,6 @@
module Hanami
module Mailer
# @since 0.1.0
VERSION = '1.0.0'.freeze
VERSION = '1.1.0'.freeze
end
end

51
script/ci Executable file
View File

@ -0,0 +1,51 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
run_code_quality_checks() {
bundle exec rubocop .
}
run_unit_tests() {
bundle exec rake spec:coverage
}
run_isolation_tests() {
local pwd=$PWD
local root="$pwd/spec/isolation"
if [ -d $root ]; then
for test in $(find $root -name '*_spec.rb')
do
run_isolation_test $test
if [ $? -ne 0 ]; then
local exit_code=$?
echo "Failing test: $test"
exit $exit_code
fi
done
fi
}
run_isolation_test() {
local test=$1
printf "\n\n\nRunning: $test\n"
ruby $test --options spec/isolation/.rspec
}
run_test() {
local test=$1
printf "\n\n\nRunning: $test\n"
COVERAGE=true bundle exec rspec $test
}
main() {
run_code_quality_checks &&
run_unit_tests &&
run_isolation_tests
}
main

View File

@ -21,7 +21,7 @@ RSpec.describe Hanami::Mailer do
describe 'when no value is set' do
it 'returns a set of templates' do
template_formats = LazyMailer.templates.keys
expect(template_formats).to eq(%i(html txt))
expect(template_formats).to eq(%i[html txt])
end
it 'returns only the template for the given format' do

View File

@ -1,5 +1,5 @@
RSpec.describe "Hanami::Mailer::VERSION" do
it "returns current version" do
expect(Hanami::Mailer::VERSION).to eq("1.0.0")
expect(Hanami::Mailer::VERSION).to eq("1.1.0")
end
end