terminal-table-unicode 0.1.7 → 0.1.8

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: 9e82857fbd781ffcb46e9fedb14f7fadc785ca68
4
- data.tar.gz: dc8c3650797f52c2a5f463edd5f4029a8cfc8220
3
+ metadata.gz: 56c874a91edf66e278766c7fa5345acf621480bd
4
+ data.tar.gz: 7d57efc73a77e49340ed3d6d1981b06c649d4db0
5
5
  SHA512:
6
- metadata.gz: 887a7592a8772438037f364a48e0a21275ba9a00fa8e41539ecef55b49c7d4949361d5445ca9983dd6ed41eda55ae02466319c107285ba280498e4d8dddcbe6e
7
- data.tar.gz: e1675f7c878de49f6ae1c551d0d084970b1cadaa3f14009e40ea015ce28c45806b91aa354b03a900a28c95b277b640e29874895ffa1439cca4bbd5e9616e95b5
6
+ metadata.gz: 43e271493e01e7e81efb903fd5e426e10715231a4682ba1fd07995359ec38e55f65e59590f0919e607892da0adfb2127bf736ac358ec4b796eec625bbeb95ecc
7
+ data.tar.gz: 2f465cf58832b9287aebe8d259e014d5ccd5c38c2742d058e050049f863a889143bd83da4cb62f18db5f21d78ccba5c1b41fa227020a17b2df98908847300e6e
data/.gitignore CHANGED
@@ -1,9 +1,10 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
1
+ .bundle/
2
+ .rubocop-*
3
+ .yardoc
4
+ Gemfile.lock
5
+ _yardoc/
6
+ coverage/
7
+ doc/
8
+ pkg/
9
+ spec/reports/
10
+ tmp/
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ inherit_from:
2
+ - https://raw.githubusercontent.com/rails/rails/master/.rubocop.yml
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in terminal-table-unicode.gemspec
4
4
  gemspec
data/Rakefile CHANGED
@@ -1 +1 @@
1
- require 'bundler/gem_tasks'
1
+ require "bundler/gem_tasks"
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'bundler/setup'
4
- require 'terminal/table/unicode'
3
+ require "bundler/setup"
4
+ require "terminal/table/unicode"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +10,5 @@ require 'terminal/table/unicode'
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
- require 'irb'
13
+ require "irb"
14
14
  IRB.start
@@ -1 +1 @@
1
- require 'terminal/table/unicode'
1
+ require "terminal/table/unicode"
@@ -2,27 +2,27 @@ module Terminal
2
2
  class Table
3
3
  private
4
4
 
5
- undef :recalc_column_widths
6
- def recalc_column_widths(row)
7
- return if row.is_a? Separator
8
- i = 0
9
- row.cells.each do |cell|
10
- colspan = cell.colspan
11
- cell_value = cell.value_for_column_width_recalc
12
- colspan.downto(1) do |_j|
13
- # cell_length = cell_value.to_s.length
14
- cell_length = cell_value.to_s.display_width
15
- if colspan > 1
16
- spacing_length = cell_spacing * (colspan - 1)
17
- length_in_columns = (cell_length - spacing_length)
18
- cell_length = (length_in_columns.to_f / colspan).ceil
5
+ undef :recalc_column_widths
6
+ def recalc_column_widths(row)
7
+ return if row.is_a? Separator
8
+ i = 0
9
+ row.cells.each do |cell|
10
+ colspan = cell.colspan
11
+ cell_value = cell.value_for_column_width_recalc
12
+ colspan.downto(1) do |_j|
13
+ # cell_length = cell_value.to_s.length
14
+ cell_length = cell_value.to_s.display_width
15
+ if colspan > 1
16
+ spacing_length = cell_spacing * (colspan - 1)
17
+ length_in_columns = (cell_length - spacing_length)
18
+ cell_length = (length_in_columns.to_f / colspan).ceil
19
+ end
20
+ if @column_widths[i].to_i < cell_length
21
+ @column_widths[i] = cell_length
22
+ end
23
+ i += 1
19
24
  end
20
- if @column_widths[i].to_i < cell_length
21
- @column_widths[i] = cell_length
22
- end
23
- i += 1
24
25
  end
25
26
  end
26
- end
27
27
  end
28
28
  end
@@ -1,7 +1,7 @@
1
- require 'unicode/display_width'
2
- require 'mb_string'
3
- require 'terminal-table'
1
+ require "unicode/display_width"
2
+ require "mb_string"
3
+ require "terminal-table"
4
4
 
5
- require 'terminal/table/cell'
6
- require 'terminal/table/table'
7
- require 'terminal/table/unicode/version'
5
+ require "terminal/table/cell"
6
+ require "terminal/table/table"
7
+ require "terminal/table/unicode/version"
@@ -1,7 +1,7 @@
1
1
  module Terminal
2
2
  class Table
3
3
  module Unicode
4
- VERSION = '0.1.7'
4
+ VERSION = "0.1.8"
5
5
  end
6
6
  end
7
7
  end
@@ -1,28 +1,28 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'terminal/table/unicode/version'
4
+ require "terminal/table/unicode/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = 'terminal-table-unicode'
7
+ spec.name = "terminal-table-unicode"
8
8
  spec.version = Terminal::Table::Unicode::VERSION
9
- spec.authors = ['rochefort']
10
- spec.email = ['terasawan@gmail.com']
9
+ spec.authors = ["rochefort"]
10
+ spec.email = ["terasawan@gmail.com"]
11
11
 
12
- spec.summary = 'Simple, feature rich ascii table generation library with full-width unicode characters'
12
+ spec.summary = "Simple, feature rich ascii table generation library with full-width unicode characters"
13
13
  spec.description = spec.summary
14
- spec.homepage = 'https://github.com/rochefort/terminal-table-unicode'
15
- spec.license = 'MIT'
14
+ spec.homepage = "https://github.com/rochefort/terminal-table-unicode"
15
+ spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
- spec.bindir = 'exe'
18
+ spec.bindir = "exe"
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
- spec.require_paths = ['lib']
20
+ spec.require_paths = ["lib"]
21
21
 
22
- spec.add_dependency 'mb_string', '~> 0.1.6'
23
- spec.add_dependency 'terminal-table', '~> 1.5'
24
- spec.add_dependency 'unicode-display_width', '~> 1.0.3'
22
+ spec.add_dependency "mb_string", "~> 0.1.7"
23
+ spec.add_dependency "terminal-table", "~> 1.5"
24
+ spec.add_dependency "unicode-display_width", "~> 1.1.1"
25
25
 
26
- spec.add_development_dependency 'bundler', '~> 1.11.2'
27
- spec.add_development_dependency 'rake', '~> 11.1.2'
26
+ spec.add_development_dependency "bundler", "~> 1.12.2"
27
+ spec.add_development_dependency "rake", "~> 11.3.0"
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terminal-table-unicode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - rochefort
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-31 00:00:00.000000000 Z
11
+ date: 2016-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mb_string
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.6
19
+ version: 0.1.7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.6
26
+ version: 0.1.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: terminal-table
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,42 +44,42 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.0.3
47
+ version: 1.1.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.0.3
54
+ version: 1.1.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.11.2
61
+ version: 1.12.2
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.11.2
68
+ version: 1.12.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 11.1.2
75
+ version: 11.3.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 11.1.2
82
+ version: 11.3.0
83
83
  description: Simple, feature rich ascii table generation library with full-width unicode
84
84
  characters
85
85
  email:
@@ -89,6 +89,7 @@ extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
91
  - ".gitignore"
92
+ - ".rubocop.yml"
92
93
  - ".travis.yml"
93
94
  - Gemfile
94
95
  - README.md
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  version: '0'
122
123
  requirements: []
123
124
  rubyforge_project:
124
- rubygems_version: 2.5.1
125
+ rubygems_version: 2.6.6
125
126
  signing_key:
126
127
  specification_version: 4
127
128
  summary: Simple, feature rich ascii table generation library with full-width unicode