Hello community, here is the log from the commit of package rubygem-jekyll-sass-converter for openSUSE:Factory checked in at 2020-03-07 21:38:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-jekyll-sass-converter (Old) and /work/SRC/openSUSE:Factory/.rubygem-jekyll-sass-converter.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-jekyll-sass-converter" Sat Mar 7 21:38:30 2020 rev:4 rq:773776 version:2.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-jekyll-sass-converter/rubygem-jekyll-sass-converter.changes 2018-03-06 10:45:23.032411322 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-jekyll-sass-converter.new.26092/rubygem-jekyll-sass-converter.changes 2020-03-07 21:38:35.060286159 +0100 @@ -1,0 +2,6 @@ +Mon Feb 10 14:59:15 UTC 2020 - Stephan Kulow <co...@suse.com> + +- updated to version 2.1.0 + no changelog found + +------------------------------------------------------------------- Old: ---- jekyll-sass-converter-1.5.2.gem New: ---- jekyll-sass-converter-2.1.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-jekyll-sass-converter.spec ++++++ --- /var/tmp/diff_new_pack.IIaazf/_old 2020-03-07 21:38:36.396287061 +0100 +++ /var/tmp/diff_new_pack.IIaazf/_new 2020-03-07 21:38:36.436287087 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-jekyll-sass-converter # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -24,15 +24,15 @@ # Name: rubygem-jekyll-sass-converter -Version: 1.5.2 +Version: 2.1.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: %{rubygem gem2rpm} -BuildRequires: %{ruby} BuildRequires: ruby-macros >= 5 -Url: https://github.com/jekyll/jekyll-sass-converter +URL: https://github.com/jekyll/jekyll-sass-converter Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml Summary: A basic Sass converter for Jekyll ++++++ jekyll-sass-converter-1.5.2.gem -> jekyll-sass-converter-2.1.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/sass.rb new/lib/jekyll/converters/sass.rb --- old/lib/jekyll/converters/sass.rb 2018-02-03 23:04:46.000000000 +0100 +++ new/lib/jekyll/converters/sass.rb 2020-02-05 21:39:42.000000000 +0100 @@ -1,19 +1,17 @@ # frozen_string_literal: true -require "sass" +require "sassc" require "jekyll/utils" require "jekyll/converters/scss" module Jekyll module Converters class Sass < Scss + EXTENSION_PATTERN = %r!^\.sass$!i.freeze + safe true priority :low - def matches(ext) - ext =~ %r!^\.sass$!i - end - def syntax :sass end 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 2018-02-03 23:04:46.000000000 +0100 +++ new/lib/jekyll/converters/scss.rb 2020-02-05 21:39:42.000000000 +0100 @@ -1,21 +1,75 @@ # frozen_string_literal: true -require "sass" +require "sassc" require "jekyll/utils" +require "jekyll/source_map_page" module Jekyll module Converters class Scss < Converter - BYTE_ORDER_MARK = %r!^\xEF\xBB\xBF! + BYTE_ORDER_MARK = %r!^\xEF\xBB\xBF!.freeze + EXTENSION_PATTERN = %r!^\.scss$!i.freeze + SyntaxError = Class.new(ArgumentError) safe true priority :low + # This hook is triggered just before the method {#convert(content)} is executed, it + # associates the Scss (and Sass) converters with their respective sass_page objects. + Jekyll::Hooks.register :pages, :pre_render do |page| + next unless page.is_a?(Jekyll::Page) + + page.converters.each do |converter| + converter.associate_page(page) if converter.is_a?(Jekyll::Converters::Scss) + end + end + + # This hook is triggered just after the method {#convert(content)} has been executed, it + # dissociates the Scss (and Sass) converters with their respective sass_page objects. + Jekyll::Hooks.register :pages, :post_render do |page| + next unless page.is_a?(Jekyll::Page) + + page.converters.each do |converter| + converter.dissociate_page(page) if converter.is_a?(Jekyll::Converters::Scss) + end + end + ALLOWED_STYLES = %w(nested expanded compact compressed).freeze + # Associate this Converter with the "page" object that manages input and output files for + # this converter. + # + # Note: changing the associated sass_page during the live time of this Converter instance + # may result in inconsistent results. + # + # @param [Jekyll:Page] page The sass_page for which this object acts as converter. + def associate_page(page) + if @sass_page + Jekyll.logger.debug "Sass Converter:", + "sass_page re-assigned: #{@sass_page.name} to #{page.name}" + dissociate_page(page) + return + end + @sass_page = page + end + + # Dissociate this Converter with the "page" object. + # + # @param [Jekyll:Page] page The sass_page for which this object has acted as a converter. + def dissociate_page(page) + unless page.equal?(@sass_page) + Jekyll.logger.debug "Sass Converter:", + "dissociating a page that was never associated #{page.name}" + end + + @source_map_page = nil + @sass_page = nil + @site = nil + end + def matches(ext) - ext =~ %r!^\.scss$!i + ext =~ self.class::EXTENSION_PATTERN end def output_ext(_ext) @@ -27,21 +81,18 @@ end def jekyll_sass_configuration - options = @config["sass"] || {} - unless options["style"].nil? - options["style"] = options["style"].to_s.gsub(%r!\A:!, "").to_sym + @jekyll_sass_configuration ||= begin + options = @config["sass"] || {} + unless options["style"].nil? + options["style"] = options["style"].to_s.gsub(%r!\A:!, "").to_sym + end + options end - options end def sass_build_configuration_options(overrides) if safe? - { - :load_paths => sass_load_paths, - :syntax => syntax, - :style => sass_style, - :cache => false, - } + overrides else Jekyll::Utils.symbolize_hash_keys( Jekyll::Utils.deep_merge_hashes( @@ -58,6 +109,7 @@ def sass_dir return "_sass" if jekyll_sass_configuration["sass_dir"].to_s.empty? + jekyll_sass_configuration["sass_dir"] end @@ -71,9 +123,12 @@ end def sass_dir_relative_to_site_source - Jekyll.sanitized_path(site_source, sass_dir) + @sass_dir_relative_to_site_source ||= begin + Jekyll.sanitized_path(site_source, sass_dir).sub(site.source + "/", "") + end end + # rubocop:disable Metrics/AbcSize def sass_load_paths paths = user_sass_load_paths + [sass_dir_relative_to_site_source] @@ -84,7 +139,7 @@ # Expand file globs (e.g. `node_modules/*/node_modules` ) Dir.chdir(site_source) do - paths = paths.map { |path| Dir.glob(path) }.flatten.uniq + paths = paths.flat_map { |path| Dir.glob(path) } paths.map! do |path| if safe? @@ -96,8 +151,11 @@ end end + paths.uniq! + paths << site.theme.sass_path if site.theme&.sass_path paths.select { |path| File.directory?(path) } end + # rubocop:enable Metrics/AbcSize def allow_caching? !safe? @@ -108,24 +166,125 @@ end def sass_configs - sass_build_configuration_options({ - "syntax" => syntax, - "cache" => allow_caching?, - "load_paths" => sass_load_paths, - }) + sass_build_configuration_options( + :style => sass_style, + :syntax => syntax, + :filename => filename, + :output_path => output_path, + :source_map_file => source_map_file, + :load_paths => sass_load_paths, + :omit_source_map_url => !sourcemap_required?, + :source_map_contents => true, + :line_comments_option => line_comments_option + ) end def convert(content) - output = ::Sass.compile(content, sass_configs) + config = sass_configs + engine = SassC::Engine.new(content.dup, config) + output = engine.render + generate_source_map(engine) if sourcemap_required? replacement = add_charset? ? '@charset "UTF-8";' : "" output.sub(BYTE_ORDER_MARK, replacement) - rescue ::Sass::SyntaxError => e - raise SyntaxError, "#{e} on line #{e.sass_line}" + rescue SassC::SyntaxError => e + raise SyntaxError, e.to_s end private + + # The Page instance for which this object acts as a converter. + attr_reader :sass_page + + def associate_page_failed? + !sass_page + end + + # The name of the input scss (or sass) file. This information will be used for error + # reporting and will written into the source map file as main source. + # + # Returns the name of the input file or "stdin" if #associate_page failed + def filename + return "stdin" if associate_page_failed? + + sass_page.name + end + + # The value of the `line_comments` option. + # When set to `true` causes the line number and filename of the source be emitted into the + # compiled CSS-file. Useful for debugging when the source-map is not available. + # + # Returns the value of the `line_comments`-option chosen by the user or 'false' by default. + def line_comments_option + jekyll_sass_configuration.fetch("line_comments", false) + end + + # The value of the `sourcemap` option chosen by the user. + # + # This option controls when sourcemaps shall be generated or not. + # + # Returns the value of the `sourcemap`-option chosen by the user or ':always' by default. + def sourcemap_option + jekyll_sass_configuration.fetch("sourcemap", :always).to_sym + end + + # Determines whether a sourcemap shall be generated or not. + # + # Returns `true` if a sourcemap shall be generated, `false` otherwise. + def sourcemap_required? + return false if associate_page_failed? || sourcemap_option == :never + return true if sourcemap_option == :always + + !(sourcemap_option == :development && Jekyll.env != "development") + end + + # The name of the generated css file. This information will be written into the source map + # file as a backward reference to the input. + # + # Returns the name of the css file or "stdin.css" if #associate_page failed + def output_path + return "stdin.css" if associate_page_failed? + + sass_page.basename + ".css" + end + + # The name of the generated source map file. This information will be written into the + # css file to reference to the source map. + # + # Returns the name of the css file or "" if #associate_page failed + def source_map_file + return "" if associate_page_failed? + + sass_page.basename + ".css.map" + end + + def source_map_page + return if associate_page_failed? + + @source_map_page ||= SourceMapPage.new(sass_page) + end + + # 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) + return if associate_page_failed? + + source_map_page.source_map(engine.source_map) + site.pages << source_map_page + rescue ::SassC::NotRenderedError => e + 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 + end + end + def site_source - @site_source ||= File.expand_path(@config["source"]).freeze + site.source 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 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/jekyll/source_map_page.rb 2020-02-05 21:39:42.000000000 +0100 @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Jekyll + # A Jekyll::Page subclass to manage the source map file associated with + # a given scss / sass page. + class SourceMapPage < Page + # Initialize a new SourceMapPage. + # + # @param [Jekyll::Page] css_page The Page object that manages the css file. + def initialize(css_page) + @site = css_page.site + @dir = css_page.dir + @data = css_page.data + @name = css_page.basename + ".css.map" + + process(@name) + Jekyll::Hooks.trigger :pages, :post_init, self + end + + def source_map(map) + self.content = map + end + + def ext + ".map" + end + + def asset_file? + true + end + + # @return[String] the object as a debug String. + def inspect + "#<#{self.class} @name=#{name.inspect}>" + end + end +end 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 2018-02-03 23:04:46.000000000 +0100 +++ new/lib/jekyll-sass-converter/version.rb 2020-02-05 21:39:42.000000000 +0100 @@ -1,5 +1,5 @@ # frozen_string_literal: true module JekyllSassConverter - VERSION = "1.5.2".freeze + VERSION = "2.1.0" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2018-02-03 23:04:46.000000000 +0100 +++ new/metadata 2020-02-05 21:39:42.000000000 +0100 @@ -1,57 +1,49 @@ --- !ruby/object:Gem::Specification name: jekyll-sass-converter version: !ruby/object:Gem::Version - version: 1.5.2 + version: 2.1.0 platform: ruby authors: - Parker Moore autorequire: bindir: bin cert_chain: [] -date: 2018-02-03 00:00:00.000000000 Z +date: 2020-02-05 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency - name: sass + name: sassc requirement: !ruby/object:Gem::Requirement requirements: - - - "~>" + - - ">" + - !ruby/object:Gem::Version + version: 2.0.1 + - - "<" - !ruby/object:Gem::Version - version: '3.4' + version: '3.0' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - - "~>" - - !ruby/object:Gem::Version - version: '3.4' -- !ruby/object:Gem::Dependency - name: bundler - requirement: !ruby/object:Gem::Requirement - requirements: - - - "~>" + - - ">" - !ruby/object:Gem::Version - version: '1.5' - type: :development - prerelease: false - version_requirements: !ruby/object:Gem::Requirement - requirements: - - - "~>" + version: 2.0.1 + - - "<" - !ruby/object:Gem::Version - version: '1.5' + version: '3.0' - !ruby/object:Gem::Dependency - name: jekyll + name: bundler requirement: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version - version: '2.0' + version: '0' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version - version: '2.0' + version: '0' - !ruby/object:Gem::Dependency name: rake requirement: !ruby/object:Gem::Requirement @@ -81,19 +73,19 @@ - !ruby/object:Gem::Version version: '0' - !ruby/object:Gem::Dependency - name: rubocop + name: rubocop-jekyll requirement: !ruby/object:Gem::Requirement requirements: - - - '=' + - - "~>" - !ruby/object:Gem::Version - version: '0.51' + version: '0.4' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - - '=' + - - "~>" - !ruby/object:Gem::Version - version: '0.51' + version: '0.4' description: email: - parkrmo...@gmail.com @@ -105,6 +97,7 @@ - lib/jekyll-sass-converter/version.rb - lib/jekyll/converters/sass.rb - lib/jekyll/converters/scss.rb +- lib/jekyll/source_map_page.rb homepage: https://github.com/jekyll/jekyll-sass-converter licenses: - MIT @@ -117,15 +110,14 @@ requirements: - - ">=" - !ruby/object:Gem::Version - version: '0' + version: 2.4.0 required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' requirements: [] -rubyforge_project: -rubygems_version: 2.7.4 +rubygems_version: 3.0.6 signing_key: specification_version: 4 summary: A basic Sass converter for Jekyll.