sass 3.4.3 → 3.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2247321bf696ce2fefd8b57e4312ddc885595cdc
4
- data.tar.gz: 7267469a257cb4ee1447ced88ae5b7460ed2e8b6
3
+ metadata.gz: e3fbc042c02c52b18d59b25d9c26459658baf6cf
4
+ data.tar.gz: faf525b9b4f1837dc790d9fdae267d0ed729b41e
5
5
  SHA512:
6
- metadata.gz: 4773c1e62448e7ebb59025e7525bf7ac16c3b74366201d311d07de749c6f43745cdf6114a9a0be7b1f8f5bdaf79d40db423d997bfa0f0f35812dc1c4902b149f
7
- data.tar.gz: 0014b9b892d70af234d5f79d8828f0ce6dc5ac87e95f1dd1803f0b15073d30fabffecaba56b79498355e5af9bc408ff2627520056a614d64c5200a1257c791d7
6
+ metadata.gz: 6cd8dc8c85660b360845e47b15c78218a076558e6ce0e09bbb13b4a79d2c74a72563e974189d8db5be708c30c6f04877c467a959670179b7244c4d91cd8b7c87
7
+ data.tar.gz: 7cd31825c789bc5744514aac91d5346b952a2286c5ea148f1cb2c1471b34769fae3df30bab1d7ffa728bb07a774a9560732fb4acb011062e6e7694f5bf8ea244
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.4.3
1
+ 3.4.4
@@ -1 +1 @@
1
- 05 September 2014 01:13:33 UTC
1
+ 13 September 2014 00:20:07 UTC
@@ -1130,8 +1130,9 @@ WARNING
1130
1130
 
1131
1131
  return "/* */" if content.empty?
1132
1132
  content.last.gsub!(/ ?\*\/ *$/, '')
1133
+ first = content.shift unless removed_first
1133
1134
  content.map! {|l| l.gsub!(/^\*( ?)/, '\1') || (l.empty? ? "" : " ") + l}
1134
- content.first.gsub!(/^ /, '') unless removed_first
1135
+ content.unshift first unless removed_first
1135
1136
  if silent
1136
1137
  "/*" + content.join("\n *") + " */"
1137
1138
  else
@@ -370,8 +370,8 @@ MSG
370
370
  input.close if input.is_a?(File)
371
371
 
372
372
  if @options[:sourcemap] != :none && @options[:sourcemap_filename]
373
- relative_sourcemap_path = Sass::Util.pathname(@options[:sourcemap_filename]).
374
- relative_path_from(Sass::Util.pathname(@options[:output_filename]).dirname)
373
+ relative_sourcemap_path = Sass::Util.relative_path_from(
374
+ @options[:sourcemap_filename], Sass::Util.pathname(@options[:output_filename]).dirname)
375
375
  rendered, mapping = engine.render_with_sourcemap(relative_sourcemap_path.to_s)
376
376
  write_output(rendered, output)
377
377
  write_output(mapping.to_json(
@@ -68,15 +68,14 @@ module Sass
68
68
 
69
69
  def public_url(name, sourcemap_directory)
70
70
  file_pathname = Sass::Util.cleanpath(Sass::Util.absolute_path(name, @root))
71
- if sourcemap_directory.nil?
71
+ return Sass::Util.file_uri_from_path(file_pathname) if sourcemap_directory.nil?
72
+
73
+ sourcemap_pathname = Sass::Util.cleanpath(sourcemap_directory)
74
+ begin
75
+ Sass::Util.file_uri_from_path(
76
+ Sass::Util.relative_path_from(file_pathname, sourcemap_pathname))
77
+ rescue ArgumentError # when a relative path cannot be constructed
72
78
  Sass::Util.file_uri_from_path(file_pathname)
73
- else
74
- sourcemap_pathname = Sass::Util.cleanpath(sourcemap_directory)
75
- begin
76
- Sass::Util.file_uri_from_path(file_pathname.relative_path_from(sourcemap_pathname))
77
- rescue ArgumentError # when a relative path cannot be constructed
78
- Sass::Util.file_uri_from_path(file_pathname)
79
- end
80
79
  end
81
80
  end
82
81
 
@@ -251,8 +251,7 @@ module Sass::Plugin
251
251
  template_location_array.each do |template_location, css_location|
252
252
  Sass::Util.glob(File.join(template_location, "**", "[^_]*.s[ca]ss")).sort.each do |file|
253
253
  # Get the relative path to the file
254
- name = Sass::Util.pathname(file).relative_path_from(
255
- Sass::Util.pathname(template_location.to_s)).to_s
254
+ name = Sass::Util.relative_path_from(file, template_location).to_s
256
255
  css = css_filename(name, css_location)
257
256
  sourcemap = Sass::Util.sourcemap_name(css) unless engine_options[:sourcemap] == :none
258
257
  files << [file, css, sourcemap]
@@ -558,7 +557,7 @@ module Sass::Plugin
558
557
  end
559
558
 
560
559
  def relative_to_pwd(f)
561
- Sass::Util.pathname(f).relative_path_from(Sass::Util.pathname(Dir.pwd)).to_s
560
+ Sass::Util.relative_path_from(f, Dir.pwd).to_s
562
561
  rescue ArgumentError # when a relative path cannot be computed
563
562
  f
564
563
  end
@@ -358,7 +358,7 @@ MESSAGE
358
358
  end
359
359
 
360
360
  def keyframes_selector_component
361
- tok(/from|to/i) || tok(PERCENTAGE)
361
+ tok(IDENT) || tok(PERCENTAGE)
362
362
  end
363
363
 
364
364
  @sass_script_parser = Class.new(Sass::Script::CssParser)
@@ -95,7 +95,8 @@ module Sass::Source
95
95
  end
96
96
  css_path &&= Sass::Util.pathname(Sass::Util.absolute_path(css_path))
97
97
  sourcemap_path &&= Sass::Util.pathname(Sass::Util.absolute_path(sourcemap_path))
98
- css_uri ||= Sass::Util.file_uri_from_path(css_path.relative_path_from(sourcemap_path.dirname))
98
+ css_uri ||= Sass::Util.file_uri_from_path(
99
+ Sass::Util.relative_path_from(css_path, sourcemap_path.dirname))
99
100
 
100
101
  result = "{\n"
101
102
  write_json_field(result, "version", 3, true)
@@ -306,8 +306,8 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
306
306
  relative_filename =
307
307
  if node.options[:css_filename]
308
308
  begin
309
- Sass::Util.pathname(node.filename).relative_path_from(
310
- Sass::Util.pathname(File.dirname(node.options[:css_filename]))).to_s
309
+ Sass::Util.relative_path_from(
310
+ node.filename, File.dirname(node.options[:css_filename])).to_s
311
311
  rescue ArgumentError
312
312
  nil
313
313
  end
@@ -664,7 +664,7 @@ module Sass
664
664
  # Returns `path` with all symlinks resolved.
665
665
  #
666
666
  # @param path [String, Pathname]
667
- # @return [Pathanme]
667
+ # @return [Pathname]
668
668
  def realpath(path)
669
669
  path = Pathname.new(path) unless path.is_a?(Pathname)
670
670
 
@@ -681,6 +681,28 @@ module Sass
681
681
  end
682
682
  end
683
683
 
684
+ # Returns `path` relative to `from`.
685
+ #
686
+ # This is like `Pathname#relative_path_from` except it accepts both strings
687
+ # and pathnames, it handles Windows path separators correctly, and it throws
688
+ # an error rather than crashing if the paths use different encodings
689
+ # (https://github.com/ruby/ruby/pull/713).
690
+ #
691
+ # @param path [String, Pathname]
692
+ # @param from [String, Pathname]
693
+ # @return [Pathname?]
694
+ def relative_path_from(path, from)
695
+ pathname(path.to_s).relative_path_from(pathname(from.to_s))
696
+ rescue NoMethodError => e
697
+ raise e unless e.name == :zero?
698
+
699
+ # Work around https://github.com/ruby/ruby/pull/713.
700
+ path = path.to_s
701
+ from = from.to_s
702
+ raise ArgumentError("Incompatible path encodings: #{path.inspect} is #{path.encoding}, " +
703
+ "#{from.inspect} is #{from.encoding}")
704
+ end
705
+
684
706
  # Converts `path` to a "file:" URI. This handles Windows paths correctly.
685
707
  #
686
708
  # @param path [String, Pathname]
@@ -351,6 +351,23 @@ foo
351
351
  SASS
352
352
  end
353
353
 
354
+ def test_preserves_triple_slash_comments
355
+ assert_renders <<SASS, <<SCSS
356
+ /// foo
357
+ /// bar
358
+ foo
359
+ /// bip bop
360
+ /// beep boop
361
+ SASS
362
+ /// foo
363
+ /// bar
364
+ foo {
365
+ /// bip bop
366
+ /// beep boop
367
+ }
368
+ SCSS
369
+ end
370
+
354
371
  def test_loud_comments
355
372
  assert_renders <<SASS, <<SCSS
356
373
  /* foo
@@ -467,6 +484,23 @@ foo
467
484
  SASS
468
485
  end
469
486
 
487
+ def test_preserves_double_star_comments
488
+ assert_renders <<SASS, <<SCSS
489
+ /** foo
490
+ * bar
491
+ foo
492
+ /** bip bop
493
+ * beep boop
494
+ SASS
495
+ /** foo
496
+ * bar */
497
+ foo {
498
+ /** bip bop
499
+ * beep boop */
500
+ }
501
+ SCSS
502
+ end
503
+
470
504
  def test_loud_comments_with_weird_indentation
471
505
  assert_scss_to_sass <<SASS, <<SCSS
472
506
  foo
@@ -701,6 +701,27 @@ CSS
701
701
  50% {background-color: black}
702
702
  100% {}
703
703
  }
704
+ SCSS
705
+ end
706
+
707
+ def test_keyframes_with_custom_identifiers
708
+ assert_equal <<CSS, render(<<SCSS)
709
+ @-skrollr-keyframes identifier {
710
+ center-top {
711
+ left: 100%; }
712
+ top-bottom {
713
+ left: 0%; } }
714
+ CSS
715
+ @-skrollr-keyframes identifier {
716
+ center-top {
717
+ left: 100%;
718
+ }
719
+
720
+ top-bottom {
721
+ left: 0%;
722
+ }
723
+ }
724
+
704
725
  SCSS
705
726
  end
706
727
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.3
4
+ version: 3.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Natalie Weizenbaum
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-09-05 00:00:00.000000000 Z
13
+ date: 2014-09-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: yard