Class: Gotenberg::Analyzers::Css
- Inherits:
-
Base
- Object
- Base
- Gotenberg::Analyzers::Css
show all
- Defined in:
- lib/gotenberg/analyzers/css.rb
Constant Summary
collapse
- ASSETS_REGEX =
/url\((?!['"]?(?:data|https?):)['"]?([^'"\)]*)['"]?\)/
Constants inherited
from Base
Base::URI_REGEXP
Instance Attribute Summary
Attributes inherited from Base
#resource
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#assets ⇒ Object
23
24
25
|
# File 'lib/gotenberg/analyzers/css.rb', line 23
def assets
@assets ||= [[binary, filename]]
end
|
#call ⇒ Object
9
10
11
12
13
|
# File 'lib/gotenberg/analyzers/css.rb', line 9
def call
analyze_binary unless resource[:skip_analyze]
self
end
|
#tag ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/gotenberg/analyzers/css.rb', line 15
def tag
if resource[:inline]
'<style type="text/css">%s</style>' % binary
else
'<link rel="stylesheet" href="%s" />' % filename
end
end
|