14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/css/parser.rb', line 14
def parse(file_file_name_or_style_string)
css_style = file_file_name_or_style_string
reset
lineno = 1
if css_style.respond_to?(:size) && css_style.size < 255 && File.exists?(css_style)
File.open(css_style) do |file|
file.each_line do |line|
parse_line(line, lineno)
lineno += 1
end
end
elsif css_style.respond_to?(:each_line)
css_style.each_line do |line|
parse_line(line, lineno)
lineno += 1
end
end
@ruleset
end
|