hike 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hike.rb +1 -1
- data/lib/hike/trail.rb +5 -6
- metadata +4 -4
data/lib/hike.rb
CHANGED
data/lib/hike/trail.rb
CHANGED
@@ -41,7 +41,7 @@ module Hike
|
|
41
41
|
|
42
42
|
def filename_pattern_for(basename)
|
43
43
|
extension_pattern = extensions.map { |e| Regexp.escape(e) }.join("|")
|
44
|
-
/^#{Regexp.escape(basename)}(?:#{extension_pattern}|)
|
44
|
+
/^#{Regexp.escape(basename)}(?:#{extension_pattern}|)+$/
|
45
45
|
end
|
46
46
|
|
47
47
|
def match_from(matches, basename)
|
@@ -53,11 +53,10 @@ module Hike
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def ordered_match_from(matches, basename)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
end
|
60
|
-
basename
|
56
|
+
matches.sort_by do |match|
|
57
|
+
extnames = match[basename.length..-1].scan(/.[^.]+/)
|
58
|
+
extnames.inject(0) { |sum, ext| sum + extensions.index(ext) + 1 }
|
59
|
+
end.first
|
61
60
|
end
|
62
61
|
end
|
63
62
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hike
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sam Stephenson
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-07 01:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|