css_parser 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/css_parser/parser.rb +5 -1
- data/lib/css_parser.rb +1 -1
- data/test/test_css_parser_basic.rb +1 -1
- data/test/test_css_parser_loading.rb +2 -2
- data/test/test_css_parser_media_types.rb +1 -1
- data/test/test_css_parser_misc.rb +1 -1
- data/test/test_css_parser_regexps.rb +1 -1
- data/test/test_merging.rb +1 -1
- data/test/test_rule_set.rb +1 -1
- data/test/test_rule_set_creating_shorthand.rb +1 -1
- data/test/test_rule_set_expanding_shorthand.rb +1 -1
- metadata +3 -6
data/lib/css_parser/parser.rb
CHANGED
@@ -291,7 +291,10 @@ module CssParser
|
|
291
291
|
base_uri = uri if base_uri.nil?
|
292
292
|
|
293
293
|
src, charset = read_remote_file(uri)
|
294
|
-
|
294
|
+
|
295
|
+
if src
|
296
|
+
add_block!(src, {:media_types => media_types, :base_uri => base_uri})
|
297
|
+
end
|
295
298
|
end
|
296
299
|
|
297
300
|
# Load a local CSS file.
|
@@ -381,6 +384,7 @@ module CssParser
|
|
381
384
|
end
|
382
385
|
rescue
|
383
386
|
raise RemoteFileError if @options[:io_exceptions]
|
387
|
+
return nil, nil
|
384
388
|
end
|
385
389
|
|
386
390
|
return src, charset
|
data/lib/css_parser.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/test_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/test_helper')
|
2
2
|
|
3
3
|
# Test cases for the CssParser's loading functions.
|
4
4
|
class CssParserLoadingTests < Test::Unit::TestCase
|
@@ -39,7 +39,7 @@ class CssParserLoadingTests < Test::Unit::TestCase
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_loading_a_local_file_with_scheme
|
42
|
-
file_name = 'file://' + File.dirname(__FILE__) + '/fixtures/simple.css'
|
42
|
+
file_name = 'file://' + File.expand_path(File.dirname(__FILE__)) + '/fixtures/simple.css'
|
43
43
|
@cp.load_uri!(file_name)
|
44
44
|
assert_equal 'margin: 0px;', @cp.find_by_selector('p').join(' ')
|
45
45
|
end
|
data/test/test_merging.rb
CHANGED
data/test/test_rule_set.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: css_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 21
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 1
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
8
|
+
- 4
|
9
|
+
version: 1.1.4
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Alex Dunae
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-11-
|
17
|
+
date: 2010-11-11 00:00:00 -08:00
|
19
18
|
default_executable:
|
20
19
|
dependencies: []
|
21
20
|
|
@@ -65,7 +64,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
64
|
requirements:
|
66
65
|
- - ">="
|
67
66
|
- !ruby/object:Gem::Version
|
68
|
-
hash: 3
|
69
67
|
segments:
|
70
68
|
- 0
|
71
69
|
version: "0"
|
@@ -74,7 +72,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
72
|
requirements:
|
75
73
|
- - ">="
|
76
74
|
- !ruby/object:Gem::Version
|
77
|
-
hash: 3
|
78
75
|
segments:
|
79
76
|
- 0
|
80
77
|
version: "0"
|