dang 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/Gemfile +2 -0
- data/Gemfile.lock +15 -6
- data/History.md +29 -0
- data/Manifest.txt +24 -3
- data/README.md +5 -5
- data/Rakefile +1 -1
- data/bin/dang +2 -4
- data/dang.gemspec +15 -15
- data/lib/dang/dang.rb +2 -2
- data/lib/dang/parser.kpeg +5 -5
- data/lib/dang/parser.rb +50 -32
- data/spectory/attribute_spec.rb +35 -0
- data/spectory/comment_spec.rb +23 -0
- data/spectory/conditional_comment_spec.rb +56 -0
- data/spectory/data_attribute_spec.rb +11 -0
- data/spectory/doctype_spec.rb +38 -0
- data/spectory/embedded_ruby_spec.rb +33 -0
- data/spectory/file_spec.rb +13 -0
- data/spectory/files/iamshane-com.html +229 -0
- data/spectory/files/iamshane-com.html.dang +231 -0
- data/spectory/filter_spec.rb +27 -0
- data/spectory/helper.rb +5 -0
- data/spectory/sanity_spec.rb +11 -0
- data/spectory/script_spec.rb +32 -0
- data/spectory/selector_spec.rb +26 -0
- data/spectory/style_spec.rb +29 -0
- data/spectory/tag_spec.rb +71 -0
- data/spectory/v2/array_classes_spec.rb +12 -0
- data/spectory/v2/filters/markdown_spec.rb +21 -0
- data/spectory/v2/hash_attribute_spec.rb +20 -0
- data/spectory/v2/interpolation_spec.rb +11 -0
- data/spectory/v2/script_exception_spec.rb +8 -0
- data/spectory/v2/style_exception_spec.rb +8 -0
- data/spectory/well_formedness_spec.rb +15 -0
- data/spectory/whitespace_spec.rb +16 -0
- metadata +48 -30
- data/.autotest +0 -12
- data/.gitignore +0 -9
- data/.travis.yml +0 -9
@@ -0,0 +1,21 @@
|
|
1
|
+
require "spectory/helper"
|
2
|
+
|
3
|
+
# filters
|
4
|
+
# <:markdown
|
5
|
+
# # This is an h1 heading
|
6
|
+
# ## h2
|
7
|
+
# *bold text*
|
8
|
+
# * a
|
9
|
+
# * of
|
10
|
+
# * items
|
11
|
+
# markdown:>
|
12
|
+
|
13
|
+
# describe "filters" do
|
14
|
+
# it "farms out to raw a markdown filter" do
|
15
|
+
# Dang.it("<:markdown # an h1 markdown:>").must_equal "<h1>an h1</h1>")
|
16
|
+
# end
|
17
|
+
#
|
18
|
+
# it "farms out to 2 markdown filters with Dang in between" do
|
19
|
+
# Dang.it("<:markdown # h1 markdown:> <h2 this is<:markdown **bold text** markdown:> inside an h2>".must_equal "<h1>h1</h1> <h2>this is <b>bold text</b> inside an h2</h2>")
|
20
|
+
# end
|
21
|
+
# end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "spectory/helper"
|
2
|
+
|
3
|
+
# TODO experimental
|
4
|
+
# for v2
|
5
|
+
|
6
|
+
# describe "hash attributes" do
|
7
|
+
# it "should have a shorthand for a hash as attributes" do
|
8
|
+
# # HAML like shorthand for a hash of attributes
|
9
|
+
# # Ideas
|
10
|
+
#
|
11
|
+
# # <body[foo=bar]{attrs, attrs}
|
12
|
+
# # <body[foo=#{bar}]{attrs, attrs}
|
13
|
+
# # <body{ hidden }
|
14
|
+
# # <body#id.class.class2{ attrs }
|
15
|
+
# # <body#id.class.class2<= attrs =>
|
16
|
+
#
|
17
|
+
# # TODO experimental
|
18
|
+
#
|
19
|
+
# end
|
20
|
+
# end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require "spectory/helper"
|
2
|
+
|
3
|
+
# TODO experimental
|
4
|
+
# for v2
|
5
|
+
|
6
|
+
# describe "interpolation" do
|
7
|
+
# it "should allow ruby interpolation in ids"
|
8
|
+
# it "should allow ruby interpolation in classes"
|
9
|
+
# it "should allow ruby interpolation in attributes"
|
10
|
+
# it "should allow ruby interpolation in values"
|
11
|
+
# end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
require "spectory/helper"
|
2
|
+
|
3
|
+
# describe "script tags" do
|
4
|
+
# it "skips js that looks like a closing dang tag" do
|
5
|
+
# Dang.it("<script alert(' script>') script>").must_equal "<script>alert(' script>')</script>"
|
6
|
+
# Dang.it('<script alert(" script>") script>').must_equal '<script>alert(" script>")</script>'
|
7
|
+
# end
|
8
|
+
# end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
require "spectory/helper"
|
2
|
+
|
3
|
+
# describe "style tags" do
|
4
|
+
# it "skips css that looks like a closing dang tag" do
|
5
|
+
# Dang.it("<style abbr:after { content: ' style>' } style>").must_equal "<style>abbr:after { content: ' style>' } </style>"
|
6
|
+
# Dang.it('<style abbr:after { content: " style>" } style>').must_equal '<style>abbr:after { content: " style>" } </style>'
|
7
|
+
# end
|
8
|
+
# end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "spectory/helper"
|
2
|
+
|
3
|
+
# TODO experimental
|
4
|
+
|
5
|
+
# describe "well formedness" do
|
6
|
+
# it "should throw a warning when a closer is missing" do
|
7
|
+
# Dang.it("<div <p lorem div>").must_equal "<div><p>lorem</div>"
|
8
|
+
# Dang.it("<div <p lorem div>").errors.must_equal "Missing Closer: </p>"
|
9
|
+
# end
|
10
|
+
#
|
11
|
+
# it "should throw a warning when a closer is mismatched" do
|
12
|
+
# Dang.it("<div <p lorem a> div>").must_equal "<div><p>lorem</a></div>"
|
13
|
+
# Dang.it("<div <p lorem a> div>").errors.must_equal "Mismatched Closer: Got </a>. Expected </p>"
|
14
|
+
# end
|
15
|
+
# end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require "spectory/helper"
|
2
|
+
|
3
|
+
# something like HAML's aligator operator
|
4
|
+
# http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#whitespace_removal__and_
|
5
|
+
|
6
|
+
# TODO experimental
|
7
|
+
|
8
|
+
# describe "whitespace" do
|
9
|
+
# describe "ignoring" do
|
10
|
+
# it "should ignore whitespace"
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
# describe "preservation" do
|
14
|
+
# it "should preverse whitespace"
|
15
|
+
# end
|
16
|
+
# end
|
metadata
CHANGED
@@ -1,48 +1,47 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Becker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
prerelease: false
|
15
14
|
name: rdoc
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
16
|
requirements:
|
18
|
-
- - ~>
|
17
|
+
- - "~>"
|
19
18
|
- !ruby/object:Gem::Version
|
20
19
|
version: '4.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
21
22
|
version_requirements: !ruby/object:Gem::Requirement
|
22
23
|
requirements:
|
23
|
-
- - ~>
|
24
|
+
- - "~>"
|
24
25
|
- !ruby/object:Gem::Version
|
25
26
|
version: '4.0'
|
26
|
-
type: :development
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
prerelease: false
|
29
28
|
name: hoe
|
30
29
|
requirement: !ruby/object:Gem::Requirement
|
31
30
|
requirements:
|
32
|
-
- - ~>
|
31
|
+
- - "~>"
|
33
32
|
- !ruby/object:Gem::Version
|
34
|
-
version: '3.
|
33
|
+
version: '3.13'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
35
36
|
version_requirements: !ruby/object:Gem::Requirement
|
36
37
|
requirements:
|
37
|
-
- - ~>
|
38
|
+
- - "~>"
|
38
39
|
- !ruby/object:Gem::Version
|
39
|
-
version: '3.
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
version: '3.13'
|
41
|
+
description: |-
|
42
|
+
Dang is a Ruby templating language.
|
43
43
|
It uses angle brackets and CSS syntax.
|
44
|
-
|
45
|
-
Somewhere between ERB and Haml.'
|
44
|
+
Somewhere between ERB and Haml.
|
46
45
|
email:
|
47
46
|
- veganstraightedge@gmail.com
|
48
47
|
executables:
|
@@ -54,10 +53,7 @@ extra_rdoc_files:
|
|
54
53
|
- README.md
|
55
54
|
- TODO.md
|
56
55
|
files:
|
57
|
-
- .
|
58
|
-
- .gitignore
|
59
|
-
- .hoeignore
|
60
|
-
- .travis.yml
|
56
|
+
- ".hoeignore"
|
61
57
|
- Gemfile
|
62
58
|
- Gemfile.lock
|
63
59
|
- History.md
|
@@ -72,6 +68,30 @@ files:
|
|
72
68
|
- lib/dang/parser.kpeg
|
73
69
|
- lib/dang/parser.rb
|
74
70
|
- lib/dang/rails.rb
|
71
|
+
- spectory/attribute_spec.rb
|
72
|
+
- spectory/comment_spec.rb
|
73
|
+
- spectory/conditional_comment_spec.rb
|
74
|
+
- spectory/data_attribute_spec.rb
|
75
|
+
- spectory/doctype_spec.rb
|
76
|
+
- spectory/embedded_ruby_spec.rb
|
77
|
+
- spectory/file_spec.rb
|
78
|
+
- spectory/files/iamshane-com.html
|
79
|
+
- spectory/files/iamshane-com.html.dang
|
80
|
+
- spectory/filter_spec.rb
|
81
|
+
- spectory/helper.rb
|
82
|
+
- spectory/sanity_spec.rb
|
83
|
+
- spectory/script_spec.rb
|
84
|
+
- spectory/selector_spec.rb
|
85
|
+
- spectory/style_spec.rb
|
86
|
+
- spectory/tag_spec.rb
|
87
|
+
- spectory/v2/array_classes_spec.rb
|
88
|
+
- spectory/v2/filters/markdown_spec.rb
|
89
|
+
- spectory/v2/hash_attribute_spec.rb
|
90
|
+
- spectory/v2/interpolation_spec.rb
|
91
|
+
- spectory/v2/script_exception_spec.rb
|
92
|
+
- spectory/v2/style_exception_spec.rb
|
93
|
+
- spectory/well_formedness_spec.rb
|
94
|
+
- spectory/whitespace_spec.rb
|
75
95
|
homepage: https://github.com/veganstraightedge/dang
|
76
96
|
licenses:
|
77
97
|
- PUBLIC DOMAIN
|
@@ -79,26 +99,24 @@ licenses:
|
|
79
99
|
metadata: {}
|
80
100
|
post_install_message:
|
81
101
|
rdoc_options:
|
82
|
-
- --main
|
102
|
+
- "--main"
|
83
103
|
- README.md
|
84
104
|
require_paths:
|
85
105
|
- lib
|
86
106
|
required_ruby_version: !ruby/object:Gem::Requirement
|
87
107
|
requirements:
|
88
|
-
- -
|
108
|
+
- - ">="
|
89
109
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
91
|
-
MA==
|
110
|
+
version: '0'
|
92
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
112
|
requirements:
|
94
|
-
- -
|
113
|
+
- - ">="
|
95
114
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
97
|
-
MA==
|
115
|
+
version: '0'
|
98
116
|
requirements: []
|
99
|
-
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
117
|
+
rubyforge_project:
|
118
|
+
rubygems_version: 2.2.2
|
101
119
|
signing_key:
|
102
120
|
specification_version: 4
|
103
|
-
summary: Dang is a Ruby templating language
|
121
|
+
summary: Dang is a Ruby templating language
|
104
122
|
test_files: []
|
data/.autotest
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# require 'autotest/restart'
|
2
|
-
#
|
3
|
-
# Autotest.add_hook :initialize do |at|
|
4
|
-
# at.clear_mappings
|
5
|
-
#
|
6
|
-
# at.add_mapping %r%/^lib/(.*)\.rb$% do |_, m|
|
7
|
-
# possible = File.basename(m[1])
|
8
|
-
# files_matching %r%^test/.*test_#{possible}\.rb$%
|
9
|
-
# end
|
10
|
-
#
|
11
|
-
# at.add_mapping(%r%^test/.*\.rb$%) {|filename, _| filename }
|
12
|
-
# end
|
data/.gitignore
DELETED