sass 3.3.0.alpha.216 → 3.3.0.alpha.218
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +2 -2
- data/REVISION +1 -1
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass/exec.rb +6 -3
- data/lib/sass/util/test.rb +10 -0
- data/test/sass/exec_test.rb +86 -0
- metadata +20 -17
data/MIT-LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2006-
|
1
|
+
Copyright (c) 2006-2013 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
17
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/REVISION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
85f7ca624f2fb7d19320e107d518d3376952bf16
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.0.alpha.
|
1
|
+
3.3.0.alpha.218
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
27 July 2013
|
1
|
+
27 July 2013 01:12:19 GMT
|
data/lib/sass/exec.rb
CHANGED
@@ -163,7 +163,7 @@ module Sass
|
|
163
163
|
|
164
164
|
def write_output(text, destination)
|
165
165
|
if destination.is_a?(String)
|
166
|
-
|
166
|
+
open_file(destination, 'w') {|file| file.write(text)}
|
167
167
|
else
|
168
168
|
destination.write(text)
|
169
169
|
end
|
@@ -174,7 +174,10 @@ module Sass
|
|
174
174
|
def open_file(filename, flag = 'r')
|
175
175
|
return if filename.nil?
|
176
176
|
flag = 'wb' if @options[:unix_newlines] && flag == 'w'
|
177
|
-
File.open(filename, flag)
|
177
|
+
file = File.open(filename, flag)
|
178
|
+
return file unless block_given?
|
179
|
+
yield file
|
180
|
+
file.close
|
178
181
|
end
|
179
182
|
|
180
183
|
def handle_load_error(err)
|
@@ -720,7 +723,7 @@ END
|
|
720
723
|
end
|
721
724
|
end
|
722
725
|
|
723
|
-
output =
|
726
|
+
output = input.path if @options[:in_place]
|
724
727
|
write_output(out, output)
|
725
728
|
rescue ::Sass::SyntaxError => e
|
726
729
|
raise e if @options[:trace]
|
@@ -0,0 +1,86 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
3
|
+
require 'sass/util/test'
|
4
|
+
require 'tmpdir'
|
5
|
+
|
6
|
+
class ExecTest < Test::Unit::TestCase
|
7
|
+
include Sass::Util::Test
|
8
|
+
|
9
|
+
def setup
|
10
|
+
@dir = Dir.mktmpdir
|
11
|
+
end
|
12
|
+
|
13
|
+
def teardown
|
14
|
+
FileUtils.rm_rf(@dir)
|
15
|
+
clean_up_sassc
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_scss_t_expanded
|
19
|
+
src = get_path("src.scss")
|
20
|
+
dest = get_path("dest.css")
|
21
|
+
write(src, ".ruleset { margin: 0 }")
|
22
|
+
assert(exec(*%w[scss -t expanded --unix-newlines].push(src, dest)))
|
23
|
+
assert_equal(".ruleset {\n margin: 0;\n}\n", read(dest))
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_sass_convert_T_sass
|
27
|
+
src = get_path("src.scss")
|
28
|
+
dest = get_path("dest.css")
|
29
|
+
write(src, ".ruleset { margin: 0 }")
|
30
|
+
assert(exec(*%w[sass-convert -T sass --unix-newlines].push(src, dest)))
|
31
|
+
assert_equal(".ruleset\n margin: 0\n", read(dest))
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_sass_convert_T_sass_in_place
|
35
|
+
src = get_path("src.scss")
|
36
|
+
write(src, ".ruleset { margin: 0 }")
|
37
|
+
assert(exec(*%w[sass-convert -T sass --in-place --unix-newlines].push(src)))
|
38
|
+
assert_equal(".ruleset\n margin: 0\n", read(src))
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_scss_t_expanded_no_unix_newlines
|
42
|
+
return skip "Can be run on Windows only" unless Sass::Util.windows?
|
43
|
+
src = get_path("src.scss")
|
44
|
+
dest = get_path("dest.css")
|
45
|
+
write(src, ".ruleset { margin: 0 }")
|
46
|
+
assert(exec(*%w[scss -t expanded].push(src, dest)))
|
47
|
+
assert_equal(".ruleset {\r\n margin: 0;\r\n}\r\n", read(dest))
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_sass_convert_T_sass_no_unix_newlines
|
51
|
+
return skip "Can be run on Windows only" unless Sass::Util.windows?
|
52
|
+
src = get_path("src.scss")
|
53
|
+
dest = get_path("dest.sass")
|
54
|
+
write(src, ".ruleset { margin: 0 }")
|
55
|
+
assert(exec(*%w[sass-convert -T sass].push(src, dest)))
|
56
|
+
assert_equal(".ruleset\r\n margin: 0\r\n", read(dest))
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_sass_convert_T_sass_in_place_no_unix_newlines
|
60
|
+
return skip "Can be run on Windows only" unless Sass::Util.windows?
|
61
|
+
src = get_path("src.scss")
|
62
|
+
write(src, ".ruleset { margin: 0 }")
|
63
|
+
assert(exec(*%w[sass-convert -T sass --in-place].push(src)))
|
64
|
+
assert_equal(".ruleset\r\n margin: 0\r\n", read(src))
|
65
|
+
end
|
66
|
+
|
67
|
+
private
|
68
|
+
|
69
|
+
def get_path(name)
|
70
|
+
File.join(@dir, name)
|
71
|
+
end
|
72
|
+
|
73
|
+
def read(file)
|
74
|
+
open(file, 'rb') {|f| f.read}
|
75
|
+
end
|
76
|
+
|
77
|
+
def write(file, content)
|
78
|
+
open(file, 'wb') {|f| f.write(content)}
|
79
|
+
end
|
80
|
+
|
81
|
+
def exec(script, *args)
|
82
|
+
script = File.dirname(__FILE__) + '/../../bin/' + script
|
83
|
+
ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT'])
|
84
|
+
system(ruby, script, *args)
|
85
|
+
end
|
86
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 592302777
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 3
|
9
9
|
- 0
|
10
10
|
- alpha
|
11
|
-
-
|
12
|
-
version: 3.3.0.alpha.
|
11
|
+
- 218
|
12
|
+
version: 3.3.0.alpha.218
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Nathan Weizenbaum
|
@@ -95,8 +95,8 @@ files:
|
|
95
95
|
- lib/sass/environment.rb
|
96
96
|
- lib/sass/error.rb
|
97
97
|
- lib/sass/exec.rb
|
98
|
-
- lib/sass/media.rb
|
99
98
|
- lib/sass/importers.rb
|
99
|
+
- lib/sass/media.rb
|
100
100
|
- lib/sass/importers/base.rb
|
101
101
|
- lib/sass/importers/filesystem.rb
|
102
102
|
- lib/sass/importers/deprecated_path.rb
|
@@ -194,6 +194,7 @@ files:
|
|
194
194
|
- lib/sass/tree/while_node.rb
|
195
195
|
- lib/sass/util/multibyte_string_scanner.rb
|
196
196
|
- lib/sass/util/subset_map.rb
|
197
|
+
- lib/sass/util/test.rb
|
197
198
|
- lib/sass/version.rb
|
198
199
|
- lib/sass/features.rb
|
199
200
|
- bin/sass
|
@@ -203,14 +204,16 @@ files:
|
|
203
204
|
- test/sass/cache_test.rb
|
204
205
|
- test/sass/callbacks_test.rb
|
205
206
|
- test/sass/conversion_test.rb
|
207
|
+
- test/sass/engine_test.rb
|
206
208
|
- test/sass/css2sass_test.rb
|
207
209
|
- test/sass/data/hsl-rgb.txt
|
208
|
-
- test/sass/engine_test.rb
|
209
210
|
- test/sass/extend_test.rb
|
211
|
+
- test/sass/exec_test.rb
|
212
|
+
- test/sass/importer_test.rb
|
210
213
|
- test/sass/fixtures/test_staleness_check_across_importers.css
|
211
214
|
- test/sass/fixtures/test_staleness_check_across_importers.scss
|
212
215
|
- test/sass/functions_test.rb
|
213
|
-
- test/sass/
|
216
|
+
- test/sass/plugin_test.rb
|
214
217
|
- test/sass/logger_test.rb
|
215
218
|
- test/sass/mock_importer.rb
|
216
219
|
- test/sass/more_results/more1.css
|
@@ -219,7 +222,7 @@ files:
|
|
219
222
|
- test/sass/more_templates/_more_partial.sass
|
220
223
|
- test/sass/more_templates/more1.sass
|
221
224
|
- test/sass/more_templates/more_import.sass
|
222
|
-
- test/sass/
|
225
|
+
- test/sass/script_test.rb
|
223
226
|
- test/sass/results/alt.css
|
224
227
|
- test/sass/results/basic.css
|
225
228
|
- test/sass/results/cached_import_option.css
|
@@ -249,12 +252,12 @@ files:
|
|
249
252
|
- test/sass/results/warn.css
|
250
253
|
- test/sass/results/warn_imported.css
|
251
254
|
- test/sass/script_conversion_test.rb
|
252
|
-
- test/sass/
|
255
|
+
- test/sass/util_test.rb
|
253
256
|
- test/sass/scss/css_test.rb
|
254
257
|
- test/sass/scss/rx_test.rb
|
255
258
|
- test/sass/scss/scss_test.rb
|
256
259
|
- test/sass/scss/test_helper.rb
|
257
|
-
- test/sass/
|
260
|
+
- test/sass/compiler_test.rb
|
258
261
|
- test/sass/templates/_cached_import_option_partial.scss
|
259
262
|
- test/sass/templates/_double_import_loop2.sass
|
260
263
|
- test/sass/templates/_filename_fn_import.scss
|
@@ -314,7 +317,6 @@ files:
|
|
314
317
|
- test/sass/test_helper.rb
|
315
318
|
- test/sass/util/multibyte_string_scanner_test.rb
|
316
319
|
- test/sass/util/subset_map_test.rb
|
317
|
-
- test/sass/compiler_test.rb
|
318
320
|
- test/sass/source_map_test.rb
|
319
321
|
- test/test_helper.rb
|
320
322
|
- extra/update_watch.rb
|
@@ -323,8 +325,8 @@ files:
|
|
323
325
|
- .yardopts
|
324
326
|
- README.md
|
325
327
|
- CONTRIBUTING
|
326
|
-
- MIT-LICENSE
|
327
328
|
- VERSION
|
329
|
+
- MIT-LICENSE
|
328
330
|
- VERSION_NAME
|
329
331
|
- REVISION
|
330
332
|
- VERSION_DATE
|
@@ -370,20 +372,21 @@ test_files:
|
|
370
372
|
- test/sass/cache_test.rb
|
371
373
|
- test/sass/callbacks_test.rb
|
372
374
|
- test/sass/conversion_test.rb
|
373
|
-
- test/sass/css2sass_test.rb
|
374
375
|
- test/sass/engine_test.rb
|
376
|
+
- test/sass/css2sass_test.rb
|
375
377
|
- test/sass/extend_test.rb
|
376
|
-
- test/sass/
|
378
|
+
- test/sass/exec_test.rb
|
377
379
|
- test/sass/importer_test.rb
|
378
|
-
- test/sass/
|
380
|
+
- test/sass/functions_test.rb
|
379
381
|
- test/sass/plugin_test.rb
|
380
|
-
- test/sass/
|
382
|
+
- test/sass/logger_test.rb
|
381
383
|
- test/sass/script_test.rb
|
384
|
+
- test/sass/script_conversion_test.rb
|
385
|
+
- test/sass/util_test.rb
|
382
386
|
- test/sass/scss/css_test.rb
|
383
387
|
- test/sass/scss/rx_test.rb
|
384
388
|
- test/sass/scss/scss_test.rb
|
385
|
-
- test/sass/
|
389
|
+
- test/sass/compiler_test.rb
|
386
390
|
- test/sass/util/multibyte_string_scanner_test.rb
|
387
391
|
- test/sass/util/subset_map_test.rb
|
388
|
-
- test/sass/compiler_test.rb
|
389
392
|
- test/sass/source_map_test.rb
|