azebiki 0.0.6 → 0.0.7
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/lib/azebiki/azebiki.rb +14 -1
- data/lib/azebiki/version.rb +1 -1
- metadata +1 -1
data/lib/azebiki/azebiki.rb
CHANGED
@@ -70,6 +70,7 @@ module Azebiki
|
|
70
70
|
|
71
71
|
@options.each do |key, value|
|
72
72
|
next if key == :failure_message
|
73
|
+
next if key == :not
|
73
74
|
next if key == :content unless @expected == "meta"
|
74
75
|
next if key == :count
|
75
76
|
if value.is_a?(Hash)
|
@@ -95,11 +96,17 @@ module Azebiki
|
|
95
96
|
@block ||= block
|
96
97
|
matched = matches(stringlike)
|
97
98
|
|
98
|
-
if @options[:count]
|
99
|
+
result = if @options[:count]
|
99
100
|
matched.size == @options[:count] && (!@block || @block.call(matched))
|
100
101
|
else
|
101
102
|
matched.any? && (!@block || @block.call(matched))
|
102
103
|
end
|
104
|
+
|
105
|
+
if @options[:not]
|
106
|
+
!result
|
107
|
+
else
|
108
|
+
result
|
109
|
+
end
|
103
110
|
end
|
104
111
|
|
105
112
|
|
@@ -202,6 +209,12 @@ module Azebiki
|
|
202
209
|
|
203
210
|
def tag.failure_message(text)
|
204
211
|
self[:failure_message] = text
|
212
|
+
self
|
213
|
+
end
|
214
|
+
|
215
|
+
def tag.!
|
216
|
+
self[:not] = true
|
217
|
+
self
|
205
218
|
end
|
206
219
|
|
207
220
|
return tag
|
data/lib/azebiki/version.rb
CHANGED