Skip to content

Commit c1dd66c

Browse files
committed
Updates libsass and sass-spec to 3.4.0
- Adjusts spec runner for nested options - Adds source-map-file-urls option to cli - Changes cli options to be case sensitive
1 parent dcac122 commit c1dd66c

21 files changed

+185
-74
lines changed

Changes

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
CSS::Sass (3.4.0)
2+
3+
* Update to latest LibSass release (3.4.0)
4+
* Add source-map-file-urls option to cli
5+
* Change cli options to be case sensitive
6+
* Fix issue connected to EUMM bugfix
7+
* Update spec runner for nested options
8+
* Enable error spec tests again
9+
10+
-- Marcel Greter <[email protected]> Sat, 10 Dec 2016 17:23:09 +0200
11+
112
CSS::Sass (3.3.6)
213

314
* Fix issue with ExtUtils::MakeMaker 7.12+

LICENSE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013 David Caldwell
4-
Copyright (c) 2014 Marcel Greter
3+
Copyright (c) 2013-2014 David Caldwell
4+
Copyright (c) 2014-2017 Marcel Greter
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

META.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@
6868
"url" : "https://github.com/sass/perl-libsass"
6969
}
7070
},
71-
"version" : "v3.3.6"
71+
"version" : "v3.4.0"
7272
}

META.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ resources:
3939
homepage: https://metacpan.org/release/CSS-Sass
4040
license: http://opensource.org/licenses/MIT
4141
repository: https://github.com/sass/perl-libsass
42-
version: v3.3.6
42+
version: v3.4.0

Makefile.PL

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) 2013 David Caldwell.
2-
# Copyright (c) 2014 Marcel Greter.
1+
# Copyright (c) 2013-2014 David Caldwell.
2+
# Copyright (c) 2014-2017 Marcel Greter.
33
#
44
# Permission is hereby granted, free of charge, to any person obtaining a copy
55
# of this software and associated documentation files (the "Software"), to deal
@@ -53,10 +53,10 @@ sub help
5353
{
5454
print "CSS::Sass Makefile.PL options (developers only):\n\n";
5555
print " --debug Build libsass in debug mode\n";
56-
print " --compiler Skips compiler autodetection\n";
5756
print " --profiling Enable gcov profiling switches\n";
58-
print " --skip-manifest Skips manifest generation (needs git repo)\n";
59-
print " --skip-version Skips generating libsass/VERSION (needs git repo)\n";
57+
print " --compiler Skips compiler autodetection (passed to CppGuess)\n";
58+
print " --skip-manifest Skips manifest generation (would need git repo)\n";
59+
print " --skip-version Skips generating libsass/VERSION (would need git repo)\n";
6060
print " --update-deps Update libsass and specs to latest master (needs git repo)\n";
6161
print " --checkout-deps Checkout submodules at linked commit (needs git repo)\n";
6262
print " --get-versions Show versions of all perl package (.pm) files\n";
@@ -391,6 +391,6 @@ WriteMakefile(
391391
%compiler_flags,
392392
OPTIMIZE => $optimize,
393393
TYPEMAPS => [ 'perlobject.map' ],
394-
OBJECT => join(" ", (sort @SOURCES), '$(O_FILES)'),
394+
OBJECT => join(" ", (@SOURCES), '$(O_FILES)'),
395395
EXE_FILES => [ 'bin/psass' ],
396396
);

README.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,29 @@ psass [options] [ path_in | - ] [ path_out | - ]
7777
-v, --version print version
7878
-h, --help print this help
7979
-w, --watch start watchdog mode
80-
-p, --precision precision for float output
80+
-p, --precision=int precision for float output
81+
--indent=string set indent string used for output
82+
--linefeed=type linefeed used for output [auto|unix|win|none]
8183
-o, --output-file=file output file to write result to
82-
-t, --output-style=style output style [nested|compressed]
83-
-L, --plugin-path=path plugin load path (repeatable)
84+
-t, --output-style=style output style [expanded|nested|compressed|compact]
85+
-P, --plugin-path=path plugin load path (repeatable)
8486
-I, --include-path=path sass include path (repeatable)
8587
-c, --source-comments enable source debug comments
88+
-l, --line-comments synonym for --source-comments
89+
--line-numbers synonym for --source-comments
8690
-e, --source-map-embed embed source-map in mapping url
8791
-s, --source-map-contents include original contents
8892
-m, --source-map-file=file create and write source-map to file
93+
--source-map-file-urls create file urls for source paths
94+
--source-map-root=. specific root for relative paths
8995
--no-source-map-url omit sourceMappingUrl from output
96+
--benchmark print benchmark for compilation time
9097
```
9198

9299
Copyright And Licence
93100
---------------------
94101

95102
Copyright © 2013-2014 by David Caldwell
96-
Copyright © 2014-2016 by Marcel Greter
103+
Copyright © 2014-2017 by Marcel Greter
97104

98105
This library is released under the MIT license.

Sass.xs

+38-36
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright (c) 2013 David Caldwell.
2-
// Copyright (c) 2014 Marcel Greter.
1+
// Copyright (c) 2013-2014 David Caldwell.
2+
// Copyright (c) 2014-2017 Marcel Greter.
33
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files (the "Software"), to deal
@@ -587,42 +587,44 @@ union Sass_Value* call_sass_function(const union Sass_Value* s_args, Sass_Functi
587587
SV* init_sass_options(struct Sass_Options* sass_options, HV* perl_options)
588588
{
589589

590-
SV** input_path_sv = hv_fetchs(perl_options, "input_path", false);
591-
SV** output_path_sv = hv_fetchs(perl_options, "output_path", false);
592-
SV** output_style_sv = hv_fetchs(perl_options, "output_style", false);
593-
SV** source_comments_sv = hv_fetchs(perl_options, "source_comments", false);
594-
SV** omit_source_map_sv = hv_fetchs(perl_options, "omit_source_map", false);
595-
SV** omit_source_map_url_sv = hv_fetchs(perl_options, "omit_source_map_url", false);
596-
SV** source_map_contents_sv = hv_fetchs(perl_options, "source_map_contents", false);
597-
SV** source_map_embed_sv = hv_fetchs(perl_options, "source_map_embed", false);
598-
SV** include_paths_sv = hv_fetchs(perl_options, "include_paths", false);
599-
SV** plugin_paths_sv = hv_fetchs(perl_options, "plugin_paths", false);
600-
SV** precision_sv = hv_fetchs(perl_options, "precision", false);
601-
SV** linefeed_sv = hv_fetchs(perl_options, "linefeed", false);
602-
SV** indent_sv = hv_fetchs(perl_options, "indent", false);
603-
SV** source_map_root_sv = hv_fetchs(perl_options, "source_map_root", false);
604-
SV** source_map_file_sv = hv_fetchs(perl_options, "source_map_file", false);
605-
SV** sass_headers_sv = hv_fetchs(perl_options, "headers", false);
606-
SV** sass_importers_sv = hv_fetchs(perl_options, "importers", false);
607-
SV** sass_functions_sv = hv_fetchs(perl_options, "functions", false);
608-
609-
if (input_path_sv) sass_option_set_input_path (sass_options, safe_svpv(*input_path_sv, ""));
610-
if (output_path_sv) sass_option_set_output_path (sass_options, safe_svpv(*output_path_sv, ""));
611-
if (output_style_sv) sass_option_set_output_style (sass_options, SvUV(*output_style_sv));
612-
if (source_comments_sv) sass_option_set_source_comments (sass_options, SvTRUE(*source_comments_sv));
613-
if (omit_source_map_sv) sass_option_set_omit_source_map_url (sass_options, SvTRUE(*omit_source_map_sv));
614-
if (omit_source_map_url_sv) sass_option_set_omit_source_map_url (sass_options, SvTRUE(*omit_source_map_url_sv));
615-
if (source_map_contents_sv) sass_option_set_source_map_contents (sass_options, SvTRUE(*source_map_contents_sv));
616-
if (source_map_embed_sv) sass_option_set_source_map_embed (sass_options, SvTRUE(*source_map_embed_sv));
617-
if (include_paths_sv) sass_option_set_include_path (sass_options, safe_svpv(*include_paths_sv, ""));
618-
if (plugin_paths_sv) sass_option_set_plugin_path (sass_options, safe_svpv(*plugin_paths_sv, ""));
619-
if (source_map_root_sv) sass_option_set_source_map_root (sass_options, safe_svpv(*source_map_root_sv, ""));
620-
if (source_map_file_sv) sass_option_set_source_map_file (sass_options, safe_svpv(*source_map_file_sv, ""));
590+
SV** input_path_sv = hv_fetchs(perl_options, "input_path", false);
591+
SV** output_path_sv = hv_fetchs(perl_options, "output_path", false);
592+
SV** output_style_sv = hv_fetchs(perl_options, "output_style", false);
593+
SV** source_comments_sv = hv_fetchs(perl_options, "source_comments", false);
594+
SV** omit_source_map_sv = hv_fetchs(perl_options, "omit_source_map", false);
595+
SV** omit_source_map_url_sv = hv_fetchs(perl_options, "omit_source_map_url", false);
596+
SV** source_map_file_urls_sv = hv_fetchs(perl_options, "source_map_file_urls", false);
597+
SV** source_map_contents_sv = hv_fetchs(perl_options, "source_map_contents", false);
598+
SV** source_map_embed_sv = hv_fetchs(perl_options, "source_map_embed", false);
599+
SV** include_paths_sv = hv_fetchs(perl_options, "include_paths", false);
600+
SV** plugin_paths_sv = hv_fetchs(perl_options, "plugin_paths", false);
601+
SV** precision_sv = hv_fetchs(perl_options, "precision", false);
602+
SV** linefeed_sv = hv_fetchs(perl_options, "linefeed", false);
603+
SV** indent_sv = hv_fetchs(perl_options, "indent", false);
604+
SV** source_map_root_sv = hv_fetchs(perl_options, "source_map_root", false);
605+
SV** source_map_file_sv = hv_fetchs(perl_options, "source_map_file", false);
606+
SV** sass_headers_sv = hv_fetchs(perl_options, "headers", false);
607+
SV** sass_importers_sv = hv_fetchs(perl_options, "importers", false);
608+
SV** sass_functions_sv = hv_fetchs(perl_options, "functions", false);
609+
610+
if (input_path_sv) sass_option_set_input_path (sass_options, safe_svpv(*input_path_sv, ""));
611+
if (output_path_sv) sass_option_set_output_path (sass_options, safe_svpv(*output_path_sv, ""));
612+
if (output_style_sv) sass_option_set_output_style (sass_options, SvUV(*output_style_sv));
613+
if (source_comments_sv) sass_option_set_source_comments (sass_options, SvTRUE(*source_comments_sv));
614+
if (omit_source_map_sv) sass_option_set_omit_source_map_url (sass_options, SvTRUE(*omit_source_map_sv));
615+
if (omit_source_map_url_sv) sass_option_set_omit_source_map_url (sass_options, SvTRUE(*omit_source_map_url_sv));
616+
if (source_map_file_urls_sv) sass_option_set_source_map_file_urls (sass_options, SvTRUE(*source_map_file_urls_sv));
617+
if (source_map_contents_sv) sass_option_set_source_map_contents (sass_options, SvTRUE(*source_map_contents_sv));
618+
if (source_map_embed_sv) sass_option_set_source_map_embed (sass_options, SvTRUE(*source_map_embed_sv));
619+
if (include_paths_sv) sass_option_set_include_path (sass_options, safe_svpv(*include_paths_sv, ""));
620+
if (plugin_paths_sv) sass_option_set_plugin_path (sass_options, safe_svpv(*plugin_paths_sv, ""));
621+
if (source_map_root_sv) sass_option_set_source_map_root (sass_options, safe_svpv(*source_map_root_sv, ""));
622+
if (source_map_file_sv) sass_option_set_source_map_file (sass_options, safe_svpv(*source_map_file_sv, ""));
621623

622624
// do not set anything if the option is set to undef
623-
if (isSafeSv(indent_sv)) sass_option_set_indent (sass_options, SvPV_nolen(*indent_sv));
624-
if (isSafeSv(linefeed_sv)) sass_option_set_linefeed (sass_options, SvPV_nolen(*linefeed_sv));
625-
if (isSafeSv(precision_sv)) sass_option_set_precision (sass_options, SvUV(*precision_sv));
625+
if (isSafeSv(indent_sv)) sass_option_set_indent (sass_options, SvPV_nolen(*indent_sv));
626+
if (isSafeSv(linefeed_sv)) sass_option_set_linefeed (sass_options, SvPV_nolen(*linefeed_sv));
627+
if (isSafeSv(precision_sv)) sass_option_set_precision (sass_options, SvUV(*precision_sv));
626628

627629
if (sass_importers_sv) {
628630
int i;

bin/psass

+13-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ use warnings;
1515
use Pod::Usage;
1616
use Getopt::Long;
1717

18+
# make the options case sensitive
19+
Getopt::Long::Configure("bundling");
20+
1821
# convenient file handling
1922
use File::Slurp qw(write_file);
2023

@@ -57,6 +60,7 @@ my $source_map_file;
5760
my $source_map_root;
5861
my $source_map_embed;
5962
my $source_map_contents;
63+
my $source_map_file_urls;
6064
my $omit_source_map_url;
6165

6266
# define a sub to print out the version (mimic behaviour of node.js blessc)
@@ -86,13 +90,16 @@ GetOptions (
8690
'precision|p=s' => \ $precision,
8791
'output-file|o=s' => \ $output_file,
8892
'output-style|t=s' => \ $output_style,
93+
'line-numbers|c!' => \ $source_comments,
94+
'line-comments|c!' => \ $source_comments,
8995
'source-comments|c!' => \ $source_comments,
9096
'source-map-file|m=s' => \ $source_map_file,
9197
'source-map-root=s' => \ $source_map_root,
9298
'source-map-embed|e!' => \ $source_map_embed,
9399
'source-map-contents|s!' => \ $source_map_contents,
100+
'source-map-file-urls!' => \$source_map_file_urls,
94101
'no-source-map-url!' => \ $omit_source_map_url,
95-
'plugin-path|L=s' => sub { push @plugin_paths, $_[1] },
102+
'plugin-path|P|L=s' => sub { push @plugin_paths, $_[1] },
96103
'include-path|I=s' => sub { push @include_paths, $_[1] }
97104
);
98105

@@ -152,6 +159,7 @@ sub sass_options ()
152159
source_map_root => $source_map_root,
153160
source_map_embed => $source_map_embed,
154161
source_map_contents => $source_map_contents,
162+
source_map_file_urls => $source_map_file_urls,
155163
omit_source_map_url => $omit_source_map_url,
156164
);
157165
}
@@ -249,12 +257,15 @@ psass [options] [ path_in | - ] [ path_out | - ]
249257
--linefeed=type linefeed used for output [auto|unix|win|none]
250258
-o, --output-file=file output file to write result to
251259
-t, --output-style=style output style [expanded|nested|compressed|compact]
252-
-L, --plugin-path=path plugin load path (repeatable)
260+
-P, --plugin-path=path plugin load path (repeatable)
253261
-I, --include-path=path sass include path (repeatable)
254262
-c, --source-comments enable source debug comments
263+
-l, --line-comments synonym for --source-comments
264+
--line-numbers synonym for --source-comments
255265
-e, --source-map-embed embed source-map in mapping url
256266
-s, --source-map-contents include original contents
257267
-m, --source-map-file=file create and write source-map to file
268+
--source-map-file-urls create file urls for source paths
258269
--source-map-root=. specific root for relative paths
259270
--no-source-map-url omit sourceMappingUrl from output
260271
--benchmark print benchmark for compilation time

lib/CSS/Sass.md

+4
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ heading towards full 3.4 compatibility. It can compile .scss and .sass files.
179179
actually be created, but its content will be returned to the caller. It
180180
will also enable sourceMappingURL comment by default. See `no_src_map_url`.
181181

182+
- `source_map_file_urls`
183+
184+
Render source entries in the source map json as file urls (`file:///`).
185+
182186
- `source_map_root`
183187

184188
A path (string) that is directly embedded in the source map as `sourceRoot`.

lib/CSS/Sass.pm

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) 2013 David Caldwell.
2-
# Copyright (c) 2014 Marcel Greter.
1+
# Copyright (c) 2013-2014 David Caldwell.
2+
# Copyright (c) 2014-2017 Marcel Greter.
33
#
44
# Permission is hereby granted, free of charge, to any person obtaining a copy
55
# of this software and associated documentation files (the "Software"), to deal
@@ -69,7 +69,7 @@ our @EXPORT = qw(
6969
SASS2SCSS_CONVERT_COMMENT
7070
);
7171

72-
our $VERSION = "3.3.6";
72+
our $VERSION = "3.4.0";
7373

7474
require XSLoader;
7575
XSLoader::load('CSS::Sass', $VERSION);
@@ -411,6 +411,10 @@ Setting this option enables the source-map generating. The file will not
411411
actually be created, but its content will be returned to the caller. It
412412
will also enable sourceMappingURL comment by default. See C<no_src_map_url>.
413413
414+
=item C<source_map_file_urls>
415+
416+
Render source entries in the source map json as file urls (`file:///`).
417+
414418
=item C<source_map_root>
415419
416420
A path (string) that is directly embedded in the source map as C<sourceRoot>.

lib/CSS/Sass/Type.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) 2013 David Caldwell.
2-
# Copyright (c) 2014 Marcel Greter.
1+
# Copyright (c) 2013-2014 David Caldwell.
2+
# Copyright (c) 2014-2017 Marcel Greter.
33
#
44
# Permission is hereby granted, free of charge, to any person obtaining a copy
55
# of this software and associated documentation files (the "Software"), to deal

lib/CSS/Sass/Value.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) 2013 David Caldwell.
2-
# Copyright (c) 2014 Marcel Greter.
1+
# Copyright (c) 2013-2014 David Caldwell.
2+
# Copyright (c) 2014-2017 Marcel Greter.
33
#
44
# Permission is hereby granted, free of charge, to any person obtaining a copy
55
# of this software and associated documentation files (the "Software"), to deal
@@ -39,7 +39,7 @@ use CSS::Sass;
3939

4040
################################################################################
4141
package CSS::Sass::Value;
42-
our $VERSION = "3.3.6";
42+
our $VERSION = "3.4.0";
4343
################################################################################
4444
use CSS::Sass qw(import_sv);
4545
use CSS::Sass qw(sass_operation);

lib/CSS/Sass/Watchdog.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) 2013 David Caldwell.
2-
# Copyright (c) 2014 Marcel Greter.
1+
# Copyright (c) 2013-2014 David Caldwell.
2+
# Copyright (c) 2014-2017 Marcel Greter.
33
#
44
# Permission is hereby granted, free of charge, to any person obtaining a copy
55
# of this software and associated documentation files (the "Software"), to deal
@@ -25,7 +25,7 @@ use CSS::Sass;
2525

2626
################################################################################
2727
package CSS::Sass::Watchdog;
28-
our $VERSION = "3.3.6";
28+
our $VERSION = "3.4.0";
2929
################################################################################
3030

3131
use Exporter 'import'; # gives you Exporter's import() method directly

t/05_source_maps.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ like ($r, qr/# sourceMappingURL=\.\.\/\.\.\/test.map/, "SourceMap relative url
6767
$sass = CSS::Sass->new(include_paths => ['t/inc'], %options, source_comments => 1, omit_source_map => 1);
6868
($r, $stat) = $sass->compile_file('sass/test-incs.sass');
6969
ok ($stat->{'source_map_string'}, "Created source map 7");
70-
like ($r, qr{line 1, .*?/t/inc/sass/test-inc-01.sass}, "SourceMap relative url test 7");
70+
like ($r, qr{line 1, t/inc/sass/test-inc-01.sass}, "SourceMap relative url test 7");
7171

7272
$options{'source_map_root'} = '/foo/bar';
7373

t/08_sass_to_scss.t

+18-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
use strict;
44
use warnings;
55

6-
use Test::More tests => 61;
6+
use Test::More;
7+
plan(skip_all => 'Moved to specs');
8+
9+
__DATA__
10+
11+
use Test::More tests => 63;
12+
713
814
use CSS::Sass;
915
@@ -330,6 +336,17 @@ chomp($r) if $ignore_whitespace;
330336
is ($r, $expect, "Handle urls in quotes/apos correctly (24)");
331337
is ($err, undef, "Handle urls in quotes/apos correctly (24)");
332338
339+
$src = read_file('t/inc/sass/t-25.sass');
340+
($r, $err) = CSS::Sass::sass2scss($src, SASS2SCSS_PRETTIFY_1 | SASS2SCSS_KEEP_COMMENT);
341+
$r =~ s/[\r\n]+/\n/g if $ignore_whitespace;
342+
$expect = read_file('t/inc/scss/t-25.scss');
343+
$expect =~ s/[\r\n]+/\n/g if $ignore_whitespace;
344+
chomp($expect) if $ignore_whitespace;
345+
chomp($r) if $ignore_whitespace;
346+
347+
is ($r, $expect, "Handle urls in quotes/apos correctly (24)");
348+
is ($err, undef, "Handle urls in quotes/apos correctly (24)");
349+
333350
$src = read_file('t/inc/sass/comment.sass');
334351
($r, $err) = CSS::Sass::sass2scss($src, SASS2SCSS_PRETTIFY_1 | SASS2SCSS_KEEP_COMMENT);
335352
$r =~ s/[\r\n]+/\n/g if $ignore_whitespace;

0 commit comments

Comments
 (0)