image_scraper 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{image_scraper}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["John McAliley"]
@@ -1,7 +1,7 @@
1
1
  module ImageScraper
2
2
  module Util
3
3
  def self.absolute_url(url,asset=nil)
4
- return domain(url) + path(url) if asset.nil? and asset.include("://")
4
+ return url if asset.nil?
5
5
  return asset if asset.include?("://")
6
6
  return domain(url)+asset if asset[0]=="/"
7
7
  return domain(url) =~ /\/$/ ? domain(url)+asset : domain(url)+"/"+asset
@@ -38,6 +38,8 @@ class TestImageScraper < Test::Unit::TestCase
38
38
  assert_equal "http://www.test.com/images/image.gif", ImageScraper::Util.absolute_url("http://www.test.com/","/images/image.gif")
39
39
  assert_equal "http://www.test.com/images/image.gif", ImageScraper::Util.absolute_url("http://www.test.com/","images/image.gif")
40
40
  assert_equal "http://www.test.com/images/image.gif", ImageScraper::Util.absolute_url("http://www.test.com/","/images/image.gif")
41
+ assert_equal "http://www.test.com/", ImageScraper::Util.absolute_url("http://www.test.com/")
42
+ assert_equal "http://www.test.com/123/test.html", ImageScraper::Util.absolute_url("http://www.test.com/123/test.html")
41
43
  end
42
44
 
43
45
  should "return images from a stylesheet" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - John McAliley
@@ -175,7 +175,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
175
175
  requirements:
176
176
  - - ">="
177
177
  - !ruby/object:Gem::Version
178
- hash: -738762267344225369
178
+ hash: 1808945609058877592
179
179
  segments:
180
180
  - 0
181
181
  version: "0"