css_parser 1.22.0 → 2.0.0

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
  SHA256:
3
- metadata.gz: b67e47f563af5ce2fe5e26371810a6b546032c691289071c092ffc8c52ee2aa7
4
- data.tar.gz: 40bc138ff5e63f022fddba80b08c847542508c1d925658917df756d8bd2135de
3
+ metadata.gz: 85c1ed60af098bd844114375df9517e7859db55440a1b4f7d91362c91f80a916
4
+ data.tar.gz: df39d79d248b8153e5cd0ebc1754a31e8d366a1b7c23a8fb6c316d84bd774df1
5
5
  SHA512:
6
- metadata.gz: 50447464b22d0af5c72c097bb3e37e05e6d0ace513e9d9cd6751b057f505c76130aecb98ce4f02b101b9424c6379c809c6fd94a5dda39a35d825e6e4961f3d13
7
- data.tar.gz: d92c7583e8063a4ceebdd18ba7ab24f7ebb151c1ea0a4bd745767c5f2fe51dc0ee9981bdbbc997c53fb8a0ddde7ca335a3fb4b27de81d993b317fe347523cb27
6
+ metadata.gz: ce543588bb1b082bd0cc671dd29705f67f7b56c5ea05d53f24c7e48f13746f648a2d36adcd625837757a7562e466e569060132d81d8d9befae47f201fd7bffd8
7
+ data.tar.gz: 78c1fdc5fd1ec624cfbc209860dfccd7677fb5c564daf9fb7d6a23ed6360215d36495adfbf1bfa23fee023f07fe4e4e27127e501ce3e8b2d6779ee1ed7acec6e
@@ -31,12 +31,6 @@ module CssParser
31
31
  # Array of CSS files that have been loaded.
32
32
  attr_reader :loaded_uris
33
33
 
34
- #--
35
- # Class variable? see http://www.oreillynet.com/ruby/blog/2007/01/nubygems_dont_use_class_variab_1.html
36
- #++
37
- @folded_declaration_cache = {}
38
- class << self; attr_reader :folded_declaration_cache; end
39
-
40
34
  def initialize(options = {})
41
35
  @options = {
42
36
  absolute_paths: false,
@@ -143,7 +137,7 @@ module CssParser
143
137
  media_types = [:all]
144
138
  end
145
139
 
146
- next unless options[:only_media_types].include?(:all) or media_types.empty? or !(media_types & options[:only_media_types]).empty?
140
+ next unless options[:only_media_types].include?(:all) or media_types.empty? or media_types.intersect?(options[:only_media_types])
147
141
 
148
142
  import_path = import_rule[0].to_s.gsub(/['"]*/, '').strip
149
143
 
@@ -568,7 +562,8 @@ module CssParser
568
562
  #
569
563
  # Raises a CircularReferenceError exception if io_exceptions are on,
570
564
  # otherwise returns true/false.
571
- def circular_reference_check(path)
565
+ # TODO: fix rubocop
566
+ def circular_reference_check(path) # rubocop:disable Naming/PredicateMethod
572
567
  path = path.to_s
573
568
  if @loaded_uris.include?(path)
574
569
  raise CircularReferenceError, "can't load #{path} more than once" if @options[:io_exceptions]
@@ -648,6 +643,7 @@ module CssParser
648
643
  uri.port = 443 unless uri.port
649
644
  http = Net::HTTP.new(uri.host, uri.port)
650
645
  http.use_ssl = true
646
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
651
647
  else
652
648
  http = Net::HTTP.new(uri.host, uri.port)
653
649
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CssParser
4
- VERSION = '1.22.0'.freeze
4
+ VERSION = '2.0.0'.freeze
5
5
  end
data/lib/css_parser.rb CHANGED
@@ -52,8 +52,6 @@ module CssParser
52
52
  # TODO: declaration_hashes should be able to contain a RuleSet
53
53
  # this should be a Class method
54
54
  def self.merge(*rule_sets)
55
- @folded_declaration_cache = {}
56
-
57
55
  # in case called like CssParser.merge([rule_set, rule_set])
58
56
  rule_sets.flatten! if rule_sets[0].is_a?(Array)
59
57
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.22.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Dunae
@@ -50,7 +50,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '3.0'
53
+ version: '3.3'
54
54
  required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  requirements:
56
56
  - - ">="