puredocx 0.0.2 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/puredocx/document.rb +1 -1
- data/lib/puredocx/xml_generators/image.rb +2 -2
- data/lib/puredocx/xml_generators/table.rb +1 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61b68d5c65d3b8d1df9448399f39aa76adfa5b2c
|
4
|
+
data.tar.gz: cba139d460923fdb1068f9b3f88b9c7f7dda839d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c46ff716094e2e9bb098e51e6a90fa57461cdd141e8b7bb76ce5f6e00060812600fb1afe7fab5def1306ea53c0f1a484395b5df401b1489076fe898dcc909dec
|
7
|
+
data.tar.gz: f38046f23e502f164b65b4f610472582ee657829916636c197bf7eba1ea45ccd04226a89a522be77872e884e80ffc178562b571640b0d3dfe31d0cd202b8ffc6
|
data/lib/puredocx/document.rb
CHANGED
@@ -14,7 +14,7 @@ module PureDocx
|
|
14
14
|
@header_content = ''
|
15
15
|
@body_content = ''
|
16
16
|
(class << self; self; end).class_eval do
|
17
|
-
[
|
17
|
+
%i[text table image].each do |method_name|
|
18
18
|
define_method method_name do |content, options = {}|
|
19
19
|
Object.const_get(
|
20
20
|
"PureDocx::XmlGenerators::#{method_name.to_s.capitalize}"
|
@@ -79,8 +79,8 @@ module PureDocx
|
|
79
79
|
vertical: :top
|
80
80
|
}
|
81
81
|
align_params.each do |item|
|
82
|
-
align[:horizontal] = item if
|
83
|
-
align[:vertical] = item if
|
82
|
+
align[:horizontal] = item if %i[right left].include? item
|
83
|
+
align[:vertical] = item if %i[bottom top].include? item
|
84
84
|
end
|
85
85
|
align
|
86
86
|
end
|
@@ -5,7 +5,6 @@ module PureDocx
|
|
5
5
|
BOLD_BORDER_VALUES = { value: '18', default_value: '4' }.freeze
|
6
6
|
attr_reader :table_content,
|
7
7
|
:columns_count,
|
8
|
-
:columns_width,
|
9
8
|
:sides_without_border,
|
10
9
|
:bold_sides,
|
11
10
|
:received_table_width,
|
@@ -16,7 +15,6 @@ module PureDocx
|
|
16
15
|
@columns_count = table_content[0].size
|
17
16
|
@received_table_width = arguments[:table_width]
|
18
17
|
@received_col_width = arguments[:col_width]
|
19
|
-
@columns_width = columns_width
|
20
18
|
ensure_columns_count!
|
21
19
|
@sides_without_border = prepare_sides(WITHOUT_BORDER_VALUES, arguments[:sides_without_border])
|
22
20
|
@bold_sides = prepare_sides(BOLD_BORDER_VALUES, arguments[:bold_sides])
|
@@ -85,7 +83,7 @@ module PureDocx
|
|
85
83
|
end
|
86
84
|
|
87
85
|
def prepare_sides(border_type_value, params = [])
|
88
|
-
[
|
86
|
+
%i[right left top bottom inside_h inside_v].map do |item|
|
89
87
|
[item, params&.include?(item) ? border_type_value[:value] : border_type_value[:default_value]]
|
90
88
|
end.to_h
|
91
89
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puredocx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JetRuby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastimage
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
130
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
131
|
+
rubygems_version: 2.6.11
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: A simple gem for creating docx documents
|