tn_pdf 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91cb0ad993ddca5fbf6fe2c810cd947e59c5cb3f
4
- data.tar.gz: 2aa092c489969b92567973b078b52dd90aac4c4b
3
+ metadata.gz: b292a0f3ab4ce343c2a7baf6ef0e40a42166d938
4
+ data.tar.gz: e2b65312b0c68495bb233568ef7e8037a55b370b
5
5
  SHA512:
6
- metadata.gz: c7e55005eecbf3e0dce9b5997efd57e33a62bb1075921ffddb4639e133175ef00ba3ecbbf9ed554eb5ba7c7ee5cc7ed3d7d59086e82d5c95f57c3c8d5bdf787e
7
- data.tar.gz: 92dd019191ee1f274d5ea381ce53feb5ce45ded1816643e6c2f570bbabdde97bc239e55079f97f799a5b8fb9847dd133a766abb8712d24256e10886aed33461d
6
+ metadata.gz: e3aa7320949442643c58695ebef1499b1d18f594f1b00a2c4b9643a999cc6674750d4a919faa08fdfb2cc76c09e23ed09c4ecef9b187d1af9b8c1a03826be493
7
+ data.tar.gz: e395b3ab8b57b87981ece3d12eb9f77e608e9099bf58ba04b8f419f0721a59603a5bd27f4e72bffa2ce081e457f5d0c7852e8bbf5606ce1207e42e07eb70aea1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tn_pdf (0.0.8)
4
+ tn_pdf (0.0.9)
5
5
  backports
6
6
  prawn (~> 0.11.1)
7
7
 
@@ -10,7 +10,7 @@ GEM
10
10
  specs:
11
11
  Ascii85 (1.0.2)
12
12
  afm (0.2.2)
13
- backports (3.6.0)
13
+ backports (3.6.4)
14
14
  coderay (0.9.8)
15
15
  diff-lcs (1.1.2)
16
16
  hashery (2.1.1)
data/lib/tn_pdf/box.rb CHANGED
@@ -18,7 +18,7 @@ module TnPDF
18
18
  if has_image?
19
19
  image_args = [image_file]
20
20
  image_args << image_options unless image_options.empty?
21
- document.image *image_args
21
+ document.image(*image_args)
22
22
  end
23
23
 
24
24
  if has_text?
@@ -26,7 +26,7 @@ module TnPDF
26
26
  text_options.merge!({:inline_format => true})
27
27
  text_args << text_options
28
28
  document.font(text_options[:font], text_options[:font_options]) do
29
- document.text *text_args
29
+ document.text(*text_args)
30
30
  end
31
31
  end
32
32
  end
@@ -75,11 +75,13 @@ module TnPDF
75
75
  options[:image][:position] = options[:align]
76
76
  options[:image][:vposition] = options[:valign]
77
77
 
78
- path = Configuration[:images_path]
79
- @image_file = options[:image][:file]
80
- unless @image_file =~ /^#{path}/
81
- @image_file = File.join(path, @image_file)
78
+ if loader = Configuration[:image_loader, call_procs: false]
79
+ @image_file = loader.call(options[:image][:file])
80
+ else
81
+ path = Configuration[:images_path]
82
+ @image_file = File.join(path, options[:image][:file])
82
83
  end
84
+
83
85
  @image_options = options[:image].reject { |k,_| k == :file }
84
86
  end
85
87
  end
@@ -4,11 +4,11 @@ module TnPDF
4
4
  class Configuration
5
5
  class << self
6
6
 
7
- def [](property)
7
+ def [](property, call_procs: true)
8
8
  (hash, key) = filter_property(property)
9
9
  value = hash[key]
10
10
 
11
- if value.kind_of?(Proc)
11
+ if call_procs && value.kind_of?(Proc)
12
12
  value.call
13
13
  else
14
14
  value
@@ -61,13 +61,13 @@ module TnPDF
61
61
  conversion = match[2].to_sym
62
62
  num.send(conversion)
63
63
  elsif value.kind_of? Hash
64
- value.inject({}) do |hash, (key, value)|
65
- hash[key.to_sym] = perform_conversions(value)
64
+ value.inject({}) do |hash, (k, v)|
65
+ hash[k.to_sym] = perform_conversions(v)
66
66
  hash
67
67
  end
68
68
  elsif value.kind_of? Array
69
- value.inject([]) do |array, value|
70
- array << perform_conversions(value)
69
+ value.inject([]) do |array, v|
70
+ array << perform_conversions(v)
71
71
  array
72
72
  end
73
73
  else
@@ -1,3 +1,3 @@
1
1
  module TnPDF
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tn_pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renato Riccieri Santos Zannon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-19 00:00:00.000000000 Z
11
+ date: 2015-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prawn
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  requirements: []
101
101
  rubyforge_project: tn_pdf
102
- rubygems_version: 2.2.2
102
+ rubygems_version: 2.4.5
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: A simple wrapper around prawn, devised to the generation of table-centric