tablr 0.1 → 0.2
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 +7 -0
- data/lib/tablr/tablr.rb +3 -3
- metadata +20 -32
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 17654b15d6c516c6321fa51cf0403347e6d9f928
|
4
|
+
data.tar.gz: 183b0c8ba7d8a92f29bbff97e96d7b08622f2738
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b4dc6f732bdaf6fe4014f0bf633dcd6d36008839c8b8c6f96d84d6df328b5157256b2fb19446e8a9f00c6be7a36087dccd42ecc7b85556bf25da7e0c4586b77f
|
7
|
+
data.tar.gz: 1e388e9bc5d19d7478346c8f8b83b99478dab1bb15d1668e0651caeb89722c51ef546aa9af856044960aa76c6da25e6733095f3cad3c3c9dbb7bb76605309a98
|
data/lib/tablr/tablr.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Tablr
|
2
2
|
attr_accessor :columns
|
3
|
-
|
3
|
+
|
4
4
|
def initialize(options = {})
|
5
5
|
@columns ||= TablrSpace::OrderedHash.auto
|
6
6
|
@row_data ||= TablrSpace::OrderedHash.new
|
@@ -12,7 +12,7 @@ class Tablr
|
|
12
12
|
|
13
13
|
# Add columns
|
14
14
|
def columns(columns)
|
15
|
-
Array(columns).each { |v| @columns[v] = { :length => v.length, :rows => [] } }
|
15
|
+
Array(columns).each { |v| @columns[v] = { :length => v.gsub(/\e\[(\d+)m/, '').length, :rows => [] } }
|
16
16
|
end
|
17
17
|
alias_method :column, :columns
|
18
18
|
alias_method :add_column, :columns
|
@@ -107,6 +107,6 @@ EOL
|
|
107
107
|
end
|
108
108
|
|
109
109
|
def str_length(key, length, padding=1)
|
110
|
-
(length-(key.length)-padding).abs
|
110
|
+
(length-(key.gsub(/\e\[(\d+)m/, '').length)-padding).abs
|
111
111
|
end
|
112
112
|
end
|
metadata
CHANGED
@@ -1,61 +1,49 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: tablr
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: "0.1"
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.2'
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- Daniel Durante
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2011-07-18 00:00:00 -04:00
|
14
|
-
default_executable:
|
11
|
+
date: 2014-03-03 00:00:00.000000000 Z
|
15
12
|
dependencies: []
|
16
|
-
|
17
13
|
description: Create tables easily with Tablr in your console.
|
18
14
|
email: officedebo@gmail.com
|
19
15
|
executables: []
|
20
|
-
|
21
16
|
extensions: []
|
22
|
-
|
23
17
|
extra_rdoc_files: []
|
24
|
-
|
25
|
-
files:
|
18
|
+
files:
|
26
19
|
- lib/support/orderedhash.rb
|
27
20
|
- lib/tablr/tablr.rb
|
28
21
|
- lib/tablr.rb
|
29
22
|
- CHANGELOG
|
30
23
|
- COPYING
|
31
24
|
- README.markdown
|
32
|
-
has_rdoc: true
|
33
25
|
homepage: https://github.com/durango/Tablr
|
34
|
-
licenses:
|
26
|
+
licenses:
|
35
27
|
- MIT
|
28
|
+
metadata: {}
|
36
29
|
post_install_message:
|
37
30
|
rdoc_options: []
|
38
|
-
|
39
|
-
require_paths:
|
31
|
+
require_paths:
|
40
32
|
- lib
|
41
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - '>='
|
41
|
+
- !ruby/object:Gem::Version
|
52
42
|
version: 1.3.6
|
53
43
|
requirements: []
|
54
|
-
|
55
44
|
rubyforge_project:
|
56
|
-
rubygems_version:
|
45
|
+
rubygems_version: 2.0.3
|
57
46
|
signing_key:
|
58
|
-
specification_version:
|
47
|
+
specification_version: 4
|
59
48
|
summary: Tables in your console in Ruby
|
60
49
|
test_files: []
|
61
|
-
|