sassc 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/ext/libsass/.gitignore +6 -0
  4. data/ext/libsass/.travis.yml +5 -1
  5. data/ext/libsass/Makefile +12 -3
  6. data/ext/libsass/Makefile.am +16 -28
  7. data/ext/libsass/Readme.md +1 -0
  8. data/ext/libsass/appveyor.yml +1 -2
  9. data/ext/libsass/ast.cpp +9 -0
  10. data/ext/libsass/ast.hpp +152 -55
  11. data/ext/libsass/ast_factory.hpp +2 -0
  12. data/ext/libsass/ast_fwd_decl.hpp +1 -0
  13. data/ext/libsass/backtrace.hpp +2 -2
  14. data/ext/libsass/bind.cpp +15 -13
  15. data/ext/libsass/configure.ac +17 -5
  16. data/ext/libsass/constants.cpp +22 -2
  17. data/ext/libsass/constants.hpp +21 -2
  18. data/ext/libsass/context.cpp +79 -57
  19. data/ext/libsass/context.hpp +23 -9
  20. data/ext/libsass/contextualize.cpp +2 -28
  21. data/ext/libsass/contextualize.hpp +6 -10
  22. data/ext/libsass/contextualize_eval.cpp +93 -0
  23. data/ext/libsass/contextualize_eval.hpp +44 -0
  24. data/ext/libsass/contrib/plugin.cpp +57 -0
  25. data/ext/libsass/cssize.cpp +3 -1
  26. data/ext/libsass/debugger.hpp +242 -83
  27. data/ext/libsass/emitter.cpp +1 -1
  28. data/ext/libsass/emitter.hpp +1 -1
  29. data/ext/libsass/environment.hpp +109 -25
  30. data/ext/libsass/error_handling.cpp +3 -3
  31. data/ext/libsass/error_handling.hpp +0 -1
  32. data/ext/libsass/eval.cpp +145 -61
  33. data/ext/libsass/eval.hpp +9 -1
  34. data/ext/libsass/expand.cpp +134 -60
  35. data/ext/libsass/expand.hpp +5 -2
  36. data/ext/libsass/extend.cpp +7 -5
  37. data/ext/libsass/file.cpp +176 -123
  38. data/ext/libsass/file.hpp +44 -7
  39. data/ext/libsass/functions.cpp +36 -17
  40. data/ext/libsass/functions.hpp +2 -2
  41. data/ext/libsass/inspect.cpp +23 -14
  42. data/ext/libsass/inspect.hpp +1 -0
  43. data/ext/libsass/json.cpp +132 -135
  44. data/ext/libsass/lexer.cpp +133 -0
  45. data/ext/libsass/lexer.hpp +239 -0
  46. data/ext/libsass/listize.cpp +83 -0
  47. data/ext/libsass/listize.hpp +41 -0
  48. data/ext/libsass/operation.hpp +2 -0
  49. data/ext/libsass/output.cpp +5 -6
  50. data/ext/libsass/parser.cpp +426 -388
  51. data/ext/libsass/parser.hpp +97 -109
  52. data/ext/libsass/plugins.cpp +15 -2
  53. data/ext/libsass/plugins.hpp +6 -4
  54. data/ext/libsass/position.cpp +52 -17
  55. data/ext/libsass/position.hpp +19 -17
  56. data/ext/libsass/prelexer.cpp +202 -235
  57. data/ext/libsass/prelexer.hpp +73 -333
  58. data/ext/libsass/sass.cpp +21 -11
  59. data/ext/libsass/sass.h +6 -6
  60. data/ext/libsass/sass_context.cpp +167 -81
  61. data/ext/libsass/sass_context.h +26 -6
  62. data/ext/libsass/sass_functions.cpp +49 -40
  63. data/ext/libsass/sass_functions.h +55 -43
  64. data/ext/libsass/sass_interface.cpp +9 -8
  65. data/ext/libsass/sass_interface.h +3 -3
  66. data/ext/libsass/sass_version.h +8 -0
  67. data/ext/libsass/sass_version.h.in +8 -0
  68. data/ext/libsass/script/ci-build-libsass +3 -3
  69. data/ext/libsass/script/ci-report-coverage +2 -1
  70. data/ext/libsass/source_map.cpp +2 -2
  71. data/ext/libsass/util.cpp +60 -11
  72. data/ext/libsass/util.hpp +6 -1
  73. data/ext/libsass/win/libsass.filters +12 -0
  74. data/ext/libsass/win/libsass.vcxproj +10 -0
  75. data/lib/sassc.rb +3 -1
  76. data/lib/sassc/cache_stores/base.rb +2 -0
  77. data/lib/sassc/dependency.rb +3 -1
  78. data/lib/sassc/engine.rb +31 -16
  79. data/lib/sassc/error.rb +3 -2
  80. data/lib/sassc/functions_handler.rb +54 -0
  81. data/lib/sassc/import_handler.rb +41 -0
  82. data/lib/sassc/importer.rb +4 -31
  83. data/lib/sassc/native.rb +1 -1
  84. data/lib/sassc/native/native_context_api.rb +3 -2
  85. data/lib/sassc/script.rb +0 -51
  86. data/lib/sassc/version.rb +1 -1
  87. data/sassc.gemspec +1 -0
  88. data/test/custom_importer_test.rb +72 -69
  89. data/test/engine_test.rb +53 -54
  90. data/test/functions_test.rb +40 -39
  91. data/test/native_test.rb +145 -149
  92. data/test/output_style_test.rb +98 -0
  93. data/test/test_helper.rb +21 -7
  94. metadata +28 -2
@@ -0,0 +1,98 @@
1
+ require_relative "test_helper"
2
+
3
+ module SassC
4
+ class OutputStyleTest < MiniTest::Test
5
+ def input_scss
6
+ input_scss = <<-CSS
7
+ $color: #fff;
8
+
9
+ #main {
10
+ color: $color;
11
+ background-color: #000;
12
+ p {
13
+ width: 10em;
14
+ }
15
+ }
16
+
17
+ .huge {
18
+ font-size: 10em;
19
+ font-weight: bold;
20
+ text-decoration: underline;
21
+ }
22
+ CSS
23
+ end
24
+
25
+ def expected_nested_output
26
+ <<-CSS
27
+ #main {
28
+ color: #fff;
29
+ background-color: #000; }
30
+ #main p {
31
+ width: 10em; }
32
+
33
+ .huge {
34
+ font-size: 10em;
35
+ font-weight: bold;
36
+ text-decoration: underline; }
37
+ CSS
38
+ end
39
+
40
+ def test_nested_output_is_default
41
+ engine = Engine.new(input_scss)
42
+ assert_equal expected_nested_output, engine.render
43
+ end
44
+
45
+ def test_output_style_accepts_strings
46
+ engine = Engine.new(input_scss, style: 'sass_style_nested')
47
+ assert_equal expected_nested_output, engine.render
48
+ end
49
+
50
+ def test_invalid_output_style
51
+ engine = Engine.new(input_scss, style: 'totally_wrong')
52
+ assert_raises(InvalidStyleError) { engine.render }
53
+ end
54
+
55
+ def test_nested_output
56
+ engine = Engine.new(input_scss, style: :sass_style_nested)
57
+ assert_equal expected_nested_output, engine.render
58
+ end
59
+
60
+ def test_expanded_output
61
+ engine = Engine.new(input_scss, style: :sass_style_expanded)
62
+ assert_equal <<-CSS, engine.render
63
+ #main {
64
+ color: #fff;
65
+ background-color: #000;
66
+ }
67
+
68
+ #main p {
69
+ width: 10em;
70
+ }
71
+
72
+ .huge {
73
+ font-size: 10em;
74
+ font-weight: bold;
75
+ text-decoration: underline;
76
+ }
77
+ CSS
78
+ end
79
+
80
+ def test_compact_output
81
+ engine = Engine.new(input_scss, style: :sass_style_compact)
82
+ assert_equal <<-CSS, engine.render
83
+ #main { color: #fff; background-color: #000; }
84
+
85
+ #main p { width: 10em; }
86
+
87
+ .huge { font-size: 10em; font-weight: bold; text-decoration: underline; }
88
+ CSS
89
+ end
90
+
91
+ def test_compressed_output
92
+ engine = Engine.new(input_scss, style: :sass_style_compressed)
93
+ assert_equal <<-CSS, engine.render
94
+ #main{color:#fff;background-color:#000}#main p{width:10em}.huge{font-size:10em;font-weight:bold;text-decoration:underline}
95
+ CSS
96
+ end
97
+ end
98
+ end
@@ -2,18 +2,13 @@ require "minitest/autorun"
2
2
  require "minitest/pride"
3
3
  require "minitest/around/unit"
4
4
  require "test_construct"
5
+ require "pry"
5
6
 
6
7
  require "sassc"
7
8
 
8
- class SassCTest < MiniTest::Test
9
- include TestConstruct::Helpers
10
-
9
+ module FixtureHelper
11
10
  FIXTURE_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "fixtures"))
12
11
 
13
- def self.test(name, &block)
14
- define_method("test_#{name.inspect}", &block)
15
- end
16
-
17
12
  def fixture(path)
18
13
  IO.read(fixture_path(path))
19
14
  end
@@ -27,3 +22,22 @@ class SassCTest < MiniTest::Test
27
22
  end
28
23
  end
29
24
 
25
+ module TempFileTest
26
+ include TestConstruct::Helpers
27
+
28
+ def around
29
+ within_construct do |construct|
30
+ @construct = construct
31
+ yield
32
+ end
33
+ @construct = nil
34
+ end
35
+
36
+ def temp_file(filename, contents)
37
+ @construct.file(filename, contents)
38
+ end
39
+
40
+ def temp_dir(directory)
41
+ @construct.directory(directory)
42
+ end
43
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sassc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Boland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-14 00:00:00.000000000 Z
11
+ date: 2015-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: bundler
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -141,7 +155,10 @@ files:
141
155
  - ext/libsass/context.hpp
142
156
  - ext/libsass/contextualize.cpp
143
157
  - ext/libsass/contextualize.hpp
158
+ - ext/libsass/contextualize_eval.cpp
159
+ - ext/libsass/contextualize_eval.hpp
144
160
  - ext/libsass/contrib/libsass.spec
161
+ - ext/libsass/contrib/plugin.cpp
145
162
  - ext/libsass/cssize.cpp
146
163
  - ext/libsass/cssize.hpp
147
164
  - ext/libsass/debug.hpp
@@ -167,6 +184,10 @@ files:
167
184
  - ext/libsass/json.cpp
168
185
  - ext/libsass/json.hpp
169
186
  - ext/libsass/kwd_arg_macros.hpp
187
+ - ext/libsass/lexer.cpp
188
+ - ext/libsass/lexer.hpp
189
+ - ext/libsass/listize.cpp
190
+ - ext/libsass/listize.hpp
170
191
  - ext/libsass/m4/.gitkeep
171
192
  - ext/libsass/mapping.hpp
172
193
  - ext/libsass/memory_manager.hpp
@@ -203,6 +224,8 @@ files:
203
224
  - ext/libsass/sass_util.hpp
204
225
  - ext/libsass/sass_values.cpp
205
226
  - ext/libsass/sass_values.h
227
+ - ext/libsass/sass_version.h
228
+ - ext/libsass/sass_version.h.in
206
229
  - ext/libsass/script/bootstrap
207
230
  - ext/libsass/script/branding
208
231
  - ext/libsass/script/ci-build-libsass
@@ -248,6 +271,7 @@ files:
248
271
  - lib/sassc/dependency.rb
249
272
  - lib/sassc/engine.rb
250
273
  - lib/sassc/error.rb
274
+ - lib/sassc/functions_handler.rb
251
275
  - lib/sassc/import_handler.rb
252
276
  - lib/sassc/importer.rb
253
277
  - lib/sassc/native.rb
@@ -268,6 +292,7 @@ files:
268
292
  - test/fixtures/paths.scss
269
293
  - test/functions_test.rb
270
294
  - test/native_test.rb
295
+ - test/output_style_test.rb
271
296
  - test/test_helper.rb
272
297
  homepage: https://github.com/bolandrm/sassc-ruby
273
298
  licenses:
@@ -300,4 +325,5 @@ test_files:
300
325
  - test/fixtures/paths.scss
301
326
  - test/functions_test.rb
302
327
  - test/native_test.rb
328
+ - test/output_style_test.rb
303
329
  - test/test_helper.rb