crass 1.0.2 → 1.0.3

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: 3371590f5953c99ef49044bb7866a70568707f5c
4
- data.tar.gz: 16bab682ee608b24dda34b8181cf1a4733a9d9c5
3
+ metadata.gz: ef1bd09fd5e081df138061c200938cb6f197a62e
4
+ data.tar.gz: 71f860902672bf678340a722bf6c811d63eab276
5
5
  SHA512:
6
- metadata.gz: 77f57cca2304bf549e5ba35281364806634397b88ecdeda3310a1e38c17cff83346ef423db1b719b05c744281e4eedfbe85f5df4b9e5fb6883bf092efead5be2
7
- data.tar.gz: 43d3a7ee5ae7670fffeb35c8843321a70d65447aea7f2ca8a650c8c772d2f8ad92804c20639137eae05296ad13a920a898f9735385d73d6811fdd026396c57fe
6
+ metadata.gz: 95fd718bb11a892f968cf9690ae5653b7285accecd5e7deb456e31ff0b66a9241b0aa4f3fa91fcdde887a119555380315babbbe4cf2ed9aef8228b25e3c41155
7
+ data.tar.gz: 2fb2f4e30b20d179ca512c524cfe70e80da3258457d2c2b4b046ac9106ad209b79377f75749463c20fc8b0a9e5863bea5dcca827deea0b974ba955c12e55b0f1
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
3
  - 1.9.3
5
- - 2.0.0
6
- - 2.1.6
7
- - 2.2.2
4
+ - 2.2.8
5
+ - 2.3.5
6
+ - 2.4.2
8
7
  - ruby-head
data/HISTORY.md CHANGED
@@ -1,6 +1,12 @@
1
1
  Crass Change History
2
2
  ====================
3
3
 
4
+ 1.0.3 (2017-11-13)
5
+ ------------------
6
+
7
+ * Added support for frozen string literals. (#3 - @flavorjones)
8
+
9
+
4
10
  1.0.2 (2015-04-17)
5
11
  ------------------
6
12
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 Ryan Grove (ryan@wonko.com)
1
+ Copyright (c) 2017 Ryan Grove (ryan@wonko.com)
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of
4
4
  this software and associated documentation files (the ‘Software’), to deal in
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) 2014 Ryan Grove (ryan@wonko.com)
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
@@ -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]
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Crass
4
- VERSION = '1.0.2'
4
+ VERSION = '1.0.3'
5
5
  end
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.2
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: 2015-04-18 00:00:00.000000000 Z
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.4.5
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.