Skip to content

Commit

Permalink
Don’t use Autoprefixer::Processor directly
Browse files Browse the repository at this point in the history
This might be responsible for #11.
  • Loading branch information
porada committed Aug 28, 2014
1 parent 5d1c266 commit 385db79
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions lib/middleman-autoprefixer/extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ def initialize(app, options = {})
@cascade = options[:cascade]
@inline = options[:inline]
@ignore = options[:ignore]

initialize_autoprefixer
end

# Rack interface
Expand Down Expand Up @@ -65,24 +63,12 @@ def call(env)

private

def initialize_autoprefixer
def process(content)
config = {}
config[:browsers] = Array(@browsers)
config[:cascade] = @cascade unless @cascade.nil?

@autoprefixer = ::AutoprefixerRails::Processor.new(config)
end

def process(content)
begin
@autoprefixer.process(content).css
rescue ExecJS::ProgramError => error
if error.message =~ /Can't parse CSS/
content
else
raise error
end
end
::AutoprefixerRails.process(content, config).css
end

def inline_html_content?(path)
Expand Down

0 comments on commit 385db79

Please sign in to comment.