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 +1 -1
- data/image_scraper.gemspec +1 -1
- data/lib/image_scraper/util.rb +1 -1
- data/test/test_image_scraper.rb +2 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/image_scraper.gemspec
CHANGED
data/lib/image_scraper/util.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module ImageScraper
|
2
2
|
module Util
|
3
3
|
def self.absolute_url(url,asset=nil)
|
4
|
-
return
|
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
|
data/test/test_image_scraper.rb
CHANGED
@@ -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
|
-
-
|
9
|
-
version: 0.1.
|
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:
|
178
|
+
hash: 1808945609058877592
|
179
179
|
segments:
|
180
180
|
- 0
|
181
181
|
version: "0"
|