File tree Expand file tree Collapse file tree 5 files changed +20
-6
lines changed Expand file tree Collapse file tree 5 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -126,3 +126,8 @@ var_aliases:
126
126
other_args : ~
127
127
deps : ~
128
128
env_var_names : ~
129
+
130
+ # Choose different names for some of the internal functions.
131
+ function_names :
132
+ run : ~
133
+ initialize : ~
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ class << self
15
15
:enable_inspect_args ,
16
16
:enable_sourcing ,
17
17
:enable_view_markers ,
18
+ :function_names ,
18
19
:lib_dir ,
19
20
:partials_extension ,
20
21
:private_reveal_key ,
@@ -89,6 +90,14 @@ def full_lib_dir
89
90
"#{ source_dir } /#{ lib_dir } "
90
91
end
91
92
93
+ def function_name ( key )
94
+ function_names [ key . to_s ] || key . to_s
95
+ end
96
+
97
+ def function_names
98
+ @function_names ||= get :function_names
99
+ end
100
+
92
101
def lib_dir
93
102
@lib_dir ||= get :lib_dir
94
103
end
Original file line number Diff line number Diff line change 1
1
= view_marker
2
2
3
- > initialize() {
3
+ > {{ Settings.function_name : initialize }} () {
4
4
> declare -g version="<%= version %>"
5
5
> {{ Settings.strict_string }}
6
6
Original file line number Diff line number Diff line change 15
15
>
16
16
if Settings.enabled? :sourcing
17
17
> if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
18
- > initialize
19
- > {{ function_name }}_run "$@"
18
+ > {{ Settings.function_name : initialize }}
19
+ > {{ Settings. function_name :run }} "$@"
20
20
> fi
21
21
else
22
- > initialize
23
- > {{ function_name }}_run "$@"
22
+ > {{ Settings.function_name : initialize }}
23
+ > {{ Settings. function_name :run }} "$@"
24
24
end
25
25
>
Original file line number Diff line number Diff line change 1
1
= view_marker
2
2
3
- > {{ function_name }}_run () {
3
+ > {{ Settings. function_name :run }} () {
4
4
= render(:globals).indent(2)
5
5
>
6
6
> normalize_input "$@"
You can’t perform that action at this time.
0 commit comments