Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2: I have a working version with crass, Css parsing imporved #156

Merged
merged 7 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ gem 'rake'
gem 'rubocop'
gem 'rubocop-rake'
gem 'webrick'

gem 'debug', '~> 1.9', platforms: [:mri, :mingw, :x64_mingw]
24 changes: 23 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ PATH
specs:
css_parser (1.18.0)
addressable
crass (~> 1.0)

GEM
remote: https://rubygems.org/
Expand All @@ -12,6 +13,16 @@ GEM
ast (2.4.2)
benchmark-ips (2.13.0)
bump (0.10.0)
crass (1.0.6)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
io-console (0.7.2)
io-console (0.7.2-java)
irb (1.13.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jar-dependencies (0.4.1)
json (2.7.2)
json (2.7.2-java)
language_server-protocol (3.17.0.3)
Expand All @@ -23,12 +34,20 @@ GEM
parser (3.3.0.5)
ast (~> 2.4.1)
racc
psych (5.1.2)
stringio
psych (5.1.2-java)
jar-dependencies (>= 0.1.7)
public_suffix (5.0.5)
racc (1.7.3)
racc (1.7.3-java)
rainbow (3.1.1)
rake (13.2.1)
rdoc (6.6.3.1)
psych (>= 4.0.0)
regexp_parser (2.9.0)
reline (0.5.7)
io-console (~> 0.5)
rexml (3.2.6)
rubocop (1.62.1)
json (~> 2.3)
Expand All @@ -46,17 +65,20 @@ GEM
rubocop-rake (0.6.0)
rubocop (~> 1.0)
ruby-progressbar (1.13.0)
stringio (3.1.0)
unicode-display_width (2.5.0)
webrick (1.8.1)

PLATFORMS
arm64-darwin-22
java
ruby
x86_64-linux

DEPENDENCIES
benchmark-ips
bump
css_parser!
debug (~> 1.9)
maxitest
memory_profiler
rake
Expand Down
3 changes: 2 additions & 1 deletion css_parser.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ Gem::Specification.new name, CssParser::VERSION do |s|
s.metadata['bug_tracker_uri'] = 'https://github.com/premailer/css_parser/issues'
s.metadata['rubygems_mfa_required'] = 'true'

s.add_runtime_dependency 'addressable'
s.add_dependency 'addressable'
s.add_dependency 'crass', '~> 1.0'
end
5 changes: 5 additions & 0 deletions lib/css_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
require 'zlib'
require 'stringio'
require 'iconv' unless String.method_defined?(:encode)
require 'crass'

require 'css_parser/version'
require 'css_parser/rule_set'
require 'css_parser/rule_set/declarations'
require 'css_parser/regexps'
require 'css_parser/parser'

module CssParser
class Error < StandardError; end
class EmptyValueError < Error; end

# Merge multiple CSS RuleSets by cascading according to the CSS 2.1 cascading rules
# (http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order).
#
Expand Down
Loading