Class: PrelandsRails::CreateSimpleSource::ValidateZipContent::ValidateCss::Css
- Inherits:
-
Object
- Object
- PrelandsRails::CreateSimpleSource::ValidateZipContent::ValidateCss::Css
- Defined in:
- lib/prelands_rails/create_simple_source/validate_zip_content/validate_css/css.rb
Overview
Принимает строку с css и валидирует её. Правила, обязательные для всех css файлов.
Constant Summary collapse
- CUSTOM_FONTS =
/\.(eot|woff|woff2|ttf)/.freeze
- SVG_LINKS_DETECTED =
/\.svg/.freeze
- IMAGES_BAD_PATH =
/\/images/.freeze
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(string) ⇒ Css
constructor
A new instance of Css.
- #valid? ⇒ Boolean
Constructor Details
#initialize(string) ⇒ Css
Returns a new instance of Css.
19 20 21 22 |
# File 'lib/prelands_rails/create_simple_source/validate_zip_content/validate_css/css.rb', line 19 def initialize(string) @errors = [] @string = string end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
12 13 14 |
# File 'lib/prelands_rails/create_simple_source/validate_zip_content/validate_css/css.rb', line 12 def errors @errors end |
Instance Method Details
#valid? ⇒ Boolean
24 25 26 27 28 29 30 31 32 |
# File 'lib/prelands_rails/create_simple_source/validate_zip_content/validate_css/css.rb', line 24 def valid? @errors = [ check_svg_links, check_images_relative_paths, check_custom_fonts_absence ].compact @errors.none? end |