This commit is contained in:
Christian Mehlmauer
2015-08-22 21:50:01 +02:00
parent 3a6a451db1
commit ec68291bf0
2 changed files with 227 additions and 222 deletions

View File

@@ -31,7 +31,7 @@ class WpVersion < WpItem
#
# @return [ String ]
def version_pattern
'([^\r\n"\']+\.[^\r\n"\']+)'
'([^\r\n"\',]+\.[^\r\n"\',]+)'
end
protected
@@ -68,7 +68,7 @@ class WpVersion < WpItem
def find_from_meta_generator(target_uri)
scan_url(
target_uri,
%r{name="generator" content="wordpress #{version_pattern}"}i
%r{name="generator" content="wordpress #{version_pattern}.*"}i
)
end

View File

@@ -65,6 +65,11 @@ describe 'WpVersion::Findable' do
@fixture = '/3.5_minified.html'
@expected = '3.5'
end
it 'returns 3.5.1' do
@fixture = '/3.5.1_mobile.html'
@expected = '3.5.1'
end
end
end