da_huangs_ruby_extensions 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/array_ext.rb +9 -0
  3. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.16
1
+ 0.0.17
data/lib/array_ext.rb CHANGED
@@ -62,6 +62,15 @@ module DaHuang
62
62
  def strip_all
63
63
  map!{|t| t.strip}
64
64
  end
65
+
66
+ def squash(width)
67
+ returning new_ary = [] do
68
+ rows = (self.size.to_f/width + 0.49).round
69
+ (1..rows).each do |row_num|
70
+ new_ary << self[(width*(row_num-1))..(width*(row_num-1) + width-1)]
71
+ end
72
+ end
73
+ end
65
74
  end
66
75
 
67
76
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: da_huangs_ruby_extensions
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 16
10
- version: 0.0.16
9
+ - 17
10
+ version: 0.0.17
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tyler Gannon
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-06 00:00:00 -07:00
18
+ date: 2010-08-07 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency