fast 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,5 +5,13 @@ module Fast
5
5
  def initialize set
6
6
  @set = set
7
7
  end
8
+
9
+ def extension the_extension
10
+ return_me = []
11
+ @set.each do |entry|
12
+ return_me << entry if entry.end_with? the_extension
13
+ end
14
+ return_me
15
+ end
8
16
  end
9
17
  end
data/lib/fast/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fast
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -4,7 +4,14 @@ require "zucker/os"
4
4
  describe Fast::DirFilter do
5
5
  describe "#extension" do
6
6
  context "when given a list of file names and a extension" do
7
- it "should return a list of the files with the given extension"
7
+ it "should return a list of the files with the given extension" do
8
+ list = ["file.txt", "data.txt", "thumbs.db", "data.txt.jpg"]
9
+ final_list = Fast::DirFilter.new( list ).extension "txt"
10
+ final_list.should include "file.txt"
11
+ final_list.should include "data.txt"
12
+ final_list.should_not include "thumbs.db"
13
+ final_list.should_not include "data.txt.jpg"
14
+ end
8
15
  end
9
16
  end
10
17
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Xavier Via