pakyow-mailer 1.0.0.rc3 → 1.0.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b4d3468a4d716db14619118efd7afa86087710cd14f724daa45f5d10efecaaa
4
- data.tar.gz: fc3b42e047af5f8daa8518135617cdd7f42969615a217ecf2464e14fec130f15
3
+ metadata.gz: 593f907e323c83b9fe1c0881e58a3d0b3375af9bd196755a1d9217de2a6c0d6d
4
+ data.tar.gz: a21d91d6640c8bd5be73a9a27628d1225f656fa7f5120bd05d0a690ddbf2121a
5
5
  SHA512:
6
- metadata.gz: 266957f4c33df2b05c9e1ea2064a7a9c262048b50cd284402789446a83253049f0c97f1c33ae365448dc303af2ae8e0ff01a1a685b144df9885f19d2414cddc5
7
- data.tar.gz: dfd27d607e2d47dc27a3e45244640fdaf258d2da84c61a3bae587a0cdb38bc8a071e6d93e9a003804658ccf488d6ee4e143be4d61dea5e19ab7bbadc5a007305
6
+ metadata.gz: 99b093bb6566bd820d9e4446472067e409088f124d6fe4f4a22fc55b7860c35f14860c324b523041be29ce0936a1ad04c29783f2cd761787b24ec446f38da01a
7
+ data.tar.gz: 1216bb42a7cd71bba6632fd8457f3af90f0c0c8f1d18f68ea725de1eb3fd38fb43729e28c025d93d72bc43618b87a841f9a3bf56a581b0eb742c9fcdf727cf44
@@ -31,6 +31,28 @@ module Pakyow
31
31
  unless const_defined?(:MailRenderer, false)
32
32
  const_set(:MailRenderer, mail_renderer)
33
33
  end
34
+
35
+ def mailer(path = nil, presentables)
36
+ if path
37
+ renderer = isolated(:MailRenderer).new(
38
+ app: self,
39
+ presentables: presentables,
40
+ presenter_class: isolated(:MailRenderer).find_presenter(self, path),
41
+ composer: Presenter::Composers::View.new(path, app: self)
42
+ )
43
+
44
+ Mailer.new(
45
+ renderer: renderer,
46
+ config: config.mailer,
47
+ logger: Pakyow.logger
48
+ )
49
+ else
50
+ Mailer.new(
51
+ config: config.mailer,
52
+ logger: Pakyow.logger
53
+ )
54
+ end
55
+ end
34
56
  end
35
57
  end
36
58
  end
@@ -4,33 +4,16 @@ module Pakyow
4
4
  module Mailer
5
5
  module Helpers
6
6
  def mailer(path = nil)
7
- if path
8
- connection = @connection.dup
7
+ connection = @connection.dup
8
+ mailer = app.mailer(path, connection.values)
9
9
 
10
- renderer = connection.app.isolated(:MailRenderer).new(
11
- app: connection.app,
12
- presentables: connection.values,
13
- presenter_class: connection.app.isolated(:MailRenderer).find_presenter(connection.app, path),
14
- composer: Presenter::Composers::View.new(path, app: @connection.app)
15
- )
16
-
17
- Mailer.new(
18
- renderer: renderer,
19
- config: app.config.mailer,
20
- logger: connection.logger
21
- ).tap do |mailer|
22
- if block_given?
23
- context = dup
24
- context.instance_variable_set(:@connection, connection)
25
- context.instance_exec(mailer, &Proc.new)
26
- end
27
- end
28
- else
29
- Mailer.new(
30
- config: app.config.mailer,
31
- logger: @connection.logger
32
- )
10
+ if block_given?
11
+ context = dup
12
+ context.instance_variable_set(:@connection, connection)
13
+ context.instance_exec(mailer, &Proc.new)
33
14
  end
15
+
16
+ mailer
34
17
  end
35
18
  end
36
19
  end
@@ -113,6 +113,7 @@ module Pakyow
113
113
 
114
114
  # @api private
115
115
  def rpad(message, offset = 0)
116
+ message = message.to_s
116
117
  message + " " * (76 + offset - message.length)
117
118
  end
118
119
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pakyow-mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc3
4
+ version: 1.0.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Powell
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-07-09 00:00:00.000000000 Z
12
+ date: 2019-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pakyow-assets
@@ -17,70 +17,70 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 1.0.0.rc3
20
+ version: 1.0.0.rc4
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 1.0.0.rc3
27
+ version: 1.0.0.rc4
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: pakyow-core
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 1.0.0.rc3
34
+ version: 1.0.0.rc4
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 1.0.0.rc3
41
+ version: 1.0.0.rc4
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: pakyow-presenter
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - '='
47
47
  - !ruby/object:Gem::Version
48
- version: 1.0.0.rc3
48
+ version: 1.0.0.rc4
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - '='
54
54
  - !ruby/object:Gem::Version
55
- version: 1.0.0.rc3
55
+ version: 1.0.0.rc4
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: pakyow-routing
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - '='
61
61
  - !ruby/object:Gem::Version
62
- version: 1.0.0.rc3
62
+ version: 1.0.0.rc4
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - '='
68
68
  - !ruby/object:Gem::Version
69
- version: 1.0.0.rc3
69
+ version: 1.0.0.rc4
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: pakyow-support
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - '='
75
75
  - !ruby/object:Gem::Version
76
- version: 1.0.0.rc3
76
+ version: 1.0.0.rc4
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - '='
82
82
  - !ruby/object:Gem::Version
83
- version: 1.0.0.rc3
83
+ version: 1.0.0.rc4
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: css_parser
86
86
  requirement: !ruby/object:Gem::Requirement