dry_css 0.0.7 → 0.0.8

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: 44af193810a4b87478215fdb6963169300cc528f
4
- data.tar.gz: b6981de3127f1432527294236d949b22bc9ada8d
3
+ metadata.gz: 7251789431c477dd2ec11073ee3c7efbcd416963
4
+ data.tar.gz: e791dd2e16745cc828699dc40aed089e945ce4de
5
5
  SHA512:
6
- metadata.gz: 8e8435b7ab0879fd377438897218856018f7b51d71eae6c8c4a6b14163671c5e99c91155970db232796a187393ecf42fc500b417e609f18fcb55b7fcc784cde4
7
- data.tar.gz: 6a73b695e408e1bdeb2355ece0b9371eeb92f3b83485fdb4c863b87c18f4590fc61bef81a89fa2921f7a5ae05d875806463e7ad155caa74c641e5d5cbe4273ee
6
+ metadata.gz: 35208f3c8419a4dca7d54b30765df4089e8a7c35401f0a274c2cb7ced5fa4c79cd6aa9be595a79a3d835b32ac7d19ccc69b424d4b152aaf77d8dfdc505db1370
7
+ data.tar.gz: 77f0fa8a118cabbe39cf91f6852b0ef56b4b9c77ea56c544a25ba49be2cb0d361006d93e1c59bec18c0cade2c4b7c8f3bb886fadb5c473e5e7336958f81b71fa
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ lib/run*
@@ -20,7 +20,10 @@ module DryCss
20
20
  threads = []
21
21
  uris.each do |u|
22
22
  threads << Thread.new(u) do |uri|
23
- parser.load_uri!(uri)
23
+ begin
24
+ parser.load_uri!(uri)
25
+ rescue CssParser::RemoteFileError
26
+ end
24
27
  end
25
28
  end
26
29
  threads.each{|thr| thr.join }
@@ -30,7 +33,7 @@ module DryCss
30
33
  def scan_for(property)
31
34
  values_hash = {:counts => Hash.new(0), :total => 0}
32
35
  @parser.each_selector do |selector, declarations, specificity|
33
- declarations.scan(/([\w-]+):[ ]?(#{property})/) do |prop,val|
36
+ declarations.scan(/([\.\w:]+)?(#{property})/) do |prop,val|
34
37
  values_hash[:counts][val.to_sym] += 1
35
38
  values_hash[:total] += 1
36
39
  end
@@ -1,3 +1,3 @@
1
1
  module DryCss
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -21,4 +21,11 @@ describe DryCss::CSS do
21
21
  @css.colors.should eq({:counts => {:"#fff;"=>2, :"#000;"=>4}, :total => 6})
22
22
  end
23
23
 
24
+ it 'ignores bad uris' do
25
+ file_name = 'file://' + File.expand_path(File.dirname(__FILE__)) + '/../fixtures/example.css'
26
+ file_name2 = 'file://' + File.expand_path(File.dirname(__FILE__)) + '/../fixtures/example404.css'
27
+ @css = DryCss::CSS.new(file_name, file_name2)
28
+ @css.colors.should eq({:counts => {:"#fff;"=>1, :"#000;"=>2}, :total => 3})
29
+ end
30
+
24
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry_css
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - gpxl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-20 00:00:00.000000000 Z
11
+ date: 2013-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler