hiptest-publisher 0.10.3 → 0.10.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hiptest-publisher/handlebars_helper.rb +1 -0
- data/lib/hiptest-publisher/string.rb +10 -2
- data/lib/templates/gherkin/tag.hbs +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f5b9cfe85d266309d74cbabf61034087acb621f
|
4
|
+
data.tar.gz: 995e88f1b39536e7abb4ee593dc8bf5e09cedc54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50bf0d3d7f6375c69d8df240db246e5cf5b31ded4699d16bafeedd8188f1a3996a637c7ebb4de2dd8523c2784979fd65009557c4e913e41e94a5564c8c220984
|
7
|
+
data.tar.gz: be6710e84171982f8749f1ce6cf0f909ec80bcee4cdd136cd524692473b381638791c0c1aaf350d86bd098b7697e972f2344b25381c1a63af1d331fbea83a34e
|
@@ -8,11 +8,15 @@ class String
|
|
8
8
|
I18n.transliterate(self)
|
9
9
|
end
|
10
10
|
|
11
|
-
def normalize
|
11
|
+
def normalize(keep_dashes=false)
|
12
12
|
literated = self.literate
|
13
13
|
literated.strip!
|
14
14
|
literated.gsub!(/\s+/, '_')
|
15
|
-
|
15
|
+
if keep_dashes
|
16
|
+
literated.gsub!(/[^a-zA-Z0-9_\-]/, '')
|
17
|
+
else
|
18
|
+
literated.gsub!(/\W/, '')
|
19
|
+
end
|
16
20
|
literated
|
17
21
|
end
|
18
22
|
|
@@ -22,6 +26,10 @@ class String
|
|
22
26
|
normalized
|
23
27
|
end
|
24
28
|
|
29
|
+
def normalize_with_dashes
|
30
|
+
self.normalize(true)
|
31
|
+
end
|
32
|
+
|
25
33
|
def underscore
|
26
34
|
# based on:
|
27
35
|
# http://stackoverflow.com/questions/1509915/converting-camel-case-to-underscore-case-in-ruby
|
@@ -1 +1 @@
|
|
1
|
-
@{{{ rendered_children.key }}}{{#if has_value? }}-{{{
|
1
|
+
@{{{ rendered_children.key }}}{{#if has_value? }}-{{{normalize_with_dashes rendered_children.value }}}{{/if}}
|