no_notifier_needed 0.1.8 → 0.1.9

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.8
1
+ 0.1.9
@@ -6,10 +6,11 @@ module NoNotifierNeeded
6
6
  #TODO
7
7
  #Pass defaults to allow for this to work
8
8
  #::ActionMailer::Base.send(:include, ActionView::Helpers::)
9
-
10
9
  NoNotifierNeeded::Send.send(:include, Rails.application.routes.url_helpers) # brings ActionDispatch::Routing::UrlFor
11
10
  NoNotifierNeeded::Send.send(:include, ActionView::Helpers::UrlHelper)
12
11
  NoNotifierNeeded::Send.send(:include, ActionView::Helpers::TextHelper)
12
+ NoNotifierNeeded::Send.send(:include, ActionView::Helpers::TagHelper)
13
+
13
14
  end
14
15
  end
15
16
  end
@@ -33,7 +33,7 @@ module NoNotifierNeeded
33
33
  elsif a.is_a?(Hash)
34
34
  a.each{|k,v| th[k.to_sym] = CGI.escapeHTML(v) }
35
35
  else
36
- raise ArgumentError.new("Unknown values passed to email procesor '#{a}' with #{args.inspect}")
36
+ raise ArgumentError.new("Unknown values passed to email procesor '#{a}' with ::#{args.inspect}::")
37
37
  end
38
38
  end
39
39
  th
@@ -1,31 +1,5 @@
1
1
  module NoNotifierNeeded
2
2
  module Translate
3
- def url_for(destination)
4
- unless destination.is_a?(Hash) || destination.match(/_path/i)
5
- raise ArgumentError.new(" must pass something that ends with a _path. #{destination} sent.")
6
- end
7
- to_send = "Rails.application.routes.url_helpers.#{destination}"
8
- instance_eval to_send
9
- end
10
-
11
- def email_link_to(title, link)
12
- return title if link.blank?
13
- if link.match(/http:\/\/[\w*\.]*\//i)
14
- root_link = link
15
- else
16
- splitter = NoNotifierNeeded.send(:host).split('/').last
17
-
18
- link_broken = link.split(splitter).last
19
- link_broken = link_broken.split('/').reject{|e| e.blank?}.join('/')
20
- if NoNotifierNeeded.send(:host).last == "/"
21
- root_link = NoNotifierNeeded.send(:host) + link_broken
22
- else
23
- root_link = NoNotifierNeeded.send(:host) + "/" + link_broken
24
- end
25
- end
26
- "<a href='#{root_link}'>#{title}</a>"
27
- end
28
-
29
3
  def get_send_hash(template)
30
4
  send_hash = base_send_hash(template)
31
5
  send_hash[:subject] = render_template_subject_type(@template)
@@ -63,7 +37,10 @@ module NoNotifierNeeded
63
37
  end
64
38
 
65
39
  def known_models
66
- @known_models || @known_models = ActiveRecord::Base.send( :subclasses )
40
+ @known_models if @known_models
41
+ @known_models = ActiveRecord::Base.send( :subclasses )
42
+ @known_models += @known_models.collect{|k| k.send(:subclass) }.flatten.uniq
43
+ @known_models.uniq!
67
44
  end
68
45
  end
69
46
  end
@@ -0,0 +1,11 @@
1
+ module NoNotifierNeeded
2
+ module UrlHelper
3
+ def url_for(destination)
4
+ unless destination.is_a?(Hash) || destination.match(/_path/i)
5
+ raise ArgumentError.new(" must pass something that ends with a _path. #{destination} sent.")
6
+ end
7
+ to_send = "Rails.application.routes.url_helpers.#{destination}"
8
+ instance_eval to_send
9
+ end
10
+ end
11
+ end
@@ -2,6 +2,7 @@ require 'no_notifier_needed/send'
2
2
  require 'no_notifier_needed/translate'
3
3
  require 'no_notifier_needed/render'
4
4
  require 'no_notifier_needed/sender'
5
+ require "no_notifier_needed/url_helper"
5
6
  require 'no_notifier_needed/config'
6
7
 
7
8
  module NoNotifierNeeded
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "no_notifier_needed"
8
- s.version = "0.1.8"
8
+ s.version = "0.1.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Robert R. Meyer"]
12
- s.date = "2013-01-17"
12
+ s.date = "2013-01-24"
13
13
  s.description = "A work in progress"
14
14
  s.email = "Blue.Dog.Archolite@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
34
34
  "lib/no_notifier_needed/send.rb",
35
35
  "lib/no_notifier_needed/sender.rb",
36
36
  "lib/no_notifier_needed/translate.rb",
37
+ "lib/no_notifier_needed/url_helper.rb",
37
38
  "no_notifier_needed.gemspec",
38
39
  "test/helper.rb",
39
40
  "test/test_no_notifier_needed.rb"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: no_notifier_needed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-17 00:00:00.000000000 Z
12
+ date: 2013-01-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: haml
@@ -148,6 +148,7 @@ files:
148
148
  - lib/no_notifier_needed/send.rb
149
149
  - lib/no_notifier_needed/sender.rb
150
150
  - lib/no_notifier_needed/translate.rb
151
+ - lib/no_notifier_needed/url_helper.rb
151
152
  - no_notifier_needed.gemspec
152
153
  - test/helper.rb
153
154
  - test/test_no_notifier_needed.rb
@@ -166,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
167
  version: '0'
167
168
  segments:
168
169
  - 0
169
- hash: -2106490006718562564
170
+ hash: -3153316471366559583
170
171
  required_rubygems_version: !ruby/object:Gem::Requirement
171
172
  none: false
172
173
  requirements: