crayfish 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YmYwYTAwNjU2OTllZmJlOTkwZWI1YjI0NTM5NGY2NTExNzU2NDc3MA==
5
+ data.tar.gz: !binary |-
6
+ ZDZjYjI0Yjc0MjU3YTI2OTQwMmM1NGY0ZTU2Yjk4MDIzNTZlYWQxNA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ Y2QxMWNhNGRiOGNmMWFjMGI5MTMxMGFjOWU0YzQzOTA1ODQ5ODA0OTc5MjNm
10
+ MzMxYmVlNTliMWIzY2YwZDZmZDdkOWE4Nzg4N2Q0MGEwNWNiMWZlYzk3YTcx
11
+ ZjczYjE0MmU4MTA4ZTJkNTFkNTFjZmEyMzkzYzU5MGZjNTFmOGY=
12
+ data.tar.gz: !binary |-
13
+ ODVkODA1NWE3YTc4NjA4NzVhZDI2ZGMwMGZkZWQwNDc4Y2Y2NDA0YzViOTg3
14
+ ZjgyZWQ2Y2I5Zjg1Mjc1ZmExNjcwYjI5ZTExZmQ0ZTc5ZThkYzYzMzNhNjk5
15
+ M2U2NDFmZGEwYWQ3MWNkOTMyMGZjM2ZiZjFhMDlmYjkzZDYxNjc=
data/lib/crayfish/html.rb CHANGED
@@ -141,6 +141,14 @@ module Crayfish
141
141
  image = { :image => image_fs_path(node.attributes['src'].value) }
142
142
  image[:width] = node.attributes['width'].value.to_f if node.attributes['width']
143
143
  image[:height] = node.attributes['height'].value.to_f if node.attributes['height']
144
+ if node.attributes['align']
145
+ case node.attributes['align'].value.to_s.to_sym
146
+ when :right
147
+ image[:position] = :right
148
+ when :middle
149
+ image[:position] = :center
150
+ end
151
+ end
144
152
  return image
145
153
 
146
154
  when :table
@@ -151,10 +159,10 @@ module Crayfish
151
159
  # apply style
152
160
  full_width = 540
153
161
  attribs = { :cell_style => { :inline_format => true } }
154
- if node.attributes['width'] and /^(?<percent>.*)%$/ =~ node.attributes['width'].value
162
+ if node.attributes['width'] && /^(?<percent>.*)%$/ =~ node.attributes['width'].value
155
163
  attribs[:post_resize] = "#{percent}%"
156
164
  end
157
- attribs[:cell_style][:borders] = [] if node.attributes['border'] and node.attributes['border'].value=='0'
165
+ attribs[:cell_style][:borders] = [] if node.attributes['border'] && node.attributes['border'].value=='0'
158
166
 
159
167
  pdf_table = @pdf.make_table(table, attribs)
160
168
  table_styles.each do |style|
@@ -21,5 +21,5 @@
21
21
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
 
23
23
  module Crayfish
24
- VERSION = "0.2.5"
24
+ VERSION = "0.2.6"
25
25
  end
@@ -1763,3 +1763,49 @@ undefined local variable or method `aaa' for #<CrayfishActionViewTest::ActionVie
1763
1763
   (0.0ms) rollback transaction
1764
1764
   (0.0ms) begin transaction
1765
1765
   (0.0ms) rollback transaction
1766
+  (0.3ms) begin transaction
1767
+  (0.0ms) rollback transaction
1768
+  (0.1ms) begin transaction
1769
+ unknown node p in CrayHtml
1770
+  (0.1ms) rollback transaction
1771
+  (0.0ms) begin transaction
1772
+  (0.0ms) rollback transaction
1773
+  (0.1ms) begin transaction
1774
+  (0.1ms) rollback transaction
1775
+  (0.0ms) begin transaction
1776
+  (0.1ms) rollback transaction
1777
+  (0.0ms) begin transaction
1778
+  (0.0ms) rollback transaction
1779
+  (0.0ms) begin transaction
1780
+  (0.0ms) rollback transaction
1781
+  (0.0ms) begin transaction
1782
+  (0.0ms) rollback transaction
1783
+  (0.0ms) begin transaction
1784
+  (0.1ms) rollback transaction
1785
+  (0.0ms) begin transaction
1786
+  (0.0ms) rollback transaction
1787
+  (0.1ms) begin transaction
1788
+  (0.1ms) rollback transaction
1789
+  (0.3ms) begin transaction
1790
+  (0.0ms) rollback transaction
1791
+  (0.1ms) begin transaction
1792
+ unknown node p in CrayHtml
1793
+  (0.0ms) rollback transaction
1794
+  (0.0ms) begin transaction
1795
+  (0.0ms) rollback transaction
1796
+  (0.0ms) begin transaction
1797
+  (0.1ms) rollback transaction
1798
+  (0.0ms) begin transaction
1799
+  (0.0ms) rollback transaction
1800
+  (0.0ms) begin transaction
1801
+  (0.0ms) rollback transaction
1802
+  (0.0ms) begin transaction
1803
+  (0.0ms) rollback transaction
1804
+  (0.0ms) begin transaction
1805
+  (0.0ms) rollback transaction
1806
+  (0.0ms) begin transaction
1807
+  (0.1ms) rollback transaction
1808
+  (0.0ms) begin transaction
1809
+  (0.0ms) rollback transaction
1810
+  (0.0ms) begin transaction
1811
+  (0.0ms) rollback transaction
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crayfish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
5
- prerelease:
4
+ version: 0.2.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Patrick Hanevold
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-10-22 00:00:00.000000000 Z
11
+ date: 2014-09-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: prawn
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: nokogiri
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: sqlite3
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: mocha
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -98,17 +87,17 @@ executables: []
98
87
  extensions: []
99
88
  extra_rdoc_files: []
100
89
  files:
90
+ - MIT-LICENSE
91
+ - README.md
92
+ - Rakefile
93
+ - lib/crayfish.rb
101
94
  - lib/crayfish/action_controller.rb
102
95
  - lib/crayfish/action_view.rb
103
96
  - lib/crayfish/html.rb
104
97
  - lib/crayfish/rails/base.rb
105
98
  - lib/crayfish/rails/pdf.rb
106
99
  - lib/crayfish/version.rb
107
- - lib/crayfish.rb
108
100
  - lib/tasks/crayfish_tasks.rake
109
- - MIT-LICENSE
110
- - Rakefile
111
- - README.md
112
101
  - test/action_view_test.rb
113
102
  - test/crayfish_test.rb
114
103
  - test/dummy/README.rdoc
@@ -118,6 +107,7 @@ files:
118
107
  - test/dummy/app/controllers/application_controller.rb
119
108
  - test/dummy/app/helpers/application_helper.rb
120
109
  - test/dummy/app/views/layouts/application.html.erb
110
+ - test/dummy/config.ru
121
111
  - test/dummy/config/application.rb
122
112
  - test/dummy/config/boot.rb
123
113
  - test/dummy/config/database.yml
@@ -133,7 +123,6 @@ files:
133
123
  - test/dummy/config/initializers/wrap_parameters.rb
134
124
  - test/dummy/config/locales/en.yml
135
125
  - test/dummy/config/routes.rb
136
- - test/dummy/config.ru
137
126
  - test/dummy/db/schema.rb
138
127
  - test/dummy/db/test.sqlite3
139
128
  - test/dummy/log/test.log
@@ -147,33 +136,26 @@ files:
147
136
  - test/test_helper.rb
148
137
  homepage: http://github.com/patrickhno
149
138
  licenses: []
139
+ metadata: {}
150
140
  post_install_message:
151
141
  rdoc_options: []
152
142
  require_paths:
153
143
  - lib
154
144
  required_ruby_version: !ruby/object:Gem::Requirement
155
- none: false
156
145
  requirements:
157
146
  - - ! '>='
158
147
  - !ruby/object:Gem::Version
159
148
  version: '0'
160
- segments:
161
- - 0
162
- hash: 454509455865252440
163
149
  required_rubygems_version: !ruby/object:Gem::Requirement
164
- none: false
165
150
  requirements:
166
151
  - - ! '>='
167
152
  - !ruby/object:Gem::Version
168
153
  version: '0'
169
- segments:
170
- - 0
171
- hash: 454509455865252440
172
154
  requirements: []
173
155
  rubyforge_project:
174
- rubygems_version: 1.8.24
156
+ rubygems_version: 2.2.2
175
157
  signing_key:
176
- specification_version: 3
158
+ specification_version: 4
177
159
  summary: Crayfish - PDF templating for Rails
178
160
  test_files:
179
161
  - test/action_view_test.rb