html-pipeline 0.0.13 → 0.0.14
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.
- data/CHANGELOG.md +4 -0
- data/lib/html/pipeline/filter.rb +6 -18
- data/lib/html/pipeline/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/lib/html/pipeline/filter.rb
CHANGED
@@ -41,7 +41,7 @@ module HTML
|
|
41
41
|
@result = result || {}
|
42
42
|
validate
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
# Public: Returns a simple Hash used to pass extra information into filters
|
46
46
|
# and also to allow filters to make extracted information available to the
|
47
47
|
# caller.
|
@@ -74,7 +74,7 @@ module HTML
|
|
74
74
|
def call
|
75
75
|
raise NotImplementedError
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
78
|
# Make sure the context has everything we need. Noop: Subclasses can override.
|
79
79
|
def validate
|
80
80
|
end
|
@@ -94,18 +94,6 @@ module HTML
|
|
94
94
|
context[:current_user]
|
95
95
|
end
|
96
96
|
|
97
|
-
# Return whether the filter can access a given repo while
|
98
|
-
# applying a filter
|
99
|
-
#
|
100
|
-
# A repo can only be accessed if its pullable by the user who
|
101
|
-
# submitted the content of this filter, or if it's the same as
|
102
|
-
# the repository context in which the filter runs
|
103
|
-
def can_access_repo?(repo)
|
104
|
-
return false if repo.nil?
|
105
|
-
return true if repo == repository
|
106
|
-
repo.pullable_by?(current_user)
|
107
|
-
end
|
108
|
-
|
109
97
|
# The site's base URL provided in the context hash, or '/' when no
|
110
98
|
# base URL was specified.
|
111
99
|
def base_url
|
@@ -158,10 +146,10 @@ module HTML
|
|
158
146
|
output.to_s
|
159
147
|
end
|
160
148
|
end
|
161
|
-
|
162
|
-
# Validator for required context. This will check that anything passed in
|
149
|
+
|
150
|
+
# Validator for required context. This will check that anything passed in
|
163
151
|
# contexts exists in @contexts
|
164
|
-
#
|
152
|
+
#
|
165
153
|
# If any errors are found an ArgumentError will be raised with a
|
166
154
|
# message listing all the missing contexts and the filters that
|
167
155
|
# require them.
|
@@ -175,4 +163,4 @@ module HTML
|
|
175
163
|
end
|
176
164
|
end
|
177
165
|
end
|
178
|
-
end
|
166
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html-pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-05-
|
13
|
+
date: 2013-05-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: gemoji
|