7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/tailwindcss/compiler/file_parser.rb', line 7
def call(file_path:)
file_content = File.read(file_path)
code = if file_is_ruby?(file_path:)
(file_content:)
elsif file_is_erb?(file_path:)
(erb: file_content)
else
return
end
buffer = Parser::Source::Buffer.new(file_path)
buffer.source = code
parser = Parser::CurrentRuby.new
parser.parse(buffer)
rescue Parser::SyntaxError
Rails.logger.error("Tailwindcss: Failed to parse #{file_path}. Skipping...")
end
|