table_format 0.0.13 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/examples/0190_table_print.rb +17 -0
- data/examples/0200_hankaku_katakana.rb +7 -0
- data/lib/table_format/core_ext.rb +1 -0
- data/lib/table_format/generator.rb +5 -8
- data/lib/table_format/version.rb +1 -1
- data/spec/core_ext_spec.rb +8 -0
- metadata +6 -4
- /data/examples/{0180_object_spec.rb → 0180_object.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f00e1e8399327b1651abb33fa72c06400843fd3e04aae71ac36fef66b3f2e2ef
|
4
|
+
data.tar.gz: f0379b5f92615fcb0215eb04a73260448461a08fef2accea59c0832d38145846
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb056ac12dcb67bd0c69f90c0154d261c99b04d3095b6975e4136b8348f925dc96bc91edb53eaa204fe2342e4bf76bc064207d4ab3b08af3e4aa2b12185450d3
|
7
|
+
data.tar.gz: 92d165bf8fb20f2b6d30bc39e570cfe9e4618f48216dc79383d2ba4891149d40461cb55eb3ddb26b7510893bd48f9a1a1812b559a3883e171d71687d4529897b
|
@@ -0,0 +1,17 @@
|
|
1
|
+
$LOAD_PATH << '../lib'
|
2
|
+
require 'table_format'
|
3
|
+
|
4
|
+
require "active_support/logger"
|
5
|
+
|
6
|
+
AppLogger = ActiveSupport::Logger.new(STDOUT)
|
7
|
+
|
8
|
+
module TableFormat
|
9
|
+
def self.table_print(str)
|
10
|
+
AppLogger.debug(str.rstrip)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
tp "foo"
|
15
|
+
# >> |-----|
|
16
|
+
# >> | foo |
|
17
|
+
# >> |-----|
|
@@ -1,13 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
begin
|
6
|
-
require 'active_support/isolated_execution_state'
|
7
|
-
rescue LoadError
|
8
|
-
end
|
9
|
-
|
10
|
-
require 'active_support/core_ext/string' # for blank?
|
3
|
+
require 'active_support'
|
4
|
+
require 'active_support/core_ext/object/blank' # for blank?
|
11
5
|
require 'active_support/core_ext/class/attribute' # for class_attribute
|
12
6
|
require 'kconv'
|
13
7
|
|
@@ -167,6 +161,9 @@ module TableFormat
|
|
167
161
|
|
168
162
|
def str_width(str)
|
169
163
|
s = str.to_s
|
164
|
+
if s.encoding == Encoding.find("UTF-8")
|
165
|
+
s = s.gsub(/[ヲ-゚]/, "_") # 2byte char (hankaku katakana) -> 1byte
|
166
|
+
end
|
170
167
|
x = nil
|
171
168
|
if @options[:in_code] == Kconv::UTF8
|
172
169
|
begin
|
data/lib/table_format/version.rb
CHANGED
data/spec/core_ext_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: table_format
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akicho8
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -113,7 +113,9 @@ files:
|
|
113
113
|
- examples/0150_line_break.rb
|
114
114
|
- examples/0160_truncate.rb
|
115
115
|
- examples/0170_emoji.rb
|
116
|
-
- examples/
|
116
|
+
- examples/0180_object.rb
|
117
|
+
- examples/0190_table_print.rb
|
118
|
+
- examples/0200_hankaku_katakana.rb
|
117
119
|
- lib/table_format.rb
|
118
120
|
- lib/table_format/core_ext.rb
|
119
121
|
- lib/table_format/generator.rb
|
@@ -148,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
150
|
- !ruby/object:Gem::Version
|
149
151
|
version: '0'
|
150
152
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
153
|
+
rubygems_version: 3.4.12
|
152
154
|
signing_key:
|
153
155
|
specification_version: 4
|
154
156
|
summary: TableFormat shows text table like emacs org-table for easy reading.
|
File without changes
|