table_print 1.3.1 → 1.3.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 +15 -0
- data/lib/table_print/config.rb +16 -1
- data/lib/table_print/version.rb +1 -1
- data/lib/table_print.rb +0 -1
- metadata +5 -16
- data/lib/table_print/cattr.rb +0 -46
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NjM0ZWE0MWM5YjIyYTM5NWFjZjY0NzljMTQyNDQyMDRiMmJmOGZkOQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YWVjYTdjNjExNTdlZjVjNTU2ZTE3ZWE2YzYzN2IxYWExYzA4NTc4NA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZDI1MWNjMzQ2ZWZmYjk5MTllMTI0MDk5MWQxMzc4NjBhODc5NGY0YzFhYjlk
|
10
|
+
Nzg2M2JhMmZlNjNlMGEwOTY2ZTRhYjEzMTUwOTc2YTgzMjRmM2IyYjhiNDI4
|
11
|
+
NWZkMjkwYWYwZjJlNGFlYThjMmQ3ODI0NWY4MjJhNjY0YjFiZjg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MTgwYmYwYmE2YzcxYTA2Yzk2OTlmYzViNzMyMDFmYWI3MjI2Mzc3ZTBhMzI5
|
14
|
+
Zjg3ZmM5NWNjMDJmZDlkYmIyOGI0MjY0NjMwMDhkZDgxZjY5MDgyMTVjYzY0
|
15
|
+
Nzk4ZjY4YmMyNzlkMGUxZWM5MmY5NGY3MmI5MTUyZmYwYzNhNGE=
|
data/lib/table_print/config.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
module TablePrint
|
2
2
|
class Config
|
3
|
-
cattr_accessor :max_width, :time_format
|
4
3
|
|
5
4
|
DEFAULT_MAX_WIDTH = 30
|
6
5
|
DEFAULT_TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
|
@@ -30,5 +29,21 @@ module TablePrint
|
|
30
29
|
TablePrint::Config.send("#{klass}=", original_value)
|
31
30
|
end
|
32
31
|
end
|
32
|
+
|
33
|
+
def self.max_width
|
34
|
+
@@max_width
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.max_width=(width)
|
38
|
+
@@max_width = width
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.time_format
|
42
|
+
@@time_format
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.time_format=(format)
|
46
|
+
@@time_format = format
|
47
|
+
end
|
33
48
|
end
|
34
49
|
end
|
data/lib/table_print/version.rb
CHANGED
data/lib/table_print.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: table_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
5
|
-
prerelease:
|
4
|
+
version: 1.3.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Chris Doyle
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-04 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: cat
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: cucumber
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rspec
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rake
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -100,7 +91,6 @@ files:
|
|
100
91
|
- features/support/step_definitions/before.rb
|
101
92
|
- features/support/step_definitions/steps.rb
|
102
93
|
- lib/table_print.rb
|
103
|
-
- lib/table_print/cattr.rb
|
104
94
|
- lib/table_print/column.rb
|
105
95
|
- lib/table_print/config.rb
|
106
96
|
- lib/table_print/config_resolver.rb
|
@@ -126,27 +116,26 @@ files:
|
|
126
116
|
homepage: http://tableprintgem.com
|
127
117
|
licenses:
|
128
118
|
- MIT
|
119
|
+
metadata: {}
|
129
120
|
post_install_message:
|
130
121
|
rdoc_options: []
|
131
122
|
require_paths:
|
132
123
|
- lib
|
133
124
|
required_ruby_version: !ruby/object:Gem::Requirement
|
134
|
-
none: false
|
135
125
|
requirements:
|
136
126
|
- - ! '>='
|
137
127
|
- !ruby/object:Gem::Version
|
138
128
|
version: '0'
|
139
129
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
|
-
none: false
|
141
130
|
requirements:
|
142
131
|
- - ! '>='
|
143
132
|
- !ruby/object:Gem::Version
|
144
133
|
version: '0'
|
145
134
|
requirements: []
|
146
135
|
rubyforge_project:
|
147
|
-
rubygems_version:
|
136
|
+
rubygems_version: 2.0.7
|
148
137
|
signing_key:
|
149
|
-
specification_version:
|
138
|
+
specification_version: 4
|
150
139
|
summary: Turn objects into nicely formatted columns for easy reading
|
151
140
|
test_files:
|
152
141
|
- features/adding_columns.feature
|
data/lib/table_print/cattr.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
class Class
|
2
|
-
def cattr_reader(*syms)
|
3
|
-
syms.flatten.each do |sym|
|
4
|
-
next if sym.is_a?(Hash)
|
5
|
-
class_eval(<<-EOS, __FILE__, __LINE__)
|
6
|
-
unless defined? @@#{sym}
|
7
|
-
@@#{sym} = nil
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.#{sym}
|
11
|
-
@@#{sym}
|
12
|
-
end
|
13
|
-
|
14
|
-
def #{sym}
|
15
|
-
@@#{sym}
|
16
|
-
end
|
17
|
-
EOS
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def cattr_writer(*syms)
|
22
|
-
options = syms.last.is_a?(Hash) ? syms.pop : {}
|
23
|
-
syms.flatten.each do |sym|
|
24
|
-
class_eval(<<-EOS, __FILE__, __LINE__)
|
25
|
-
unless defined? @@#{sym}
|
26
|
-
@@#{sym} = nil
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.#{sym}=(obj)
|
30
|
-
@@#{sym} = obj
|
31
|
-
end
|
32
|
-
|
33
|
-
#{"
|
34
|
-
def #{sym}=(obj)
|
35
|
-
@@#{sym} = obj
|
36
|
-
end
|
37
|
-
" unless options[:instance_writer] == false }
|
38
|
-
EOS
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def cattr_accessor(*syms)
|
43
|
-
cattr_reader(*syms)
|
44
|
-
cattr_writer(*syms)
|
45
|
-
end
|
46
|
-
end
|