courier 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
data/courier.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{courier}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Danil Pismenny"]
@@ -18,8 +18,11 @@ class Courier::Service::GritterNotice < Courier::Service::Base
18
18
  #
19
19
 
20
20
  def message(owner, template, options)
21
- options[:scope]=[:courier, :gritter_notice] unless options[:scope]
22
- owner.gritter_notice template.name, I18n::translate(template.name, options )
21
+ scope = [:courier, :gritter_notice]
22
+ opt = I18n::translate(template.name, :scope=>scope)
23
+ opt.merge!(options)
24
+ opt[:text]||=I18n::translate([template.name,:text], opt.merge(:scope=>scope) )
25
+ owner.gritter_notice template.name, opt
23
26
  end
24
27
 
25
28
  def deliver!
@@ -7,7 +7,8 @@ describe Courier::Service::GritterNotice do
7
7
  args={:a=>1}
8
8
  owner = double
9
9
  template = double :name=>:template_key
10
- owner.should_receive(:gritter_notice).with(template.name, "translation missing: en.courier.gritter_notice.template_key")
10
+ I18n.should_receive(:translate).with(template.name, :scope=>[:courier, :gritter_notice]) {{:text=>'text of translation', :level=>:warning} }
11
+ owner.should_receive(:gritter_notice).with(template.name, {:text=>"text of translation", :a=>1, :level=>:warning})
11
12
  subject.message owner, template, args
12
13
  end
13
14
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: courier
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Danil Pismenny