printr 0.1.3 → 0.1.4

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.
Files changed (3) hide show
  1. data/lib/printr.rb +11 -1
  2. data/printr.gemspec +1 -1
  3. metadata +2 -2
data/lib/printr.rb CHANGED
@@ -111,8 +111,14 @@ module Printr
111
111
  end
112
112
  def print_to(key,text)
113
113
  key = key.to_sym
114
+ if text.nil? then
115
+ puts "[Printr] Umm...text is nil dudes..."
116
+ return
117
+ end
114
118
  begin
115
119
  text = sanitize(text)
120
+ if text.nil? then
121
+ puts "[Printr] Sanitize nillified the text..."
116
122
  t = Printr.printrs[key].class
117
123
  if Printr.printrs[key].class == File then
118
124
  Printr.printrs[key].write text
@@ -143,7 +149,7 @@ module Printr
143
149
  text.gsub!(Printr.sanitize_tokens[i],Printr.sanitize_tokens[i+1])
144
150
  i += 2
145
151
  end while i < Printr.sanitize_tokens.length
146
- text
152
+ return text
147
153
  end
148
154
  def template(name,bndng)
149
155
  puts "[Printr] attempting to print with template #{RAILS_ROOT}/app/views/printr/#{name}.prnt.erb"
@@ -151,9 +157,13 @@ module Printr
151
157
  erb = ERB.new(File.new("#{RAILS_ROOT}/app/views/printr/#{name}.prnt.erb",'r').read)
152
158
  rescue Exception => e
153
159
  puts "[Printr] Exception in view: " + e.inspect
160
+
154
161
  end
155
162
  puts "[Printr] returning text"
156
163
  text = erb.result(bndng)
164
+ if text.nil? then
165
+ text = 'erb result made me nil'
166
+ end
157
167
  return text
158
168
  end
159
169
  end
data/printr.gemspec CHANGED
@@ -4,7 +4,7 @@ require "printr/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "printr"
7
- s.version = '0.1.3'
7
+ s.version = '0.1.4'
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Michael Franzl","Jason Martin"]
10
10
  s.email = ["jason@jason-knight-martin.com"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Franzl