grimen-awesome_email 0.1.0 → 0.1.3

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.
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ require 'rubygems'
1
2
  require 'rake'
2
3
  require 'rake/testtask'
3
4
  require 'rake/rdoctask'
@@ -7,11 +8,10 @@ SUMMARY = %Q{Rails ActionMailer with HTML layouts, inline CSS and entity substit
7
8
  HOMEPAGE = "http://github.com/grimen/#{NAME}/tree/master"
8
9
  AUTHORS = ["imedo GmbH"]
9
10
  EMAIL = "entwickler@imedo.de"
10
-
11
- require 'rubygems'
12
- gem 'technicalpickles-jeweler', '1.2.1'
11
+ SUPPORT_FILES = %w(README.textile)
13
12
 
14
13
  begin
14
+ gem 'technicalpickles-jeweler', '>= 1.2.1'
15
15
  require 'jeweler'
16
16
  Jeweler::Tasks.new do |gem|
17
17
  gem.name = NAME
@@ -22,7 +22,7 @@ begin
22
22
  gem.email = EMAIL
23
23
 
24
24
  gem.require_paths = %w{lib}
25
- gem.files = %w(MIT-LICENSE README.textile Rakefile) + Dir.glob(File.join('{lib,rails,test}', '**', '*'))
25
+ gem.files = SUPPORT_FILES << %w(MIT-LICENSE Rakefile) << Dir.glob(File.join('{lib,rails,test}', '**', '*'))
26
26
  gem.executables = %w()
27
27
  gem.extra_rdoc_files = %w{README.textile}
28
28
  end
@@ -45,6 +45,6 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
45
45
  rdoc.rdoc_dir = 'rdoc'
46
46
  rdoc.title = NAME
47
47
  rdoc.options << '--line-numbers' << '--inline-source' << '--charset=UTF-8'
48
- rdoc.rdoc_files.include('README.textile')
48
+ rdoc.rdoc_files.include(SUPPORT_FILES)
49
49
  rdoc.rdoc_files.include(File.join('lib', '**', '*.rb'))
50
50
  end
data/rails/init.rb CHANGED
@@ -1 +1 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), 'lib', '..', 'awesome_email.rb'))
1
+ require File.expand_path(File.join(File.dirname(__FILE__), *%w(.. lib awesome_email)))
@@ -16,7 +16,7 @@ require 'test_helper'
16
16
 
17
17
  ActionMailer::Base.delivery_method = :test
18
18
 
19
- RAILS_ROOT = '/' << File.join('some', 'dir')
19
+ RAILS_ROOT = File.join('', 'some', 'dir')
20
20
  CSS_TEST_FILE = File.join(RAILS_ROOT, 'public', 'stylesheets', 'mails', 'test.css')
21
21
 
22
22
  #################################################################
@@ -29,35 +29,35 @@ class SimpleMailer < ActionMailer::Base
29
29
  layout 'test'
30
30
  end
31
31
 
32
- protected
33
-
34
- def setup_multipart_mail
35
- headers 'Content-transfer-encoding' => '8bit'
36
- sent_on Time.now
37
- content_type 'text/html'
38
- end
39
-
40
- def html_part?(method_name)
41
- true
42
- end
43
-
44
- def render_content_for_layout(method_name, template)
45
- 'test inner content'
46
- end
47
-
48
- # mock rendering
49
- def render_layout_template(template, method_name, layout_path = File.join('layouts', 'mailers'))
50
- return template.render(:inline => "<html><body><h1>Fäncy</h1><p><%= yield %></p></body></html>")
51
- html = %{
52
- <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">
53
- <html>
54
- <head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head>
55
- <body><p><%= yield %></p></body>
56
- </html>
57
- }
58
- return template.render(:inline => html)
59
- end
60
-
32
+ protected
33
+
34
+ def setup_multipart_mail
35
+ headers 'Content-transfer-encoding' => '8bit'
36
+ sent_on Time.now
37
+ content_type 'text/html'
38
+ end
39
+
40
+ def html_part?(method_name)
41
+ true
42
+ end
43
+
44
+ def render_content_for_layout(method_name, template)
45
+ 'test inner content'
46
+ end
47
+
48
+ # mock rendering
49
+ def render_layout_template(template, method_name, layout_path = File.join('layouts', 'mailers'))
50
+ return template.render(:inline => "<html><body><h1>Fäncy</h1><p><%= yield %></p></body></html>")
51
+ html = %{
52
+ <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">
53
+ <html>
54
+ <head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head>
55
+ <body><p><%= yield %></p></body>
56
+ </html>
57
+ }
58
+ return template.render(:inline => html)
59
+ end
60
+
61
61
  end
62
62
 
63
63
  ###############################################################
@@ -103,8 +103,7 @@ class AwesomeEmailTest < Test::Unit::TestCase
103
103
  #######################
104
104
 
105
105
  def test_should_build_correct_find_css_file_name
106
-
107
- assert_equal CSS_TEST_FILE, @mailer.build_css_file_name("test")
106
+ assert_equal CSS_TEST_FILE, @mailer.build_css_file_name('test')
108
107
  end
109
108
 
110
109
  def test_should_build_correct_file_name_from_set_css
@@ -166,7 +165,7 @@ class AwesomeEmailTest < Test::Unit::TestCase
166
165
  def test_should_extend_with_mailer_name
167
166
  template_name = 'some_mail'
168
167
  result = @mailer.extend_with_mailer_name(template_name)
169
- assert_equal "my_mailer/#{template_name}", result
168
+ assert_equal File.join('my_mailer', template_name), result
170
169
  end
171
170
 
172
171
  # make sure the accessors are available
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grimen-awesome_email
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - imedo GmbH
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-31 00:00:00 -07:00
12
+ date: 2009-09-11 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -33,7 +33,7 @@ files:
33
33
  - rails/init.rb
34
34
  - test/awesome_email_test.rb
35
35
  - test/test_helper.rb
36
- has_rdoc: true
36
+ has_rdoc: false
37
37
  homepage: http://github.com/grimen/awesome_email/tree/master
38
38
  post_install_message:
39
39
  rdoc_options:
@@ -57,7 +57,7 @@ requirements: []
57
57
  rubyforge_project:
58
58
  rubygems_version: 1.2.0
59
59
  signing_key:
60
- specification_version: 2
60
+ specification_version: 3
61
61
  summary: Rails ActionMailer with HTML layouts, inline CSS and entity substitution.
62
62
  test_files:
63
63
  - test/awesome_email_test.rb