adamh-glob_fu 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -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.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["adamh"]
@@ -41,11 +41,11 @@ module GlobFu
41
41
 
42
42
  suffix_regex = ""
43
43
  if options[:extra_suffix]
44
- suffix_regex << "\.#{Regexp.quote(options[:extra_suffix])}"
44
+ suffix_regex << "\\.#{Regexp.quote(options[:extra_suffix])}"
45
45
  end
46
- suffix_regex << "\.#{Regexp.quote(options[:suffix])}"
46
+ suffix_regex << "\\.#{Regexp.quote(options[:suffix])}"
47
47
  if options[:optional_suffix]
48
- suffix_regex << "(\.#{Regexp.quote(options[:optional_suffix])})?"
48
+ suffix_regex << "(\\.#{Regexp.quote(options[:optional_suffix])})?"
49
49
  end
50
50
 
51
51
  regex = %r{(/|^)#{basename_regex}#{suffix_regex}$}
@@ -93,6 +93,11 @@ describe(GlobFu) do
93
93
  f('x', :root => prefix, :suffix => 'txt', :extra_suffix => 'X').should == []
94
94
  end
95
95
 
96
+ it('should need a dot before :extra_suffix') do
97
+ fs('xX.txt', 'xX.X.txt')
98
+ f('xX', :root => prefix, :suffix => 'txt', :extra_suffix => 'X').should == [ "#{prefix}/xX.X.txt" ]
99
+ end
100
+
96
101
  it('should allow :extra_suffix and :optional_suffix in combination') do
97
102
  fs('x.X.txt.gz')
98
103
  f('x', :root => prefix, :suffix => 'txt', :extra_suffix => 'X', :optional_suffix => 'gz').should == ["#{prefix}/x.X.txt.gz"]
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - adamh