Skip to content

Commit 41599a3

Browse files
committed
name changes
1 parent bf60c09 commit 41599a3

File tree

5 files changed

+719
-592
lines changed

5 files changed

+719
-592
lines changed

README.md

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Overview
8383
* [ipv6] (docs/ansible_functions.md#ipv6) - To test if a string is a valid ipv6 address.
8484
* [ipwrap] (docs/ansible_functions.md#ipwrap) - Some configuration files require IPv6 addresses to be “wrapped” in square brackets ([ ]).
8585

86-
### Number / Math Utilities
86+
### Number / Math Utilities
8787
* [abs] (docs/jinja_functions.md#abs) - Return the absolute value of the argument.
8888
* [float] (docs/jinja_functions.md#float) - Convert the value into a floating point number.
8989
* [int] (docs/jinja_functions.md#int) - Convert the value into an integer.
@@ -102,52 +102,52 @@ Overview
102102
### Path Utilities
103103
* [basename] (docs/ansible_functions.md#basename) - Return the base name of pathname path.
104104
* [dirname] (docs/ansible_functions.md#dirname) - Return the directory name of pathname path.
105-
* [expanduser] (docs/ansible_functions.md#expanduser) - Expand a path containing a tilde (~) character
105+
* [expanduser] (docs/ansible_functions.md#expanduser) - Expand a path containing a tilde (~) character
106106
* [realpath] (docs/ansible_functions.md#realpath) - Get the real path of a link
107107
* [relpath] (docs/ansible_functions.md#relpath) - Get the relative path of a link, from a start point.
108108
* [splitext] (docs/ansible_functions.md#splitext) - To get the root and extension of a path or filename.
109109

110110
### String Utilities
111-
* [camelize] (docs/underscore_string_functions.md#camelize) - Converts underscored or dasherized string to a camelized one.
111+
* [camelize] (docs/string_util_functions.md#camelize) - Converts underscored or dasherized string to a camelized one.
112112
* [capitalize] (docs/jinja_functions.md#capitalize) - Capitalize a String.
113113
* [center] (docs/jinja_functions.md#center) - Centers the value in a field of a given width.
114-
* [chars] - See [list] (docs/jinja_functions.md#list)
115-
* [classify] (docs/underscore_string_functions.md#classify) - Converts string to camelized class name. First letter is always upper case.
116-
* [clean] (docs/underscore_string_functions.md#clean) - Trim and replace multiple spaces with a single space.
117-
* [count] (docs/underscore_string_functions.md#count) - Counts the number of times needle is in haystack.
118-
* [dasherize] (docs/underscore_string_functions.md#dasherize) - Converts a underscored or camelized string into an dasherized one.
119-
* [decapitalize] (docs/underscore_string_functions.md#decapitalize) - Converts first letter of the string to lowercase.
120-
* [dedent] (docs/underscore_string_functions.md#dedent) - Converts first letter of the string to lowercase.
121-
* [ends_with] (docs/underscore_string_functions.md#ends_with) - Dedent unnecessary indentation.
114+
* [chars] - See [list] (docs/jinja_functions.md#list)
115+
* [classify] (docs/string_util_functions.md#classify) - Converts string to camelized class name. First letter is always upper case.
116+
* [clean] (docs/string_util_functions.md#clean) - Trim and replace multiple spaces with a single space.
117+
* [count] (docs/string_util_functions.md#count) - Counts the number of times needle is in haystack.
118+
* [dasherize] (docs/string_util_functions.md#dasherize) - Converts a underscored or camelized string into an dasherized one.
119+
* [decapitalize] (docs/string_util_functions.md#decapitalize) - Converts first letter of the string to lowercase.
120+
* [dedent] (docs/string_util_functions.md#dedent) - Converts first letter of the string to lowercase.
121+
* [ends_with] (docs/string_util_functions.md#ends_with) - Dedent unnecessary indentation.
122122
* [escape] (docs/jinja_functions.md#escape) - Convert the chars to HTML-safe sequences.
123-
* [escape_html] (docs/underscore_string_functions.md#escape_html) - Converts HTML special characters to their entity equivalents.
124-
* [filesizeformat] (docs/jinja_functions.md#filesizeformat) - Format file sizes into ‘human-readable’
123+
* [escape_html] (docs/string_util_functions.md#escape_html) - Converts HTML special characters to their entity equivalents.
124+
* [filesizeformat] (docs/jinja_functions.md#filesizeformat) - Format file sizes into ‘human-readable’
125125
* [forceescape] (docs/jinja_functions.md#forceescape) - Enforce HTML escaping.
126126
* [format] (docs/jinja_functions.md#format) - Apply python string formatting on an object.
127-
* [humanize] (docs/underscore_string_functions.md#humanize) - Converts an underscored, camelized, or dasherized string into a humanized one.
127+
* [humanize] (docs/string_util_functions.md#humanize) - Converts an underscored, camelized, or dasherized string into a humanized one.
128128
* [indent] (docs/jinja_functions.md#indent) - Indent a string.
129-
* [insert] (docs/underscore_string_functions.md#insert) - Insert word in string at the defined position.
129+
* [insert] (docs/string_util_functions.md#insert) - Insert word in string at the defined position.
130130
* [list] (docs/jinja_functions.md#list) - Convert the value into a list.
131131
* [lower] (docs/jinja_functions.md#lower) - Convert a value to lowercase.
132-
* [lpad] (docs/underscore_string_functions.md#lpad) - Return the string left justified in a string of length width.
133-
* [lrpad] - See [center] (docs/jinja_functions.md#center)
134-
* [ltrim] (docs/underscore_string_functions.md#ltrim) - Return a copy of the string with leading characters removed.
132+
* [lpad] (docs/string_util_functions.md#lpad) - Return the string left justified in a string of length width.
133+
* [lrpad] - See [center] (docs/jinja_functions.md#center)
134+
* [ltrim] (docs/string_util_functions.md#ltrim) - Return a copy of the string with leading characters removed.
135135
* [predecessor] - do not know how to implement this
136136
* [prune] - see [truncate] (docs/jinja_functions.md#truncate)
137137
* [quote] (docs/ansible_functions.md#quote) - Add quotes for shell usage
138138
* [regex_escape] (docs/ansible_functions.md#regex_escape) - Escape special characters within a regex
139139
* [regex_replace] (docs/ansible_functions.md#regex_replace) - Replace text in a string with a regex
140-
* [repeat] (docs/underscore_string_functions.md#repeat) - Repeats a string count times, can be seperated by separator.
140+
* [repeat] (docs/string_util_functions.md#repeat) - Repeats a string count times, can be seperated by separator.
141141
* [replace] (docs/jinja_functions.md#replace) - Search for needle in haystack and replace it with substitute.
142142
* [replaceAll] - See [replace] (docs/jinja_functions.md#replace)
143143
* [reverse] (docs/jinja_functions.md#reverse) - Reverse the object or return an iterator that iterates over it the other way round.
144-
* [rpad] (docs/underscore_string_functions.md#rpad) - Return the string right justified in a string of length width.
145-
* [rtrim] (docs/underscore_string_functions.md#rtrim) - Return a copy of the string with trailing characters removed.
144+
* [rpad] (docs/string_util_functions.md#rpad) - Return the string right justified in a string of length width.
145+
* [rtrim] (docs/string_util_functions.md#rtrim) - Return a copy of the string with trailing characters removed.
146146
* [safe] (docs/jinja_functions.md#safe) - Make all potentionally dangerous chars safe. - safety is a illusion, so beware!
147-
* [slugify] (docs/underscore_string_functions.md#slugify) - Transform text into an ascii slug which can be used in safely in URLs.
148-
* [splice] (docs/underscore_string_functions.md#splice) - Return the string right justified in a string of length width.
147+
* [slugify] (docs/string_util_functions.md#slugify) - Transform text into an ascii slug which can be used in safely in URLs.
148+
* [splice] (docs/string_util_functions.md#splice) - Return the string right justified in a string of length width.
149149
* [sprintf] - see [format] (docs/jinja_functions.md#format)
150-
* [starts_with] (docs/underscore_string_functions.md#starts_with) - Checks whether the string begins with the needle at position (default: 0).
150+
* [starts_with] (docs/string_util_functions.md#starts_with) - Checks whether the string begins with the needle at position (default: 0).
151151
* [string] (docs/jinja_functions.md#string) - Make a string unicode.
152152
* [striptags] (docs/jinja_functions.md#striptags) - Strip SGML/XML tags and replace adjacent whitespace by one space.
153153
* [strLeft] ()
@@ -171,7 +171,7 @@ Overview
171171
* [urlize] (docs/jinja_functions.md#urlize) - Converts URLs in plain text into clickable links.
172172
* [wordcount] (docs/jinja_functions.md#wordcount) - Count the words in that string.
173173
* [words]
174-
* [wordwrap] (docs/jinja_functions.md#wordwrap) - Return a copy of the string passed to the filter wrapped after n characters.
174+
* [wordwrap] (docs/jinja_functions.md#wordwrap) - Return a copy of the string passed to the filter wrapped after n characters.
175175
* [xmlattr] (docs/jinja_functions.md#xmlattr) - Create an SGML/XML attribute string based on the items in a dict.
176176

177177

@@ -183,7 +183,14 @@ Overview
183183
* [equalto] (docs/jinja_tests.md#equalto) - Check if an object has the same value as another object.
184184
* [escaped] (docs/jinja_tests.md#escaped) - Check if the value is escaped.
185185
* [even] (docs/jinja_tests.md#even) - Return true if the variable is even.
186-
* [includes] (docs/underscore_string_functions.md#includes) - Tests if string contains a substring.
186+
* [includes] (docs/string_util_functions.md#includes) - Tests if string contains a substring.
187+
* [is_camel_case]
188+
* [is_credit_card]
189+
* [is_email]
190+
* [is_ip]
191+
* [is_snake_case]
192+
* [is_url]
193+
* [is_uuid]
187194
* [isBlank]
188195
* [isnan] (docs/ansible_functions.md#isnan) - To see if something is actually a number
189196
* [iterable] (docs/jinja_tests.md#iterable) - Check if it’s possible to iterate over an object.

collection_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,20 @@ def where(entries, properties):
1717
for p in properties:
1818
if p in entry:
1919
obj[p] = entry[p]
20-
2120
ret.append(obj)
22-
2321
return ret
2422

23+
2524
def initial(array):
2625
return array[0:len(array) - 1]
2726

27+
2828
def rest(array):
2929
return array[1:len(array)]
3030

3131

3232
class FilterModule(object):
33+
3334
""" utility filters for operating on hashes """
3435

3536
def filters(self):
@@ -41,6 +42,7 @@ def filters(self):
4142

4243

4344
class TestCollectionUtils(unittest.TestCase):
45+
4446
def test_where(self):
4547
l = [
4648
{'foo': 'bar', 'bar': 'quuux', 'baz': 'qux'},

docs/underscore_string_functions.md renamed to docs/string_util_functions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## List of underscore string functions
1+
## List of underscore string functions
22

33
#### camelize
44
###### method: camelize(string, uppercase_first_letter=True)
@@ -106,7 +106,7 @@ Converts first letter of the string to lowercase.
106106

107107
{{ 'FOO' | decapitalize }}
108108
# => 'fOO'
109-
109+
110110
{{ 123 | decapitalize }}
111111
# => '123'
112112
```
@@ -129,7 +129,7 @@ Note that tabs and spaces are both treated as whitespace, but they are not equal
129129

130130
{{ 'Hello\t\nWorld' | dedent }}
131131
# => 'Hello\t\nWorld'
132-
132+
133133
{{ 'Hello \nWorld' | dedent }}
134134
# => 'Hello \nWorld'
135135

@@ -179,7 +179,7 @@ Converts HTML special characters to their entity equivalents. This function supp
179179
###### method: humanize(string)
180180
> custom implementation / needs to be installed
181181

182-
Converts an underscored, camelized, or dasherized string into a humanized one. Also removes beginning and ending whitespace, and removes the postfix '_id'.
182+
Converts an underscored, camelized, or dasherized string into a humanized one. Also removes beginning and ending whitespace, and removes the postfix '_id'.
183183

184184
```python
185185
{{ 'the_humanize_string_method' | humanize }}
@@ -246,7 +246,7 @@ Return the string left justified in a string of length width. Padding is done us
246246
```python
247247
{{ '1' | lpad(8) }}
248248
# => ' 1'
249-
249+
250250
{{ 1 | lpad(8) }}
251251
# => ' 1'
252252

0 commit comments

Comments
 (0)