dry_css 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 159f5a33b177be984628921f9143ec99d64a64e0
4
- data.tar.gz: 97544bd5d36c5a25aeaf39e354281807b31a70de
3
+ metadata.gz: 715b08fff1108bbcfbd82a55c80c98f263c5338e
4
+ data.tar.gz: 9ff80abc74feef65d18959150a3fec5dd4b759d6
5
5
  SHA512:
6
- metadata.gz: e025b4f613eccab6adf644c5efe1f4d0ee2c8fc246df809d80aadd3b60c938f7968d96656b6940907c40237f5888b9d5fd27db7f81d090b927fafda49e5e7aec
7
- data.tar.gz: 93f4463756bb54fc0b51bdf4510a8b6646e24b59a88d2d5c97a488fb4de2234aac7a9f954ce747ad3dae06be236ce6a6060c91df80d05846e07700a1957bb127
6
+ metadata.gz: 8122f42b01fb9e686bfb2eb413854d04cb101681f1d857cbe9de1037f7a917a88941e5acce66f4ae6eff9409717048a0ba31d53e8986717bbeef03862f1e80f4
7
+ data.tar.gz: 14c54241520404ce04304cc5792b35b9cc9e78f5861d0e505767ff1f2915459cf4e913cff5a545f0effbc4fd239a193d429bb0d4b9bcf8b34a33a44d74a7aa9a
data/lib/dry_css/site.rb CHANGED
@@ -7,7 +7,7 @@ module DryCss
7
7
  class Site
8
8
  def initialize(uri)
9
9
  @uri = uri
10
- @html = Nokogiri::HTML(open(uri, :allow_redirections => :safe))
10
+ @html = Nokogiri::HTML(open(uri, :allow_redirections => :all))
11
11
  end
12
12
 
13
13
  def uris
@@ -23,7 +23,13 @@ module DryCss
23
23
  end
24
24
 
25
25
  def ensure_full_uri(path)
26
- path[0] == '/' ? @uri + path : path
26
+ if path[0..1] == '//'
27
+ 'http:' + path
28
+ elsif path[0] == '/'
29
+ @uri + path
30
+ else
31
+ path
32
+ end
27
33
  end
28
34
 
29
35
  end
@@ -1,3 +1,3 @@
1
1
  module DryCss
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -6,6 +6,7 @@
6
6
  <title></title>
7
7
  <link href="/example.css" media="all" rel="stylesheet" type="text/css" />
8
8
  <link href="/example2.css" media="all" rel="stylesheet" type="text/css" />
9
+ <link href="//www.example.com/example2.css" media="all" rel="stylesheet" type="text/css" />
9
10
  </head>
10
11
  <body>
11
12
  <h1>Example Page</h1>
@@ -11,7 +11,11 @@ describe DryCss::Site do
11
11
  file_name = File.dirname(__FILE__) + '/../fixtures/example_relative.html'
12
12
  @site = DryCss::Site.new(file_name)
13
13
  # We prepend 'file_name' for tests in place of uri for production
14
- @site.uris.should eq([file_name + '/example.css', file_name + '/example2.css'])
14
+ @site.uris.should eq([
15
+ file_name + '/example.css',
16
+ file_name + '/example2.css',
17
+ 'http://www.example.com/example2.css'
18
+ ])
15
19
  end
16
20
 
17
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry_css
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - gpxl