adamh-glob_fu 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -23,6 +23,7 @@ Some examples:
23
23
 
24
24
  # Finds /home/adam/* and /home/adam/subdir/*
25
25
  GlobFu.find('*', 'subdir/*', :root => '/home/adam')
26
+ GlobFu.find(['*', 'subdir/*'], :root => '/home/adam')
26
27
 
27
28
  # Finds /*.txt but not /*.anything.txt
28
29
  GlobFu.find('/*', :suffix => 'txt')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/glob_fu.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{glob_fu}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["adamh"]
data/lib/glob_fu.rb CHANGED
@@ -1,11 +1,9 @@
1
1
  module GlobFu
2
2
  class << self
3
3
  def find(*args, &block)
4
- options = if Hash === args.last
5
- args.pop
6
- else
7
- {}
8
- end
4
+ options = (Hash === args.last) ? args.pop : {}
5
+ args = args.first if Array === args.first
6
+
9
7
  results = do_find(args, options)
10
8
 
11
9
  if block
data/spec/glob_fu_spec.rb CHANGED
@@ -48,6 +48,11 @@ describe(GlobFu) do
48
48
  f('x', 'y', :root => prefix).should == ["#{prefix}/x", "#{prefix}/y"]
49
49
  end
50
50
 
51
+ it('should allow Array argument') do
52
+ fs('x', 'y')
53
+ f(['x', 'y'], :root => prefix).should == ["#{prefix}/x", "#{prefix}/y"]
54
+ end
55
+
51
56
  it('should remove duplicates') do
52
57
  fs('x')
53
58
  f('x', 'x', :root => prefix).should == ["#{prefix}/x"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adamh-glob_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - adamh