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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aeba1f5235a529c2476286d7febe4abf9b8bc518
4
- data.tar.gz: f37e4e62ef885058218ff47761d6f67b0ea42a44
3
+ metadata.gz: 61b68d5c65d3b8d1df9448399f39aa76adfa5b2c
4
+ data.tar.gz: cba139d460923fdb1068f9b3f88b9c7f7dda839d
5
5
  SHA512:
6
- metadata.gz: 0e54b76f1b656f5115a6b64c79ace96e92bfc342e67283f411ad5a4ad97f7bd0fba51d87ceef0e8e3aa065f0474736e57534f44258901b3b41187b25ba50aa31
7
- data.tar.gz: 4a5671c02709f64676d495befcafbd9d229613ccc984fab85acb867a82e521797e7a58271c97f1d48361c02868328d6cd3230369bddcc58764d7148452298d22
6
+ metadata.gz: c46ff716094e2e9bb098e51e6a90fa57461cdd141e8b7bb76ce5f6e00060812600fb1afe7fab5def1306ea53c0f1a484395b5df401b1489076fe898dcc909dec
7
+ data.tar.gz: f38046f23e502f164b65b4f610472582ee657829916636c197bf7eba1ea45ccd04226a89a522be77872e884e80ffc178562b571640b0d3dfe31d0cd202b8ffc6
@@ -14,7 +14,7 @@ module PureDocx
14
14
  @header_content = ''
15
15
  @body_content = ''
16
16
  (class << self; self; end).class_eval do
17
- [:text, :table, :image].each do |method_name|
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 item == :right || item == :left
83
- align[:vertical] = item if item == :bottom || item == :top
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
- [:right, :left, :top, :bottom, :inside_h, :inside_v].map do |item|
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.0.2
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-04-04 00:00:00.000000000 Z
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.5.1
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