holy_cow 0.0.2 → 0.0.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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Mjc4YmFiYTBjM2RiMzEzMTAwZDM0MjA2NjgzY2EzN2Y1Nzg0NzBjMQ==
4
+ MDczOTIyM2RiM2FhYmY2YWQxNmMyZjM2MjI1M2M3ZDc2MGMxN2IwYQ==
5
5
  data.tar.gz: !binary |-
6
- MDA3ZmFhMTYzYjUzYTY5MDUyOTNkOTE1Y2UxNWQ1M2Q3NTdmMDRmNQ==
6
+ NWM0MDA5NmZiODE4YmY1NDE0ZGE3OTc2NTU3ZDA3OWU1ZmM1NDRlMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2I0ZjU3MWMyM2I0NWNlMGYzNGYxZmJmMTE1OGMxODA5MWE5ZTg1NGExY2Jh
10
- YzRhMTBlYTI4NGI3MzhmNjc4MWNiODZkMWY2NzBjNTIyZWRkNThjZTBlNGFj
11
- YzVkOTZiM2JkNzViMDA3NzQ5NDhiZWNkZGE5MThiYWMyNzFhNzM=
9
+ OTIxZWJjMzVlOGFkMTAwMzc2N2ExYjgxZTc1MGM4YmRlZmRjMmIzNGZlZjYx
10
+ ZGM0ODk4ZGY2NDYyZjQzOGQ4ZTJjMWI1MjMyMzY0YzljODI4Yzg1MjMxZjVh
11
+ ZThlY2E3MWM4NGFjY2Q5MGYwM2I3MGYwMTU4MWUyOWQ2NmJhYTk=
12
12
  data.tar.gz: !binary |-
13
- ODYxOTU3NTE4N2IwMGNmOThhNzI0ZWM2YzA3YjQzMjE3ODI4ZGViMDMxZTcw
14
- ZWQ0YmExYjc1MThiOTdlOGNhNGU4YmQ0MjQ2N2M5ZDdjZTg1MWU5YzU4NTA5
15
- ZDlmOTIwM2NlZWI0YWU4NDAxMDI0ZjMxYzNmMWZiYjI4Mjg0MWU=
13
+ NThjM2UzYTJmZjFkYTU3YjNmNzA4MTUwNTk3YjNkZDE0YjZiOGZiOTIyMTg2
14
+ OGUzY2Y0ZTQxODUwMTYwNjJiOWUzNTU1M2Y1YmI1ZTVmYTg2ZGI0NmVmOGE2
15
+ ZDEyODA0YTZmZTNkNDhiNDJmOTA5YTI0ZWUwYTkyMmUxNDk4YTE=
data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
1
  *.gem
2
2
  *.rbc
3
+ .DS_Store
3
4
  .bundle
4
5
  .config
5
6
  .yardoc
@@ -1,5 +1,11 @@
1
1
  module Kernel
2
2
  def holy_cow(*args)
3
- HolyCow::Mailer.notification(*args).deliver
3
+
4
+ if defined? Delayed::Job
5
+ HolyCow::Mailer.delay.notification(*args)
6
+ else
7
+ HolyCow::Mailer.notification(*args).deliver
8
+ end
9
+
4
10
  end
5
11
  end
@@ -1,11 +1,17 @@
1
1
  require 'action_mailer'
2
2
  require 'pp'
3
+ ActionMailer::Base.append_view_path File.join(File.dirname(__FILE__), "..")
3
4
  class HolyCow::Mailer < ActionMailer::Base
4
5
  def notification(*args)
5
6
  @subject = args.shift || "Somebody did something!"
6
- template = File.join(File.dirname(__FILE__), "..", "..", "template", "notification.html.erb")
7
- body = ERB.new(File.read(template))
8
7
  @things = args || []
9
- mail(from: HolyCow::from_address, to: HolyCow::recipients, subject: "[Holy Cow] #{@subject}", body: body.result(binding))
8
+ mail({
9
+ from: HolyCow::from_address,
10
+ to: HolyCow::recipients,
11
+ subject: "[Holy Cow] #{@subject}"
12
+ }) do |format|
13
+ format.html
14
+ format.text
15
+ end
10
16
  end
11
17
  end
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
5
+ </head>
6
+ <body>
7
+ <h1>Holy Cow!</h1>
8
+ <p>Somebody did something you (hopefully) care about! Here are the details</p>
9
+
10
+ <h2><%= @subject %></h2>
11
+ <pre>
12
+ <% @things.each do |thing| %>
13
+ <%= thing.pretty_inspect %>
14
+ <% end %>
15
+ </pre>
16
+ </body>
17
+ </html>
@@ -0,0 +1,9 @@
1
+ Holy Cow!
2
+
3
+ Somebody did something you (hopefully) care about! Here are the details:
4
+
5
+ <%= @subject %>
6
+
7
+ <% @things.each do |thing| %>
8
+ <%= thing.pretty_inspect %>
9
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module HolyCow
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: holy_cow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Samson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-03 00:00:00.000000000 Z
11
+ date: 2014-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -69,8 +69,9 @@ files:
69
69
  - lib/holy_cow.rb
70
70
  - lib/holy_cow/kernel.rb
71
71
  - lib/holy_cow/mailer.rb
72
+ - lib/holy_cow/mailer/notification.html.erb
73
+ - lib/holy_cow/mailer/notification.text.erb
72
74
  - lib/holy_cow/version.rb
73
- - template/notification.html.erb
74
75
  homepage: http://github.com/tenforwardconsulting/holy_cow
75
76
  licenses:
76
77
  - MIT
@@ -1,9 +0,0 @@
1
- <h1>Holy Cow!</h1>
2
- <p>Somebody did something you (hopefully) care about! Here are the details</p>
3
-
4
- <h2><%= @subject %></h2>
5
- <pre>
6
- <% @things.each do |thing| %>
7
- <%= thing.pretty_inspect %>
8
- <% end %>
9
- </pre>