mofa 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mofa/hostlist.rb +8 -5
- data/lib/mofa/version.rb +1 -1
- metadata +2 -2
data/lib/mofa/hostlist.rb
CHANGED
@@ -48,7 +48,6 @@ class Hostlist
|
|
48
48
|
else
|
49
49
|
fail "Hostlist Service Url either has to be a http(s):// or a file:/// Url!"
|
50
50
|
end
|
51
|
-
|
52
51
|
apply_filter
|
53
52
|
sort_by_domainname
|
54
53
|
end
|
@@ -60,11 +59,15 @@ class Hostlist
|
|
60
59
|
end
|
61
60
|
|
62
61
|
def apply_filter
|
63
|
-
# building matcher
|
64
|
-
regex = @filter.gsub(/\*/, '__ASTERISK__')
|
65
|
-
regex = Regexp.escape(regex).gsub(/__ASTERISK__/, '.*')
|
66
|
-
regex = '^' + regex + '$'
|
67
62
|
|
63
|
+
if @filter[0] == '/' && @filter[-1] == '/' && @filter.length > 2
|
64
|
+
regex = @filter[1..-2]
|
65
|
+
else
|
66
|
+
# building matcher
|
67
|
+
regex = @filter.gsub(/\*/, '__ASTERISK__')
|
68
|
+
regex = Regexp.escape(regex).gsub(/__ASTERISK__/, '.*')
|
69
|
+
regex = '^' + regex + '$'
|
70
|
+
end
|
68
71
|
@list.select! { |hostname| hostname.match(regex) }
|
69
72
|
end
|
70
73
|
|
data/lib/mofa/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mofa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
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: 2015-04-
|
12
|
+
date: 2015-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|