Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rubygem-jekyll-sass-converter for 
openSUSE:Factory checked in at 2022-03-04 20:16:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-jekyll-sass-converter (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-jekyll-sass-converter.new.1958 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-jekyll-sass-converter"

Fri Mar  4 20:16:58 2022 rev:5 rq:959330 version:2.2.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-jekyll-sass-converter/rubygem-jekyll-sass-converter.changes
      2020-03-07 21:38:35.060286159 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-jekyll-sass-converter.new.1958/rubygem-jekyll-sass-converter.changes
    2022-03-04 20:20:48.456685642 +0100
@@ -1,0 +2,6 @@
+Thu Mar  3 08:21:51 UTC 2022 - Stephan Kulow <[email protected]>
+
+updated to version 2.2.0
+  no changelog found
+
+-------------------------------------------------------------------

Old:
----
  jekyll-sass-converter-2.1.0.gem

New:
----
  jekyll-sass-converter-2.2.0.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-jekyll-sass-converter.spec ++++++
--- /var/tmp/diff_new_pack.3TKm8a/_old  2022-03-04 20:20:48.940685258 +0100
+++ /var/tmp/diff_new_pack.3TKm8a/_new  2022-03-04 20:20:48.944685255 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-jekyll-sass-converter
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,12 +24,12 @@
 #
 
 Name:           rubygem-jekyll-sass-converter
-Version:        2.1.0
+Version:        2.2.0
 Release:        0
 %define mod_name jekyll-sass-converter
 %define mod_full_name %{mod_name}-%{version}
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-BuildRequires:  %{ruby >= 2.4.0}
+BuildRequires:  %{ruby >= 2.5.0}
 BuildRequires:  %{rubygem gem2rpm}
 BuildRequires:  ruby-macros >= 5
 URL:            https://github.com/jekyll/jekyll-sass-converter

++++++ jekyll-sass-converter-2.1.0.gem -> jekyll-sass-converter-2.2.0.gem ++++++
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/jekyll/converters/scss.rb 
new/lib/jekyll/converters/scss.rb
--- old/lib/jekyll/converters/scss.rb   2020-02-05 21:39:42.000000000 +0100
+++ new/lib/jekyll/converters/scss.rb   2022-02-28 12:30:56.000000000 +0100
@@ -35,6 +35,7 @@
         end
       end
 
+      ALLOWED_IMPLEMENTATIONS = %w(sassc sass-embedded).freeze
       ALLOWED_STYLES = %w(nested expanded compact compressed).freeze
 
       # Associate this Converter with the "page" object that manages input and 
output files for
@@ -91,16 +92,11 @@
       end
 
       def sass_build_configuration_options(overrides)
-        if safe?
-          overrides
-        else
-          Jekyll::Utils.symbolize_hash_keys(
-            Jekyll::Utils.deep_merge_hashes(
-              jekyll_sass_configuration,
-              overrides
-            )
-          )
-        end
+        return overrides if safe?
+
+        Jekyll::Utils.symbolize_hash_keys(
+          Jekyll::Utils.deep_merge_hashes(jekyll_sass_configuration, overrides)
+        )
       end
 
       def syntax
@@ -113,9 +109,17 @@
         jekyll_sass_configuration["sass_dir"]
       end
 
+      def sass_implementation
+        implementation = jekyll_sass_configuration["implementation"]
+        ALLOWED_IMPLEMENTATIONS.include?(implementation) ? implementation : 
"sassc"
+      end
+
       def sass_style
-        style = jekyll_sass_configuration.fetch("style", :compact)
-        ALLOWED_STYLES.include?(style.to_s) ? style.to_sym : :compact
+        # `:expanded` is the default output style for newer sass 
implementations.
+        # For backward compatibility, `:compact` is kept as the default output 
style for sassc.
+        default = sass_implementation == "sassc" ? :compact : :expanded
+        style = jekyll_sass_configuration.fetch("style", default)
+        ALLOWED_STYLES.include?(style.to_s) ? style.to_sym : default
       end
 
       def user_sass_load_paths
@@ -132,22 +136,16 @@
       def sass_load_paths
         paths = user_sass_load_paths + [sass_dir_relative_to_site_source]
 
-        if safe?
-          # Sanitize paths to prevent any attack vectors (.e.g. `/**/*`)
-          paths.map! { |path| Jekyll.sanitized_path(site_source, path) }
-        end
+        # Sanitize paths to prevent any attack vectors (.e.g. `/**/*`)
+        paths.map! { |path| Jekyll.sanitized_path(site_source, path) } if safe?
 
         # Expand file globs (e.g. `node_modules/*/node_modules` )
         Dir.chdir(site_source) do
           paths = paths.flat_map { |path| Dir.glob(path) }
 
           paths.map! do |path|
-            if safe?
-              # Sanitize again in case globbing was able to do something crazy.
-              Jekyll.sanitized_path(site_source, path)
-            else
-              File.expand_path(path)
-            end
+            # Sanitize again in case globbing was able to do something crazy.
+            safe? ? Jekyll.sanitized_path(site_source, path) : 
File.expand_path(path)
           end
         end
 
@@ -180,17 +178,50 @@
       end
 
       def convert(content)
+        case sass_implementation
+        when "sass-embedded"
+          Jekyll::External.require_with_graceful_fail("sass-embedded")
+          sass_embedded_convert(content)
+        when "sassc"
+          sass_convert(content)
+        end
+      end
+
+      private
+
+      def sass_convert(content)
         config = sass_configs
         engine = SassC::Engine.new(content.dup, config)
         output = engine.render
-        generate_source_map(engine) if sourcemap_required?
+        sass_generate_source_map(engine) if sourcemap_required?
         replacement = add_charset? ? '@charset "UTF-8";' : ""
         output.sub(BYTE_ORDER_MARK, replacement)
       rescue SassC::SyntaxError => e
         raise SyntaxError, e.to_s
       end
 
-      private
+      def sass_embedded_config
+        {
+          :load_paths                 => sass_load_paths,
+          :source_map                 => sourcemap_required?,
+          :source_map_include_sources => true,
+          :style                      => sass_style,
+          :syntax                     => syntax == :sass ? :indented : syntax,
+          :url                        => sass_file_url,
+        }
+      end
+
+      def sass_embedded_convert(content)
+        output = ::Sass.compile_string(content, **sass_embedded_config)
+        sass_embedded_generate_source_map(output.source_map) if 
sourcemap_required?
+        replacement = add_charset? ? '@charset "UTF-8";' : ""
+        source_mapping_url = 
Addressable::URI.encode(File.basename(source_map_file))
+        eof = sourcemap_required? ? "\n\n/*# 
sourceMappingURL=#{source_mapping_url} */" : "\n"
+        output.css.sub(BYTE_ORDER_MARK, replacement) + eof
+      rescue ::Sass::CompileError => e
+        Jekyll.logger.error e.full_message
+        raise SyntaxError, e.message
+      end
 
       # The Page instance for which this object acts as a converter.
       attr_reader :sass_page
@@ -206,7 +237,14 @@
       def filename
         return "stdin" if associate_page_failed?
 
-        sass_page.name
+        File.join(site_source_relative_from_pwd, sass_page.name)
+      end
+
+      # The URL of the input scss (or sass) file. This information will be 
used for error reporting.
+      def sass_file_url
+        return if associate_page_failed?
+
+        file_url_from_path(File.join(site_source, sass_page.relative_path))
       end
 
       # The value of the `line_comments` option.
@@ -244,7 +282,7 @@
       def output_path
         return "stdin.css" if associate_page_failed?
 
-        sass_page.basename + ".css"
+        File.join(site_source_relative_from_pwd, sass_page.basename + ".css")
       end
 
       # The name of the generated source map file. This information will be 
written into the
@@ -254,7 +292,7 @@
       def source_map_file
         return "" if associate_page_failed?
 
-        sass_page.basename + ".css.map"
+        File.join(site_source_relative_from_pwd, sass_page.basename + 
".css.map")
       end
 
       def source_map_page
@@ -266,7 +304,7 @@
       # Reads the source-map from the engine and adds it to the 
source-map-page.
       #
       # @param [::SassC::Engine] engine The sass Compiler engine.
-      def generate_source_map(engine)
+      def sass_generate_source_map(engine)
         return if associate_page_failed?
 
         source_map_page.source_map(engine.source_map)
@@ -275,17 +313,40 @@
         Jekyll.logger.warn "Could not generate source map #{e.message} => 
#{e.cause}"
       end
 
-      def site
-        if associate_page_failed?
-          Jekyll.sites.last
-        else
-          sass_page.site
+      # Reads the source-map and adds it to the source-map-page.
+      def sass_embedded_generate_source_map(source_map)
+        return if associate_page_failed?
+
+        map_data = JSON.parse(source_map)
+        map_data["file"] = Addressable::URI.encode(File.basename(output_path))
+        map_data["sources"].map! do |s|
+          s.start_with?("file:") ? 
Addressable::URI.parse(s).route_from(site_source_url) : s
         end
+
+        source_map_page.source_map(JSON.generate(map_data))
+        site.pages << source_map_page
+      end
+
+      def site
+        associate_page_failed? ? Jekyll.sites.last : sass_page.site
       end
 
       def site_source
         site.source
       end
+
+      def site_source_relative_from_pwd
+        @site_source_relative_from_pwd ||=
+          
Pathname.new(site_source).relative_path_from(Pathname.new(Dir.pwd)).to_s
+      end
+
+      def site_source_url
+        @site_source_url ||= file_url_from_path("#{site_source}/")
+      end
+
+      def file_url_from_path(path)
+        Addressable::URI.encode("file://#{path.start_with?("/") ? "" : 
"/"}#{path}")
+      end
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/jekyll/source_map_page.rb 
new/lib/jekyll/source_map_page.rb
--- old/lib/jekyll/source_map_page.rb   2020-02-05 21:39:42.000000000 +0100
+++ new/lib/jekyll/source_map_page.rb   2022-02-28 12:30:56.000000000 +0100
@@ -29,6 +29,10 @@
       true
     end
 
+    def render_with_liquid?
+      false
+    end
+
     # @return[String] the object as a debug String.
     def inspect
       "#<#{self.class} @name=#{name.inspect}>"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/jekyll-sass-converter/version.rb 
new/lib/jekyll-sass-converter/version.rb
--- old/lib/jekyll-sass-converter/version.rb    2020-02-05 21:39:42.000000000 
+0100
+++ new/lib/jekyll-sass-converter/version.rb    2022-02-28 12:30:56.000000000 
+0100
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module JekyllSassConverter
-  VERSION = "2.1.0"
+  VERSION = "2.2.0"
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2020-02-05 21:39:42.000000000 +0100
+++ new/metadata        2022-02-28 12:30:56.000000000 +0100
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: jekyll-sass-converter
 version: !ruby/object:Gem::Version
-  version: 2.1.0
+  version: 2.2.0
 platform: ruby
 authors:
 - Parker Moore
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2020-02-05 00:00:00.000000000 Z
+date: 2022-02-28 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: sassc
@@ -78,14 +78,14 @@
     requirements:
     - - "~>"
       - !ruby/object:Gem::Version
-        version: '0.4'
+        version: 0.12.0
   type: :development
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - "~>"
       - !ruby/object:Gem::Version
-        version: '0.4'
+        version: 0.12.0
 description: 
 email:
 - [email protected]
@@ -110,14 +110,14 @@
   requirements:
   - - ">="
     - !ruby/object:Gem::Version
-      version: 2.4.0
+      version: 2.5.0
 required_rubygems_version: !ruby/object:Gem::Requirement
   requirements:
   - - ">="
     - !ruby/object:Gem::Version
       version: '0'
 requirements: []
-rubygems_version: 3.0.6
+rubygems_version: 3.1.6
 signing_key: 
 specification_version: 4
 summary: A basic Sass converter for Jekyll.

Reply via email to