Module: WpTimthumb::Versionable

Included in:
WpTimthumb
Defined in:
lib/common/models/wp_timthumb/versionable.rb

Instance Method Summary collapse

Instance Method Details

#to_sString


19
20
21
# File 'lib/common/models/wp_timthumb/versionable.rb', line 19

def to_s
  "#{url}#{ ' v' + version if version}"
end

#versionString

Get the version from the body of an invalid request See code.google.com/p/timthumb/source/browse/trunk/timthumb.php#426


10
11
12
13
14
15
16
# File 'lib/common/models/wp_timthumb/versionable.rb', line 10

def version
  unless @version
    response = Browser.get(url)
    @version = response.body[%r{TimThumb version\s*: ([^<]+)} , 1]
  end
  @version
end