css_parser 1.3.1 → 1.3.2

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.
@@ -7,10 +7,14 @@ require 'zlib'
7
7
  require 'stringio'
8
8
  require 'iconv' unless String.method_defined?(:encode)
9
9
 
10
+ require 'css_parser/rule_set'
11
+ require 'css_parser/regexps'
12
+ require 'css_parser/parser'
13
+
10
14
  module CssParser
11
- VERSION = '1.2.6'
15
+ autoload :VERSION, "css_parser/version"
12
16
 
13
- # Merge multiple CSS RuleSets by cascading according to the CSS 2.1 cascading rules
17
+ # Merge multiple CSS RuleSets by cascading according to the CSS 2.1 cascading rules
14
18
  # (http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order).
15
19
  #
16
20
  # Takes one or more RuleSet objects.
@@ -48,7 +52,7 @@ module CssParser
48
52
  #--
49
53
  # TODO: declaration_hashes should be able to contain a RuleSet
50
54
  # this should be a Class method
51
- def CssParser.merge(*rule_sets)
55
+ def self.merge(*rule_sets)
52
56
  @folded_declaration_cache = {}
53
57
 
54
58
  # in case called like CssParser.merge([rule_set, rule_set])
@@ -116,7 +120,7 @@ module CssParser
116
120
  #--
117
121
  # Thanks to Rafael Salazar and Nick Fitzsimons on the css-discuss list for their help.
118
122
  #++
119
- def CssParser.calculate_specificity(selector)
123
+ def self.calculate_specificity(selector)
120
124
  a = 0
121
125
  b = selector.scan(/\#/).length
122
126
  c = selector.scan(NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX).length
@@ -162,7 +166,3 @@ module CssParser
162
166
  mq.to_sym
163
167
  end
164
168
  end
165
-
166
- require File.dirname(__FILE__) + '/css_parser/rule_set'
167
- require File.dirname(__FILE__) + '/css_parser/regexps'
168
- require File.dirname(__FILE__) + '/css_parser/parser'
@@ -5,7 +5,6 @@ module CssParser
5
5
  # Exception class used if a request is made to load a CSS file more than once.
6
6
  class CircularReferenceError < StandardError; end
7
7
 
8
-
9
8
  # == Parser class
10
9
  #
11
10
  # All CSS is converted to UTF-8.
@@ -1,6 +1,4 @@
1
1
  module CssParser
2
-
3
-
4
2
  def self.regex_possible_values *values
5
3
  Regexp.new("([\s]*^)?(#{values.join('|')})([\s]*$)?", 'i')
6
4
  end
@@ -0,0 +1,3 @@
1
+ module CssParser
2
+ VERSION = "1.3.2"
3
+ end
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.3.1
4
+ version: 1.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,6 +36,7 @@ files:
36
36
  - lib/css_parser/parser.rb
37
37
  - lib/css_parser/regexps.rb
38
38
  - lib/css_parser/rule_set.rb
39
+ - lib/css_parser/version.rb
39
40
  - lib/css_parser.rb
40
41
  homepage: https://github.com/alexdunae/css_parser
41
42
  licenses:
@@ -52,7 +53,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
53
  version: '0'
53
54
  segments:
54
55
  - 0
55
- hash: -3236645012416092950
56
+ hash: -1308369005751003070
56
57
  required_rubygems_version: !ruby/object:Gem::Requirement
57
58
  none: false
58
59
  requirements:
@@ -61,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
62
  version: '0'
62
63
  segments:
63
64
  - 0
64
- hash: -3236645012416092950
65
+ hash: -1308369005751003070
65
66
  requirements: []
66
67
  rubyforge_project:
67
68
  rubygems_version: 1.8.25