Module: Assetify::Helpers

Included in:
Asset, Pkg
Defined in:
lib/assetify/helpers.rb

Instance Method Summary collapse

Instance Method Details

#find_version(txt) ⇒ Object

Detects numerical software version from text.



9
10
11
12
13
14
15
16
17
# File 'lib/assetify/helpers.rb', line 9

def find_version(txt)
  return unless txt
  if txt.binary?
    find_version_from_bin(txt)
  else
    v = find_version_from_txt(txt)
    v && v[0] =~ /(\d+)\.(\d+).*/ ? v :  find_version_from_bin(txt)
  end
end