crass 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -4
- data/HISTORY.md +6 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/Rakefile +9 -0
- data/lib/crass/parser.rb +2 -2
- data/lib/crass/tokenizer.rb +6 -6
- data/lib/crass/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef1bd09fd5e081df138061c200938cb6f197a62e
|
4
|
+
data.tar.gz: 71f860902672bf678340a722bf6c811d63eab276
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95fd718bb11a892f968cf9690ae5653b7285accecd5e7deb456e31ff0b66a9241b0aa4f3fa91fcdde887a119555380315babbbe4cf2ed9aef8228b25e3c41155
|
7
|
+
data.tar.gz: 2fb2f4e30b20d179ca512c524cfe70e80da3258457d2c2b4b046ac9106ad209b79377f75749463c20fc8b0a9e5863bea5dcca827deea0b974ba955c12e55b0f1
|
data/.travis.yml
CHANGED
data/HISTORY.md
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -194,7 +194,7 @@ tokenizing and parsing rules that Crass implements.
|
|
194
194
|
License
|
195
195
|
-------
|
196
196
|
|
197
|
-
Copyright (c)
|
197
|
+
Copyright (c) 2017 Ryan Grove (ryan@wonko.com)
|
198
198
|
|
199
199
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
200
200
|
this software and associated documentation files (the ‘Software’), to deal in
|
data/Rakefile
CHANGED
@@ -6,6 +6,15 @@ Bundler::GemHelper.install_tasks
|
|
6
6
|
Rake::TestTask.new
|
7
7
|
task :default => [:test]
|
8
8
|
|
9
|
+
task :test => :set_frozen_string_literal_option
|
10
|
+
task :set_frozen_string_literal_option do
|
11
|
+
if RUBY_ENGINE == "ruby" && RUBY_VERSION >= "2.3"
|
12
|
+
warn "NOTE: Testing support for frozen string literals"
|
13
|
+
ENV['RUBYOPT'] ||= ""
|
14
|
+
ENV['RUBYOPT'] += " --enable-frozen-string-literal --debug=frozen-string-literal"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
9
18
|
task :'pull-css-tests' do
|
10
19
|
sh 'git subtree pull -P test/css-parsing-tests https://github.com/SimonSapin/css-parsing-tests.git master --squash'
|
11
20
|
end
|
data/lib/crass/parser.rb
CHANGED
@@ -73,7 +73,7 @@ module Crass
|
|
73
73
|
#
|
74
74
|
def self.stringify(nodes, options = {})
|
75
75
|
nodes = [nodes] unless nodes.is_a?(Array)
|
76
|
-
string =
|
76
|
+
string = String.new
|
77
77
|
|
78
78
|
nodes.each do |node|
|
79
79
|
next if node.nil?
|
@@ -614,7 +614,7 @@ module Crass
|
|
614
614
|
# Returns the unescaped value of a selector name or property declaration.
|
615
615
|
def parse_value(nodes)
|
616
616
|
nodes = [nodes] unless nodes.is_a?(Array)
|
617
|
-
string =
|
617
|
+
string = String.new
|
618
618
|
|
619
619
|
nodes.each do |node|
|
620
620
|
case node[:node]
|
data/lib/crass/tokenizer.rb
CHANGED
@@ -273,7 +273,7 @@ module Crass
|
|
273
273
|
#
|
274
274
|
# 4.3.15. http://dev.w3.org/csswg/css-syntax/#consume-the-remnants-of-a-bad-url
|
275
275
|
def consume_bad_url
|
276
|
-
text =
|
276
|
+
text = String.new
|
277
277
|
|
278
278
|
until @s.eos?
|
279
279
|
if valid_escape?
|
@@ -373,7 +373,7 @@ module Crass
|
|
373
373
|
#
|
374
374
|
# 4.3.12. http://dev.w3.org/csswg/css-syntax/#consume-a-name
|
375
375
|
def consume_name
|
376
|
-
result =
|
376
|
+
result = String.new
|
377
377
|
|
378
378
|
until @s.eos?
|
379
379
|
if match = @s.scan(RE_NAME)
|
@@ -405,7 +405,7 @@ module Crass
|
|
405
405
|
#
|
406
406
|
# 4.3.13. http://dev.w3.org/csswg/css-syntax/#consume-a-number
|
407
407
|
def consume_number
|
408
|
-
repr =
|
408
|
+
repr = String.new
|
409
409
|
type = :integer
|
410
410
|
|
411
411
|
repr << @s.consume if @s.peek =~ RE_NUMBER_SIGN
|
@@ -459,7 +459,7 @@ module Crass
|
|
459
459
|
# 4.3.5. http://dev.w3.org/csswg/css-syntax/#consume-a-string-token
|
460
460
|
def consume_string(ending = nil)
|
461
461
|
ending = @s.current if ending.nil?
|
462
|
-
value =
|
462
|
+
value = String.new
|
463
463
|
|
464
464
|
until @s.eos?
|
465
465
|
case char = @s.consume
|
@@ -499,7 +499,7 @@ module Crass
|
|
499
499
|
#
|
500
500
|
# 4.3.7. http://dev.w3.org/csswg/css-syntax/#consume-a-unicode-range-token
|
501
501
|
def consume_unicode_range
|
502
|
-
value = @s.scan(RE_HEX) ||
|
502
|
+
value = @s.scan(RE_HEX) || String.new
|
503
503
|
|
504
504
|
while value.length < 6
|
505
505
|
break unless @s.peek == '?'
|
@@ -531,7 +531,7 @@ module Crass
|
|
531
531
|
#
|
532
532
|
# 4.3.6. http://dev.w3.org/csswg/css-syntax/#consume-a-url-token
|
533
533
|
def consume_url
|
534
|
-
value =
|
534
|
+
value = String.new
|
535
535
|
|
536
536
|
@s.scan(RE_WHITESPACE)
|
537
537
|
|
data/lib/crass/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Grove
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.6.11
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: CSS parser based on the CSS Syntax Level 3 spec.
|