style_stats 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b568233edd849c4e997513c318c77424041320a
4
- data.tar.gz: 8107eda3e1613d7cda524877090160bbd596b714
3
+ metadata.gz: 742d02e0bef17c6989648b3b6bb1b1c9661ebddd
4
+ data.tar.gz: 270007382adc81f3aff8ca038b1a8dbbac98aeb1
5
5
  SHA512:
6
- metadata.gz: 6af12e4c8de4fcb590610aee1684aaefea996a624a9ef5fafdb419db71f377ad37fbe63ae2eafd8bb2536005938e7550926339cf5c618df6de7880f2b373f3d6
7
- data.tar.gz: 5b108d88d3d11d382e728da55b00281fce1f75485b1bc6974f18d709e9b424c79c52a0b5138c00347329f17f0264f1be7f42d120d3cf314acf0733ae562ecb82
6
+ metadata.gz: d1af73040e12209070e82bc38244a549650d03cebad5a85da317465f561f8019edaaa64956569f30b4a352b473dc4f2f3e092f09434c2fa8b0eb3b73a2588326
7
+ data.tar.gz: f0d39ad06b01511b4fc2ead0a46f6350b719f566ce2912fce239d954609361f0b60b20e5916a883fbb844dc41f0229b167e4f1ae36302f5bff635bced274423a
@@ -18,7 +18,7 @@ class StyleStats::Css
18
18
  end
19
19
 
20
20
  def request(path)
21
- file = open(path, headers)
21
+ file = open(path, options)
22
22
  case file.content_type
23
23
  when 'text/css'
24
24
  self.stylesheets.push(file.read)
@@ -41,19 +41,20 @@ class StyleStats::Css
41
41
  base = URI.parse(url)
42
42
  doc.xpath('//link[@rel="stylesheet"]').map do |node|
43
43
  uri = URI.parse(node.get("href"))
44
- uri.scheme = 'http' unless uri.scheme
44
+ uri.scheme = base.scheme unless uri.scheme
45
45
  uri.host = base.host unless uri.host
46
46
  uri.port = base.port unless uri.port
47
47
  uri.to_s
48
48
  end
49
49
  end
50
50
 
51
- def headers
52
- if StyleStats.configuration.options[:requestOptions][:headers]['User-Agent']
53
- StyleStats.configuration.options[:requestOptions][:headers]
54
- else
55
- { 'User-Agent' => "Ruby/StyleStats #{StyleStats::VERSION}" }
56
- end
51
+ def options
52
+ options = if StyleStats.configuration.options[:requestOptions][:headers]['User-Agent']
53
+ StyleStats.configuration.options[:requestOptions][:headers]
54
+ else
55
+ { 'User-Agent' => "Ruby/StyleStats #{StyleStats::VERSION}" }
56
+ end
57
+ options.merge(ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE)
57
58
  end
58
59
  end
59
60
  end
@@ -1,3 +1,3 @@
1
1
  class StyleStats
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: style_stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - shiro16
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-01 00:00:00.000000000 Z
11
+ date: 2015-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oga