hyouki 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,16 +4,14 @@ class HyoukiController < ApplicationController
4
4
  def show
5
5
  klass = params[:class].classify.gsub(/::(\w)/) { |s| s.upcase }.constantize
6
6
  args = params[:args].split(',').collect { |a| eval(a) }
7
- @mail = klass.send(params[:method], *args)
8
-
9
- @type = params[:type] || 'plain'
10
7
 
11
- @body = if @mail.multipart?
12
- @mail.parts.select { |part|
13
- part.content_type =~ /#{@type}/
14
- }.first.body.to_s
8
+ @type = params[:type] || 'html'
9
+ @mail = klass.send(params[:method], *args)
10
+ @parts = PremailerRails::Hook.delivering_email(@mail)
11
+ @body = if @parts.count > 1
12
+ @parts.select { |part| part.content_type =~ /#{@type}/ }.first.body.to_s
15
13
  else
16
- @mail.body.to_s
14
+ @parts.first.body.to_s
17
15
  end
18
16
  end
19
17
  end
@@ -14,4 +14,7 @@ Gem::Specification.new do |gem|
14
14
  gem.name = "hyouki"
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Hyouki::VERSION
17
+
18
+ gem.add_dependency('premailer-rails3')
19
+ gem.add_dependency('rails', ['~> 3'])
17
20
  end
@@ -1,3 +1,3 @@
1
1
  module Hyouki
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyouki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,29 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 2012-05-18 00:00:00.000000000Z
13
- dependencies: []
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: premailer-rails3
16
+ requirement: &70247243831080 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70247243831080
25
+ - !ruby/object:Gem::Dependency
26
+ name: rails
27
+ requirement: &70247243829440 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70247243829440
14
36
  description: A better way to view and design emails.
15
37
  email:
16
38
  - russ@bashme.org