epitools 0.5.10 → 0.5.11

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -18,7 +18,7 @@ Extras:
18
18
  * {Browser}[http://rdoc.info/github/epitron/epitools/master/Browser] (a fake browser, with a cache, cookies, download progress bars, plus the rest of the mechanize/nokogiri API you know and love)
19
19
  * {Rash}[http://rdoc.info/github/epitron/epitools/master/Rash] (a hash which can have Regexps as keys, so that many input keys can map to a single value.)
20
20
  * {Progressbar}[http://rdoc.info/github/epitron/epitools/master/Progressbar] (better than the progressbar gem)
21
- * {MimeMagic}[http://rdoc.info/github/epitron/epitools/master/MimeMagic] (a port of the Unix `file` utility for automatically recognizing files based on their contents; faster than running `file` on every file if you have to process large batches of files)
21
+ * {MimeMagic}[http://rdoc.info/github/epitron/epitools/master/MimeMagic] (a port of the Unix `file` utility for automatically recognizing files based on their contents; faster than running `file` on every file if you have to process large batches of files. This is originally from the mimemagic gem by {Daniel Mendler}[https://github.com/minad], and has been slightly modified and enhanced.)
22
22
 
23
23
  == Installing
24
24
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.10
1
+ 0.5.11
data/epitools.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "epitools"
8
- s.version = "0.5.10"
8
+ s.version = "0.5.11"
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 = "2012-08-26"
12
+ s.date = "2012-09-22"
13
13
  s.description = "Miscellaneous utility libraries to make my life easier."
14
14
  s.email = "chris@ill-logic.com"
15
15
  s.extra_rdoc_files = [
@@ -89,7 +89,7 @@ Gem::Specification.new do |s|
89
89
  s.homepage = "http://github.com/epitron/epitools"
90
90
  s.licenses = ["WTFPL"]
91
91
  s.require_paths = ["lib"]
92
- s.rubygems_version = "1.8.23"
92
+ s.rubygems_version = "1.8.24"
93
93
  s.summary = "NOT UTILS... METILS!"
94
94
 
95
95
  if s.respond_to? :specification_version then
@@ -68,6 +68,20 @@ class String
68
68
  alias_method :nicelines, :nice_lines
69
69
  alias_method :clean_lines, :nice_lines
70
70
 
71
+
72
+ #
73
+ # Iterate over slices of the string of size `slice_width`.
74
+ #
75
+ def each_slice(slice_width, &block)
76
+ max = size
77
+ p = 0
78
+ while p < max
79
+ yield self[p...p+slice_width]
80
+ p += slice_width
81
+ end
82
+ end
83
+ enumerable :each_slice
84
+
71
85
  #
72
86
  # The Infamous Caesar-Cipher. Unbreakable to this day.
73
87
  #
@@ -235,6 +235,12 @@ describe String do
235
235
  "dollar".amount(-10).should == "-10 dollars"
236
236
  "love".amount(1).should == "1 love"
237
237
  end
238
+
239
+ it "slices" do
240
+ e = "hellothere!".each_slice(2)
241
+ e.should be_an Enumerator
242
+ e.to_a.should == %w[he ll ot he re !]
243
+ end
238
244
 
239
245
  end
240
246
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epitools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10
4
+ version: 0.5.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-26 00:00:00.000000000 Z
12
+ date: 2012-09-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  version: '0'
157
157
  requirements: []
158
158
  rubyforge_project:
159
- rubygems_version: 1.8.23
159
+ rubygems_version: 1.8.24
160
160
  signing_key:
161
161
  specification_version: 3
162
162
  summary: NOT UTILS... METILS!