Skip to content

Commit

Permalink
Merge branch 'master' into 0.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed Mar 22, 2016
2 parents 2edd0ee + e88e2a3 commit 3565110
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ script: 'bundle exec rake test:coverage --trace'
rvm:
- 2.2.4
- 2.3.0
- jruby-9000
- ruby-head
- jruby-9.0.5.0
- jruby-head

matrix:
allow_failures:
- rvm: ruby-head
- rvm: jruby-9.0.5.0
- rvm: jruby-head
- rvm: jruby-9000
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ end
gem 'hanami-utils', '~> 0.8', require: false, github: 'hanami/utils', branch: '0.8.x'
gem 'haml'

gem 'simplecov', require: false
gem 'coveralls', require: false
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The set of objects passed in the `deliver` call are called `locals` and are aval
require 'hanami/mailer'

User = Struct.new(:name, :username)
user = User.new('Luca', 'jodosha')
luca = User.new('Luca', 'jodosha')

Hanami::Mailer.load!

Expand All @@ -110,7 +110,7 @@ class WelcomeMailer
private

def recipient
user.email
luca.email
end
end

Expand All @@ -120,7 +120,7 @@ InvoiceMailer.deliver(user: luca)
The corresponding `erb` file:

```erb
Hello <%= user.name %>!
Hello <%= luca.name %>!
```

### Scope
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ end

namespace :test do
task :coverage do
ENV['COVERAGE'] = 'true'
ENV['COVERALL'] = 'true'
Rake::Task['test'].invoke
end
end
Expand Down
2 changes: 1 addition & 1 deletion hanami-mailer.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
spec.add_dependency 'mail', '~> 2.5'

spec.add_development_dependency 'bundler', '~> 1.10'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rake', '~> 11'
spec.add_development_dependency 'minitest', '~> 5.7'
end
10 changes: 10 additions & 0 deletions lib/hanami/mailer/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ module Mailer
#
# @since 0.1.0
module Dsl
# @since x.x.x
# @api private
def self.extended(base)
base.class_eval do
@from = nil
@to = nil
@subject = nil
end
end

# Set the template name IF it differs from the convention.
#
# For a given mailer named <tt>Signup::Welcome</tt> it will look for
Expand Down
14 changes: 2 additions & 12 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
require 'rubygems'
require 'bundler/setup'

if ENV['COVERAGE'] == 'true'
require 'simplecov'
if ENV['COVERALL']
require 'coveralls'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]

SimpleCov.start do
command_name 'test'
add_filter 'test'
end
Coveralls.wear!
end

require 'minitest/autorun'
Expand Down

0 comments on commit 3565110

Please sign in to comment.