sassc 2.1.0.pre1-x86-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.gitmodules +3 -0
- data/.travis.yml +11 -0
- data/CHANGELOG.md +66 -0
- data/CODE_OF_CONDUCT.md +10 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +22 -0
- data/README.md +68 -0
- data/Rakefile +30 -0
- data/lib/sassc.rb +57 -0
- data/lib/sassc/dependency.rb +17 -0
- data/lib/sassc/engine.rb +139 -0
- data/lib/sassc/error.rb +37 -0
- data/lib/sassc/functions_handler.rb +75 -0
- data/lib/sassc/import_handler.rb +50 -0
- data/lib/sassc/importer.rb +31 -0
- data/lib/sassc/native.rb +70 -0
- data/lib/sassc/native/lib_c.rb +21 -0
- data/lib/sassc/native/native_context_api.rb +147 -0
- data/lib/sassc/native/native_functions_api.rb +164 -0
- data/lib/sassc/native/sass2scss_api.rb +10 -0
- data/lib/sassc/native/sass_input_style.rb +13 -0
- data/lib/sassc/native/sass_output_style.rb +12 -0
- data/lib/sassc/native/sass_value.rb +97 -0
- data/lib/sassc/native/string_list.rb +10 -0
- data/lib/sassc/sass_2_scss.rb +9 -0
- data/lib/sassc/script.rb +19 -0
- data/lib/sassc/script/functions.rb +8 -0
- data/lib/sassc/script/value.rb +137 -0
- data/lib/sassc/script/value/bool.rb +32 -0
- data/lib/sassc/script/value/color.rb +95 -0
- data/lib/sassc/script/value/list.rb +136 -0
- data/lib/sassc/script/value/map.rb +69 -0
- data/lib/sassc/script/value/number.rb +389 -0
- data/lib/sassc/script/value/string.rb +96 -0
- data/lib/sassc/script/value_conversion.rb +69 -0
- data/lib/sassc/script/value_conversion/base.rb +13 -0
- data/lib/sassc/script/value_conversion/bool.rb +13 -0
- data/lib/sassc/script/value_conversion/color.rb +18 -0
- data/lib/sassc/script/value_conversion/list.rb +25 -0
- data/lib/sassc/script/value_conversion/map.rb +21 -0
- data/lib/sassc/script/value_conversion/number.rb +13 -0
- data/lib/sassc/script/value_conversion/string.rb +17 -0
- data/lib/sassc/util.rb +231 -0
- data/lib/sassc/util/normalized_map.rb +117 -0
- data/lib/sassc/version.rb +5 -0
- data/sassc.gemspec +57 -0
- data/test/custom_importer_test.rb +127 -0
- data/test/engine_test.rb +314 -0
- data/test/error_test.rb +29 -0
- data/test/fixtures/paths.scss +10 -0
- data/test/functions_test.rb +303 -0
- data/test/native_test.rb +213 -0
- data/test/output_style_test.rb +107 -0
- data/test/sass_2_scss_test.rb +14 -0
- data/test/test_helper.rb +45 -0
- metadata +242 -0
@@ -0,0 +1,107 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "test_helper"
|
4
|
+
|
5
|
+
module SassC
|
6
|
+
class OutputStyleTest < MiniTest::Test
|
7
|
+
def input_scss
|
8
|
+
input_scss = <<-CSS
|
9
|
+
$color: #fff;
|
10
|
+
|
11
|
+
#main {
|
12
|
+
color: $color;
|
13
|
+
background-color: #000;
|
14
|
+
p {
|
15
|
+
width: 10em;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
.huge {
|
20
|
+
font-size: 10em;
|
21
|
+
font-weight: bold;
|
22
|
+
text-decoration: underline;
|
23
|
+
}
|
24
|
+
CSS
|
25
|
+
end
|
26
|
+
|
27
|
+
def expected_nested_output
|
28
|
+
<<-CSS
|
29
|
+
#main {
|
30
|
+
color: #fff;
|
31
|
+
background-color: #000; }
|
32
|
+
#main p {
|
33
|
+
width: 10em; }
|
34
|
+
|
35
|
+
.huge {
|
36
|
+
font-size: 10em;
|
37
|
+
font-weight: bold;
|
38
|
+
text-decoration: underline; }
|
39
|
+
CSS
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_nested_output_is_default
|
43
|
+
engine = Engine.new(input_scss)
|
44
|
+
assert_equal expected_nested_output, engine.render
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_output_style_accepts_strings
|
48
|
+
engine = Engine.new(input_scss, style: 'sass_style_nested')
|
49
|
+
assert_equal expected_nested_output, engine.render
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_invalid_output_style
|
53
|
+
engine = Engine.new(input_scss, style: 'totally_wrong')
|
54
|
+
assert_raises(InvalidStyleError) { engine.render }
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_nested_output
|
58
|
+
engine = Engine.new(input_scss, style: :sass_style_nested)
|
59
|
+
assert_equal expected_nested_output, engine.render
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_expanded_output
|
63
|
+
engine = Engine.new(input_scss, style: :sass_style_expanded)
|
64
|
+
assert_equal <<-CSS, engine.render
|
65
|
+
#main {
|
66
|
+
color: #fff;
|
67
|
+
background-color: #000;
|
68
|
+
}
|
69
|
+
|
70
|
+
#main p {
|
71
|
+
width: 10em;
|
72
|
+
}
|
73
|
+
|
74
|
+
.huge {
|
75
|
+
font-size: 10em;
|
76
|
+
font-weight: bold;
|
77
|
+
text-decoration: underline;
|
78
|
+
}
|
79
|
+
CSS
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_compact_output
|
83
|
+
engine = Engine.new(input_scss, style: :sass_style_compact)
|
84
|
+
assert_equal <<-CSS, engine.render
|
85
|
+
#main { color: #fff; background-color: #000; }
|
86
|
+
|
87
|
+
#main p { width: 10em; }
|
88
|
+
|
89
|
+
.huge { font-size: 10em; font-weight: bold; text-decoration: underline; }
|
90
|
+
CSS
|
91
|
+
end
|
92
|
+
|
93
|
+
def test_compressed_output
|
94
|
+
engine = Engine.new(input_scss, style: :sass_style_compressed)
|
95
|
+
assert_equal <<-CSS, engine.render
|
96
|
+
#main{color:#fff;background-color:#000}#main p{width:10em}.huge{font-size:10em;font-weight:bold;text-decoration:underline}
|
97
|
+
CSS
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_short_output_style_names
|
101
|
+
engine = Engine.new(input_scss, style: :compressed)
|
102
|
+
assert_equal <<-CSS, engine.render
|
103
|
+
#main{color:#fff;background-color:#000}#main p{width:10em}.huge{font-size:10em;font-weight:bold;text-decoration:underline}
|
104
|
+
CSS
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "test_helper"
|
4
|
+
|
5
|
+
module SassC
|
6
|
+
class Sass2ScssTest < MiniTest::Test
|
7
|
+
def test_compact_output
|
8
|
+
assert_equal ".blat { color: red; }", Sass2Scss.convert(<<SASS)
|
9
|
+
.blat
|
10
|
+
color: red
|
11
|
+
SASS
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "minitest/autorun"
|
4
|
+
require "minitest/pride"
|
5
|
+
require "minitest/around/unit"
|
6
|
+
require "test_construct"
|
7
|
+
require "pry"
|
8
|
+
|
9
|
+
require "sassc"
|
10
|
+
|
11
|
+
module FixtureHelper
|
12
|
+
FIXTURE_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "fixtures"))
|
13
|
+
|
14
|
+
def fixture(path)
|
15
|
+
IO.read(fixture_path(path))
|
16
|
+
end
|
17
|
+
|
18
|
+
def fixture_path(path)
|
19
|
+
if path.match(FIXTURE_ROOT)
|
20
|
+
path
|
21
|
+
else
|
22
|
+
File.join(FIXTURE_ROOT, path)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
module TempFileTest
|
28
|
+
include TestConstruct::Helpers
|
29
|
+
|
30
|
+
def around
|
31
|
+
within_construct do |construct|
|
32
|
+
@construct = construct
|
33
|
+
yield
|
34
|
+
end
|
35
|
+
@construct = nil
|
36
|
+
end
|
37
|
+
|
38
|
+
def temp_file(filename, contents)
|
39
|
+
@construct.file(filename, contents)
|
40
|
+
end
|
41
|
+
|
42
|
+
def temp_dir(directory)
|
43
|
+
@construct.directory(directory)
|
44
|
+
end
|
45
|
+
end
|
metadata
ADDED
@@ -0,0 +1,242 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sassc
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.1.0.pre1
|
5
|
+
platform: x86-linux
|
6
|
+
authors:
|
7
|
+
- Ryan Boland
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-05-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: minitest
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.5.1
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.5.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest-around
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: test_construct
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
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'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake-compiler
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake-compiler-dock
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: ffi
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '1.9'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '1.9'
|
139
|
+
description: Use libsass with Ruby!
|
140
|
+
email:
|
141
|
+
- ryan@tanookilabs.com
|
142
|
+
executables: []
|
143
|
+
extensions: []
|
144
|
+
extra_rdoc_files: []
|
145
|
+
files:
|
146
|
+
- ".gitignore"
|
147
|
+
- ".gitmodules"
|
148
|
+
- ".travis.yml"
|
149
|
+
- CHANGELOG.md
|
150
|
+
- CODE_OF_CONDUCT.md
|
151
|
+
- Gemfile
|
152
|
+
- LICENSE.txt
|
153
|
+
- README.md
|
154
|
+
- Rakefile
|
155
|
+
- lib/sassc.rb
|
156
|
+
- lib/sassc/2.3/libsass.so
|
157
|
+
- lib/sassc/2.4/libsass.so
|
158
|
+
- lib/sassc/2.5/libsass.so
|
159
|
+
- lib/sassc/2.6/libsass.so
|
160
|
+
- lib/sassc/dependency.rb
|
161
|
+
- lib/sassc/engine.rb
|
162
|
+
- lib/sassc/error.rb
|
163
|
+
- lib/sassc/functions_handler.rb
|
164
|
+
- lib/sassc/import_handler.rb
|
165
|
+
- lib/sassc/importer.rb
|
166
|
+
- lib/sassc/native.rb
|
167
|
+
- lib/sassc/native/lib_c.rb
|
168
|
+
- lib/sassc/native/native_context_api.rb
|
169
|
+
- lib/sassc/native/native_functions_api.rb
|
170
|
+
- lib/sassc/native/sass2scss_api.rb
|
171
|
+
- lib/sassc/native/sass_input_style.rb
|
172
|
+
- lib/sassc/native/sass_output_style.rb
|
173
|
+
- lib/sassc/native/sass_value.rb
|
174
|
+
- lib/sassc/native/string_list.rb
|
175
|
+
- lib/sassc/sass_2_scss.rb
|
176
|
+
- lib/sassc/script.rb
|
177
|
+
- lib/sassc/script/functions.rb
|
178
|
+
- lib/sassc/script/value.rb
|
179
|
+
- lib/sassc/script/value/bool.rb
|
180
|
+
- lib/sassc/script/value/color.rb
|
181
|
+
- lib/sassc/script/value/list.rb
|
182
|
+
- lib/sassc/script/value/map.rb
|
183
|
+
- lib/sassc/script/value/number.rb
|
184
|
+
- lib/sassc/script/value/string.rb
|
185
|
+
- lib/sassc/script/value_conversion.rb
|
186
|
+
- lib/sassc/script/value_conversion/base.rb
|
187
|
+
- lib/sassc/script/value_conversion/bool.rb
|
188
|
+
- lib/sassc/script/value_conversion/color.rb
|
189
|
+
- lib/sassc/script/value_conversion/list.rb
|
190
|
+
- lib/sassc/script/value_conversion/map.rb
|
191
|
+
- lib/sassc/script/value_conversion/number.rb
|
192
|
+
- lib/sassc/script/value_conversion/string.rb
|
193
|
+
- lib/sassc/util.rb
|
194
|
+
- lib/sassc/util/normalized_map.rb
|
195
|
+
- lib/sassc/version.rb
|
196
|
+
- sassc.gemspec
|
197
|
+
- test/custom_importer_test.rb
|
198
|
+
- test/engine_test.rb
|
199
|
+
- test/error_test.rb
|
200
|
+
- test/fixtures/paths.scss
|
201
|
+
- test/functions_test.rb
|
202
|
+
- test/native_test.rb
|
203
|
+
- test/output_style_test.rb
|
204
|
+
- test/sass_2_scss_test.rb
|
205
|
+
- test/test_helper.rb
|
206
|
+
homepage: https://github.com/sass/sassc-ruby
|
207
|
+
licenses:
|
208
|
+
- MIT
|
209
|
+
metadata: {}
|
210
|
+
post_install_message:
|
211
|
+
rdoc_options: []
|
212
|
+
require_paths:
|
213
|
+
- lib
|
214
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
215
|
+
requirements:
|
216
|
+
- - ">="
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: '2.3'
|
219
|
+
- - "<"
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: 2.7.dev
|
222
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
223
|
+
requirements:
|
224
|
+
- - ">"
|
225
|
+
- !ruby/object:Gem::Version
|
226
|
+
version: 1.3.1
|
227
|
+
requirements: []
|
228
|
+
rubyforge_project:
|
229
|
+
rubygems_version: 2.7.9
|
230
|
+
signing_key:
|
231
|
+
specification_version: 4
|
232
|
+
summary: Use libsass with Ruby!
|
233
|
+
test_files:
|
234
|
+
- test/custom_importer_test.rb
|
235
|
+
- test/engine_test.rb
|
236
|
+
- test/error_test.rb
|
237
|
+
- test/fixtures/paths.scss
|
238
|
+
- test/functions_test.rb
|
239
|
+
- test/native_test.rb
|
240
|
+
- test/output_style_test.rb
|
241
|
+
- test/sass_2_scss_test.rb
|
242
|
+
- test/test_helper.rb
|