crass 1.0.4 → 1.0.5

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +8 -5
  3. data/HISTORY.md +8 -0
  4. data/crass.gemspec +1 -2
  5. data/lib/crass/version.rb +1 -1
  6. metadata +4 -65
  7. data/test/css-parsing-tests/An+B.json +0 -156
  8. data/test/css-parsing-tests/LICENSE +0 -8
  9. data/test/css-parsing-tests/README.rst +0 -301
  10. data/test/css-parsing-tests/color3.json +0 -142
  11. data/test/css-parsing-tests/color3_hsl.json +0 -3890
  12. data/test/css-parsing-tests/color3_keywords.json +0 -803
  13. data/test/css-parsing-tests/component_value_list.json +0 -432
  14. data/test/css-parsing-tests/declaration_list.json +0 -44
  15. data/test/css-parsing-tests/make_color3_hsl.py +0 -17
  16. data/test/css-parsing-tests/make_color3_keywords.py +0 -191
  17. data/test/css-parsing-tests/one_component_value.json +0 -27
  18. data/test/css-parsing-tests/one_declaration.json +0 -46
  19. data/test/css-parsing-tests/one_rule.json +0 -36
  20. data/test/css-parsing-tests/rule_list.json +0 -48
  21. data/test/css-parsing-tests/stylesheet.json +0 -44
  22. data/test/css-parsing-tests/stylesheet_bytes.json +0 -146
  23. data/test/shared/parse_rules.rb +0 -463
  24. data/test/support/common.rb +0 -170
  25. data/test/support/serialization/animate.css +0 -3158
  26. data/test/support/serialization/bootstrap-theme.css +0 -384
  27. data/test/support/serialization/bootstrap.css +0 -6805
  28. data/test/support/serialization/html5-boilerplate.css +0 -268
  29. data/test/support/serialization/misc.css +0 -9
  30. data/test/support/serialization/pure.css +0 -1662
  31. data/test/test_crass.rb +0 -31
  32. data/test/test_css_parsing_tests.rb +0 -150
  33. data/test/test_parse_properties.rb +0 -310
  34. data/test/test_parse_rules.rb +0 -17
  35. data/test/test_parse_stylesheet.rb +0 -17
  36. data/test/test_serialization.rb +0 -71
@@ -1,17 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require_relative 'support/common'
4
- require_relative 'shared/parse_rules'
5
-
6
- describe 'Crass::Parser' do
7
- make_my_diffs_pretty!
8
- parallelize_me!
9
-
10
- describe '#parse_rules' do
11
- def parse(*args)
12
- CP.parse_rules(*args)
13
- end
14
-
15
- behaves_like 'parsing a list of rules'
16
- end
17
- end
@@ -1,17 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require_relative 'support/common'
4
- require_relative 'shared/parse_rules'
5
-
6
- describe 'Crass::Parser' do
7
- make_my_diffs_pretty!
8
- parallelize_me!
9
-
10
- describe '#parse_stylesheet' do
11
- def parse(*args)
12
- CP.parse_stylesheet(*args)
13
- end
14
-
15
- behaves_like 'parsing a list of rules'
16
- end
17
- end
@@ -1,71 +0,0 @@
1
- # encoding: utf-8
2
- require_relative 'support/common'
3
-
4
- describe 'Serialization' do
5
- make_my_diffs_pretty!
6
- parallelize_me!
7
-
8
- # Parse a bunch of real-world CSS and make sure it's the same when we
9
- # serialize it.
10
- Dir[File.join(File.dirname(__FILE__), 'support/serialization/*.css')].each do |filepath|
11
- it "should parse and serialize #{filepath}" do
12
- input = File.read(filepath)
13
-
14
- tree = Crass.parse(input,
15
- :preserve_comments => true,
16
- :preserve_hacks => true)
17
-
18
- assert_equal(input, CP.stringify(tree))
19
- end
20
- end
21
-
22
- # -- Regression tests --------------------------------------------------------
23
- it "should not omit a trailing semicolon when serializing a `@charset` rule" do
24
- css = '@charset "utf-8";'
25
- tree = Crass.parse(css)
26
-
27
- assert_equal(css, CP.stringify(tree))
28
- end
29
-
30
- it "should reflect modifications made to the block of an `:at_rule`" do
31
- tree = Crass.parse(%[
32
- @media (screen) {
33
- .froggy { color: green; }
34
- .piggy { color: pink; }
35
- }
36
- ].strip)
37
-
38
- tree[0][:block] = Crass::Parser.parse_rules(".piggy { color: pink; }")
39
-
40
- assert_equal(
41
- "@media (screen) {.piggy { color: pink; }}",
42
- Crass::Parser.stringify(tree)
43
- )
44
- end
45
-
46
- it "should serialize a @page rule" do
47
- css = %[
48
- @page { margin: 2cm }
49
-
50
- @page :right {
51
- @top-center { content: "Preliminary edition" }
52
- @bottom-center { content: counter(page) }
53
- }
54
-
55
- @page {
56
- size: 8.5in 11in;
57
- margin: 10%;
58
-
59
- @top-left {
60
- content: "Hamlet";
61
- }
62
- @top-right {
63
- content: "Page " counter(page);
64
- }
65
- }
66
- ].strip
67
-
68
- tree = Crass.parse(css)
69
- assert_equal(css, Crass::Parser.stringify(tree))
70
- end
71
- end