sass 3.3.9 → 3.3.10
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 +4 -4
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass/importers/base.rb +2 -1
- data/lib/sass/importers/filesystem.rb +1 -1
- data/lib/sass/source/map.rb +1 -1
- data/lib/sass/util.rb +18 -5
- data/test/sass/source_map_test.rb +26 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51af6abb9bda0db36107c86700f55be3f0f07260
|
4
|
+
data.tar.gz: b9317bd7d85ab09f7a16c58cb0453a855319786d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3fdf6fdd3596c84c5cb6f648316c028ee25a11106ff899f4f4858098eb0d28490a5d9ae26157902a3f8a57450bdda63bea7ec78afb4ebd06e97518c579d3fea
|
7
|
+
data.tar.gz: 04766334fbde5fa7b6ab22d8523ca67347d55a949199c2432fbbf82e31d11d9a0f6966f3c6547754d37deace2e5af5e302b72fc781ba392bb70a908ef34f9b0a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.
|
1
|
+
3.3.10
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
12 July 2014 01:37:13 UTC
|
data/lib/sass/importers/base.rb
CHANGED
@@ -131,7 +131,8 @@ module Sass
|
|
131
131
|
# may return a relative URL. This may be `nil` if the sourcemap's
|
132
132
|
# eventual location is unknown.
|
133
133
|
# @return [String?] The publicly-visible URL for this file, or `nil`
|
134
|
-
# indicating that no publicly-visible URL exists.
|
134
|
+
# indicating that no publicly-visible URL exists. This should be
|
135
|
+
# appropriately URL-escaped.
|
135
136
|
def public_url(uri, sourcemap_directory = nil)
|
136
137
|
return if @public_url_warning_issued
|
137
138
|
@public_url_warning_issued = true
|
@@ -71,7 +71,7 @@ module Sass
|
|
71
71
|
file_pathname = Sass::Util.cleanpath(Sass::Util.absolute_path(name, @root))
|
72
72
|
sourcemap_pathname = Sass::Util.cleanpath(sourcemap_directory)
|
73
73
|
begin
|
74
|
-
file_pathname.relative_path_from(sourcemap_pathname)
|
74
|
+
Sass::Util.file_uri_from_path(file_pathname.relative_path_from(sourcemap_pathname))
|
75
75
|
rescue ArgumentError # when a relative path cannot be constructed
|
76
76
|
warn_about_public_url(name)
|
77
77
|
nil
|
data/lib/sass/source/map.rb
CHANGED
@@ -99,7 +99,7 @@ module Sass::Source
|
|
99
99
|
end
|
100
100
|
css_path &&= Sass::Util.pathname(Sass::Util.absolute_path(css_path))
|
101
101
|
sourcemap_path &&= Sass::Util.pathname(Sass::Util.absolute_path(sourcemap_path))
|
102
|
-
css_uri ||= css_path.relative_path_from(sourcemap_path.dirname)
|
102
|
+
css_uri ||= Sass::Util.file_uri_from_path(css_path.relative_path_from(sourcemap_path.dirname))
|
103
103
|
|
104
104
|
result = "{\n"
|
105
105
|
write_json_field(result, "version", 3, true)
|
data/lib/sass/util.rb
CHANGED
@@ -17,7 +17,7 @@ module Sass
|
|
17
17
|
|
18
18
|
# An array of ints representing the Ruby version number.
|
19
19
|
# @api public
|
20
|
-
|
20
|
+
RUBY_VERSION_COMPONENTS = RUBY_VERSION.split(".").map {|s| s.to_i}
|
21
21
|
|
22
22
|
# The Ruby engine we're running under. Defaults to `"ruby"`
|
23
23
|
# if the top-level constant is undefined.
|
@@ -648,6 +648,19 @@ module Sass
|
|
648
648
|
pathname(path.cleanpath.to_s)
|
649
649
|
end
|
650
650
|
|
651
|
+
# Converts `path` to a "file:" URI. This handles Windows paths correctly.
|
652
|
+
#
|
653
|
+
# @param path [String, Pathname]
|
654
|
+
# @return [String]
|
655
|
+
def file_uri_from_path(path)
|
656
|
+
path = path.to_s if path.is_a?(Pathname)
|
657
|
+
path = Sass::Util.escape_uri(path)
|
658
|
+
return path.start_with?('/') ? "file://" + path : path unless windows?
|
659
|
+
return "file:///" + path.tr("\\", "/") if path =~ /^[a-zA-Z]:[\/\\]/
|
660
|
+
return "file://" + path.tr("\\", "/") if path =~ /\\\\[^\\]+\\[^\\\/]+/
|
661
|
+
path.tr("\\", "/")
|
662
|
+
end
|
663
|
+
|
651
664
|
# Prepare a value for a destructuring assignment (e.g. `a, b =
|
652
665
|
# val`). This works around a performance bug when using
|
653
666
|
# ActiveSupport, and only needs to be called when `val` is likely
|
@@ -668,7 +681,7 @@ module Sass
|
|
668
681
|
# @return [Boolean]
|
669
682
|
def ruby1?
|
670
683
|
return @ruby1 if defined?(@ruby1)
|
671
|
-
@ruby1 =
|
684
|
+
@ruby1 = RUBY_VERSION_COMPONENTS[0] <= 1
|
672
685
|
end
|
673
686
|
|
674
687
|
# Whether or not this is running under Ruby 1.8 or lower.
|
@@ -682,7 +695,7 @@ module Sass
|
|
682
695
|
# We have to fall back to 1.8 behavior.
|
683
696
|
return @ruby1_8 if defined?(@ruby1_8)
|
684
697
|
@ruby1_8 = ironruby? ||
|
685
|
-
(
|
698
|
+
(RUBY_VERSION_COMPONENTS[0] == 1 && RUBY_VERSION_COMPONENTS[1] < 9)
|
686
699
|
end
|
687
700
|
|
688
701
|
# Whether or not this is running under Ruby 1.8.6 or lower.
|
@@ -691,7 +704,7 @@ module Sass
|
|
691
704
|
# @return [Boolean]
|
692
705
|
def ruby1_8_6?
|
693
706
|
return @ruby1_8_6 if defined?(@ruby1_8_6)
|
694
|
-
@ruby1_8_6 = ruby1_8? &&
|
707
|
+
@ruby1_8_6 = ruby1_8? && RUBY_VERSION_COMPONENTS[2] < 7
|
695
708
|
end
|
696
709
|
|
697
710
|
# Wehter or not this is running under JRuby 1.6 or lower.
|
@@ -977,7 +990,7 @@ MSG
|
|
977
990
|
# @param obj {Object}
|
978
991
|
# @return {String}
|
979
992
|
def inspect_obj(obj)
|
980
|
-
return obj.inspect unless version_geq(
|
993
|
+
return obj.inspect unless version_geq(RUBY_VERSION, "1.9.2")
|
981
994
|
return ':' + inspect_obj(obj.to_s) if obj.is_a?(Symbol)
|
982
995
|
return obj.inspect unless obj.is_a?(String)
|
983
996
|
'"' + obj.gsub(/[\x00-\x7F]+/) {|s| s.inspect[1...-1]} + '"'
|
@@ -764,6 +764,32 @@ SCSS
|
|
764
764
|
CSS
|
765
765
|
end
|
766
766
|
|
767
|
+
def test_sources_array_is_uri_escaped
|
768
|
+
map = Sass::Source::Map.new
|
769
|
+
importer = Sass::Importers::Filesystem.new('.')
|
770
|
+
map.add(
|
771
|
+
Sass::Source::Range.new(
|
772
|
+
Sass::Source::Position.new(0, 0),
|
773
|
+
Sass::Source::Position.new(0, 10),
|
774
|
+
'source file.scss',
|
775
|
+
importer),
|
776
|
+
Sass::Source::Range.new(
|
777
|
+
Sass::Source::Position.new(0, 0),
|
778
|
+
Sass::Source::Position.new(0, 10),
|
779
|
+
nil, nil))
|
780
|
+
|
781
|
+
json = map.to_json(:css_path => 'output file.css', :sourcemap_path => 'output file.css.map')
|
782
|
+
assert_equal json, <<JSON.rstrip
|
783
|
+
{
|
784
|
+
"version": 3,
|
785
|
+
"mappings": "DADD,UAAU",
|
786
|
+
"sources": ["source%20file.scss"],
|
787
|
+
"names": [],
|
788
|
+
"file": "output%20file.css"
|
789
|
+
}
|
790
|
+
JSON
|
791
|
+
end
|
792
|
+
|
767
793
|
private
|
768
794
|
|
769
795
|
ANNOTATION_REGEX = /\{\{(\/?)([^}]+)\}\}/
|
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.3.
|
4
|
+
version: 3.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-07-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: yard
|