html-pipeline-gitlab 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +3 -0
- data/html-pipeline-gitlab.gemspec +1 -0
- data/lib/html/pipeline/gitlab.rb +7 -4
- data/lib/html/pipeline/gitlab/version.rb +1 -1
- data/test/html/pipeline/gitlab_gemoji_filter_test.rb +5 -5
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7a7dd1ca2a6beda55cabf4a77b28ff0e53e9be1
|
4
|
+
data.tar.gz: 02a41c9b95cb8904b6d8cccfdc5612e91a701173
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6adebd58657357f20b7d9ae229aba43f6de7dbd0144188c3c82332100ea86eea55bf69b8212cf4ad155c1678eaad21e2cd403f0cde1dcf0bb262fa0c15c36273
|
7
|
+
data.tar.gz: ef0b0ce4974d20960646199cb9729f078ded31e2d1c0bab54baacf7f443364a420ec7321fb6209d1bb0578a0e90c04dae32ccc3b334ee7c238563732bb73d089
|
data/CHANGELOG
CHANGED
data/lib/html/pipeline/gitlab.rb
CHANGED
@@ -1,16 +1,19 @@
|
|
1
1
|
require 'html/pipeline'
|
2
2
|
require 'html/pipeline/gitlab/version'
|
3
|
-
require 'html/pipeline/gitlab/gitlab_emoji_filter'
|
4
3
|
|
5
4
|
module HTML
|
6
5
|
class Pipeline
|
7
|
-
class
|
6
|
+
class GitLab
|
8
7
|
# GitLab related filters for html-pipeline. Implements new filters used
|
9
8
|
# by GitLab.
|
10
9
|
|
11
|
-
#
|
10
|
+
# Custom filter implementations
|
11
|
+
autoload :GitLabEmojiFilter, 'html/pipeline/gitlab/gitlab_emoji_filter'
|
12
|
+
|
13
|
+
# Most used markdown pipeline in GitLab. Performs emoji replacement.
|
12
14
|
MarkdownPipeline = HTML::Pipeline.new [
|
13
|
-
|
15
|
+
SanitizationFilter,
|
16
|
+
GitLabEmojiFilter
|
14
17
|
]
|
15
18
|
end
|
16
19
|
end
|
@@ -3,7 +3,7 @@ require 'html/pipeline/gitlab'
|
|
3
3
|
|
4
4
|
class HTML::Pipeline::GitLabEmojiFilterTest < Minitest::Test
|
5
5
|
GitLabEmojiFilter = HTML::Pipeline::GitLab::GitLabEmojiFilter
|
6
|
-
|
6
|
+
|
7
7
|
def test_emojify
|
8
8
|
filter = GitLabEmojiFilter.new('<p>:heart:</p>', {asset_root: 'https://foo.com'})
|
9
9
|
doc = filter.call
|
@@ -16,16 +16,16 @@ class HTML::Pipeline::GitLabEmojiFilterTest < Minitest::Test
|
|
16
16
|
doc = filter.call
|
17
17
|
assert_match block, doc.to_html
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
def test_uri_encoding
|
21
21
|
filter = GitLabEmojiFilter.new('<p>:+1:</p>', {asset_root: 'https://foo.com'})
|
22
22
|
doc = filter.call
|
23
23
|
assert_match 'https://foo.com/emoji/%2B1.png', doc.search('img').attr('src').value
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def test_required_context_validation
|
27
|
-
exception = assert_raises(ArgumentError) {
|
28
|
-
GitLabEmojiFilter.call("", {})
|
27
|
+
exception = assert_raises(ArgumentError) {
|
28
|
+
GitLabEmojiFilter.call("", {})
|
29
29
|
}
|
30
30
|
assert_match /:asset_root/, exception.message
|
31
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html-pipeline-gitlab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Schilling
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.0.1.1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sanitize
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 3.0.2
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 3.0.2
|
69
83
|
description: Extension filters for html-pipeline used by GitLab
|
70
84
|
email:
|
71
85
|
- schilling.ro@gmail.com
|