epitools 0.4.22 → 0.4.23

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.22
1
+ 0.4.23
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{epitools}
8
- s.version = "0.4.22"
8
+ s.version = "0.4.23"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["epitron"]
12
- s.date = %q{2011-04-06}
12
+ s.date = %q{2011-04-10}
13
13
  s.description = %q{Miscellaneous utility libraries to make my life easier.}
14
14
  s.email = %q{chris@ill-logic.com}
15
15
  s.extra_rdoc_files = [
@@ -221,6 +221,13 @@ class Array
221
221
  reverse.zip(other.reverse).reverse
222
222
  end
223
223
 
224
+ #
225
+ # Pick the middle element.
226
+ #
227
+ def middle
228
+ self[(size-1) / 2]
229
+ end
230
+
224
231
  end
225
232
 
226
233
 
@@ -151,6 +151,13 @@ describe Array do
151
151
  [5,39].rzip([:hours, :mins, :secs]).should == [ [5, :mins], [39, :secs] ]
152
152
  end
153
153
 
154
+ it "middles" do
155
+ a = [0,1,2,3,4,5]
156
+ a.middle.should == 2
157
+ a << 6
158
+ a.middle.should == 3
159
+ end
160
+
154
161
  end
155
162
 
156
163
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: epitools
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.22
5
+ version: 0.4.23
6
6
  platform: ruby
7
7
  authors:
8
8
  - epitron
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-06 00:00:00 -04:00
13
+ date: 2011-04-10 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency