Module: StyleCapsule::AssetPath
- Defined in:
- lib/style_capsule/asset_path.rb,
sig/style_capsule.rbs
Overview
Validates logical asset paths for stylesheet registration (blocks injection / absurd paths).
Constant Summary collapse
- MAX_PATH_LENGTH =
1024
Class Method Summary collapse
-
.validate_logical_path!(path) ⇒ String
Stripped path.
Class Method Details
.validate_logical_path!(path) ⇒ String
Returns Stripped path.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/style_capsule/asset_path.rb', line 11 def self.validate_logical_path!(path) unless path.is_a?(String) raise ArgumentError, "stylesheet path must be a String (got #{path.class})" end s = path.strip validate_non_empty_path!(s) validate_path_segments!(s, path) s end |