freya 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee0cf741505e141c70e5588398c6485f55cb91fe
4
- data.tar.gz: fa10cc2a0e74e6fa7d5f72a129e5c5b6e0b76afd
3
+ metadata.gz: f01369cd30ce22394b543d5dc6b12b0141ac7569
4
+ data.tar.gz: add304557f6143949a50e172842d90e0986b214b
5
5
  SHA512:
6
- metadata.gz: c5449860e7dbb32aba3b5bced7fea1dbfc0c1ae9265d2581f681c068600b9b4f521e62692c84e76238f56f4e890b1ea442e958e7a3f2fc5dd798274b77641aa2
7
- data.tar.gz: 8337a019c39a586bb10b4b1afa1111738fb0a962030cfe5d6f97d0804b52f5c49b6bc3d8331cce1ff81d19a4aa499ecbabef34c6713b5689141774b5af4c0a68
6
+ metadata.gz: bfd10d236ddd8019f60fb11c6e56dda25bd8ec2aa7a3b2d5e64cc4f883130229caab866730d89ce753404ac428d19671fca003b3aa6b70ab2700958c11503b92
7
+ data.tar.gz: 4949fa431988eae9640baadfe809c51c3f0179833707ff6a5053bdccb477c9ecf36b074dd2d235891a9039e9af149ae5c605925eeef7a74b43b1f866ef5a0163
@@ -25,13 +25,14 @@ module Freya
25
25
 
26
26
  class Email
27
27
  attr_accessor :name, :to, :subject, :cc, :bcc
28
+ cattr_accessor :cc, :bcc
28
29
 
29
30
  def initialize(options = {})
30
31
  @name = options[:name]
31
32
  @to = options[:to]
32
33
  @subject = options[:subject]
33
- @cc = options[:cc] || []
34
- @bcc = options[:bcc] || []
34
+ @cc = options[:cc]
35
+ @bcc = options[:bcc]
35
36
  end
36
37
 
37
38
  def link
@@ -55,11 +56,11 @@ module Freya
55
56
  end
56
57
 
57
58
  def cc
58
- @cc - [to]
59
+ self.class.cc.to_a + @cc.to_a - [to]
59
60
  end
60
61
 
61
62
  def bcc
62
- @bcc - [to]
63
+ self.class.bcc.to_a + @bcc.to_a - [to]
63
64
  end
64
65
  end
65
66
  end
@@ -1,3 +1,3 @@
1
1
  module Freya
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -60,6 +60,20 @@ describe Freya::Email do
60
60
  Freya::Email.new(name: 'test_email', to: 'test@test.com', bcc: ['test@test.com', 'test1@test.com']).bcc.should eq(['test1@test.com'])
61
61
  end
62
62
  end
63
+
64
+ describe '#self.cc' do
65
+ it 'contains the base ccs' do
66
+ Freya::Email.stub(cc: ['base_email@test.com'])
67
+ Freya::Email.new(name: 'test_email', to: 'test@test.com', cc: ['test@test.com', 'test2@test.com']).cc.should eq(['base_email@test.com', 'test2@test.com'])
68
+ end
69
+ end
70
+
71
+ describe '#self.bcc' do
72
+ it 'contains the base bccs' do
73
+ Freya::Email.stub(bcc: ['base_email@test.com'])
74
+ Freya::Email.new(name: 'test_email', to: 'test@test.com', bcc: ['test@test.com', 'test1@test.com']).bcc.should eq(['base_email@test.com', 'test1@test.com'])
75
+ end
76
+ end
63
77
  end
64
78
 
65
79
  describe Freya::Template do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freya
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Depalo