list_to_columns 1.0.0 → 1.0.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: 017461bbc767b91781b3f5ba696ddcaa069a882a
4
- data.tar.gz: 3240eefbcf3b3e7a9de6bf3dc4a759fd28d1b8e7
3
+ metadata.gz: e5821c2d3ac378d48423c3ffc39c805fdcc60ad0
4
+ data.tar.gz: b0548ab0fd477ca597dd07fea88a339215962063
5
5
  SHA512:
6
- metadata.gz: ae59d2bc3fd23d8a8034a560dc87c67b12d9ff49fa3181cd579af3a506cfdf7b6768e696c2b33298b4d2a0af6adb49b339e6d51afc5db82f89790605b56f7911
7
- data.tar.gz: c6b80de38eaf82bd0963f27a30a57852bfd90dc0829df94dec4321905cc82666bc4d8f07406089c3b6e4cf52ca1fe2474e5e90fc6e8e6d682079d26a23dc626d
6
+ metadata.gz: e2187d9b50ddb32b470e6889da7d87a9776e9e66cdd134381a06f71f3ca92ee7fe93f33a20aa8ccd4f1f7dd394e8597e2fa7d39c0298249b8a949a240a6a68ca
7
+ data.tar.gz: a87d0c5239d3ed1f5061b75738cb122f235a643e3cb645c042daa775625d130180bca93188055a3084fbe5f440498964132265672e0385cf6ea1a5afcb8bbd61
data/.semver CHANGED
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 0
4
- :patch: 0
4
+ :patch: 1
5
5
  :special: ''
6
+ :metadata: ''
data/README.md CHANGED
@@ -4,6 +4,8 @@ Status](https://travis-ci.org/docwhat/list_to_columns.svg)](https://travis-ci.or
4
4
  Status](https://coveralls.io/repos/docwhat/list_to_columns/badge.svg?branch=master&service=github)](https://coveralls.io/github/docwhat/list_to_columns?branch=master)
5
5
  [![Dependency
6
6
  Status](https://gemnasium.com/docwhat/list_to_columns.svg)](https://gemnasium.com/docwhat/list_to_columns)
7
+ [![Gem
8
+ Version](https://badge.fury.io/rb/list_to_columns.svg)](http://badge.fury.io/rb/list_to_columns)
7
9
 
8
10
  ListToColumns
9
11
  =============
@@ -13,7 +15,7 @@ Have a list of strings but want to display it in a compact column format?
13
15
 
14
16
  It turns boring lists like:
15
17
 
16
- Dedanim signally eyebright unpebbled ureterolithic boyishly auriculares cynebot evaluation literatus
18
+ Dedanim signally eyebright unpebbled ureterolithic boyishly
17
19
 
18
20
  or:
19
21
 
@@ -54,7 +56,61 @@ Or install it yourself as:
54
56
  Usage
55
57
  -----
56
58
 
57
- TODO: Write usage instructions here
59
+ `ListToPass.new <list>, [options]`
60
+
61
+ Options:
62
+
63
+ - `:width` -- The width of the text to display. Defaults to `78`.
64
+ - `:space` -- The space between columns. Defaults to `2`.
65
+
66
+ ### Example
67
+
68
+ ``` ruby
69
+ require 'list_to_columns'
70
+
71
+ words = %w(
72
+ antipyic
73
+ baccheion
74
+ conormal
75
+ diet
76
+ extracloacal
77
+ fadridden
78
+ germifuge
79
+ hovering
80
+ isomerical
81
+ jagrata
82
+ knuclesome
83
+ libidinal
84
+ myoclonic
85
+ nonunionism
86
+ overmarl
87
+ parochialization
88
+ quadriparous
89
+ radiotelegraph
90
+ sobby
91
+ tailpipe
92
+ undefectiveness
93
+ vintaging
94
+ wheaten
95
+ xanthydrol
96
+ yesso
97
+ zircofluoride
98
+ )
99
+
100
+ puts ListToColumns.new(words, width: 60, space: 3)
101
+ ```
102
+
103
+ Output:
104
+
105
+ antipyic jagrata sobby
106
+ baccheion knuclesome tailpipe
107
+ conormal libidinal undefectiveness
108
+ diet myoclonic vintaging
109
+ extracloacal nonunionism wheaten
110
+ fadridden overmarl xanthydrol
111
+ germifuge parochialization yesso
112
+ hovering quadriparous zircofluoride
113
+ isomerical radiotelegraph
58
114
 
59
115
  Development
60
116
  -----------
data/bin/console CHANGED
@@ -6,9 +6,5 @@ require 'list_to_columns'
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.
8
8
 
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require 'irb'
14
- IRB.start
9
+ require 'pry'
10
+ Pry.start
@@ -30,6 +30,7 @@ module ListToColumns
30
30
  end
31
31
 
32
32
  def matrix
33
+ return [].freeze if @strings.empty?
33
34
  @matrix ||= @strings
34
35
  .each_slice(number_of_rows)
35
36
  .to_a
@@ -22,6 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
+ spec.required_ruby_version = '>= 2.0.0'
26
+
25
27
  spec.add_development_dependency 'bundler', '~> 1.10'
26
28
  spec.add_development_dependency 'rake', '~> 10.0'
27
29
  spec.add_development_dependency 'psych'
@@ -31,4 +33,5 @@ Gem::Specification.new do |spec|
31
33
  spec.add_development_dependency 'simplecov'
32
34
  spec.add_development_dependency 'coveralls'
33
35
  spec.add_development_dependency 'semver2', '~> 3.4'
36
+ spec.add_development_dependency 'pry'
34
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: list_to_columns
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Höltje
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '3.4'
139
+ - !ruby/object:Gem::Dependency
140
+ name: pry
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: Given an Array of Strings, it formats it into columns to make it more
140
154
  compact for terminal displays.
141
155
  email:
@@ -171,7 +185,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
171
185
  requirements:
172
186
  - - ">="
173
187
  - !ruby/object:Gem::Version
174
- version: '0'
188
+ version: 2.0.0
175
189
  required_rubygems_version: !ruby/object:Gem::Requirement
176
190
  requirements:
177
191
  - - ">="