Sha256: ccb83acbf12aa7ace3581839529541ca1870002f7a6600e5f8bd5f5c1fb87ab4

Contents?: true

Size: 279 Bytes

Versions: 20

Compression:

Stored size: 279 Bytes

Contents

module InlineSvg::TransformPipeline::Transformations
  class PreserveAspectRatio < Transformation
    def transform(doc)
      doc = Nokogiri::XML::Document.parse(doc.to_html)
      svg = doc.at_css 'svg'
      svg['preserveAspectRatio'] = self.value
      doc
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
inline_svg-1.2.1 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-1.2.0 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-1.1.0 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-1.0.1 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-1.0.0 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.12.1 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.12.0 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.11.1 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.11.0 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.10.0 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.9.1 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.9.0 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.8.0 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.7.0 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.6.4 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.6.3 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.6.2 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.6.1 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.6.0 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
inline_svg-0.5.3 lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb