prawn-fillform 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Prawn
3
3
  module Fillform
4
- VERSION = "0.0.8"
4
+ VERSION = "0.0.9"
5
5
  end
6
6
  end
7
7
 
@@ -1,7 +1,10 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  require 'prawn-fillform/version'
3
+ require 'open-uri'
4
+ OpenURI::Buffer::StringMax = 0
3
5
 
4
6
  module Prawn
7
+
5
8
  module Fillform
6
9
 
7
10
  class Field
@@ -177,10 +180,11 @@ module Prawn
177
180
  options ||= {}
178
181
 
179
182
  if value
183
+ value = value.to_s
180
184
  if field.type == :text
181
185
  fill_color options[:font_color] || field.font_color
182
186
 
183
- text_box value.to_s, :at => [field.x + 2, field.y - 1],
187
+ text_box value, :at => [field.x + 2, field.y - 1],
184
188
  :align => options[:align] || field.align,
185
189
  :width => options[:width] || field.width,
186
190
  :height => options[:height] || field.height,
@@ -190,10 +194,16 @@ module Prawn
190
194
  elsif field.type == :button
191
195
 
192
196
  bounding_box([field.x, field.y], :width => field.width, :height => field.height) do
193
-
194
- image value.to_s, :position => options[:position] || :center,
197
+ if value =~ /http/
198
+ image open(value), :position => options[:position] || :center,
195
199
  :vposition => options[:vposition] || :center,
196
200
  :fit => options[:fit] || [field.width, field.height]
201
+ else
202
+ image value, :position => options[:position] || :center,
203
+ :vposition => options[:vposition] || :center,
204
+ :fit => options[:fit] || [field.width, field.height]
205
+ end
206
+
197
207
  end
198
208
  end
199
209
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn-fillform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: