bashly 1.2.11 → 1.2.12

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a153068d9772fcffd185c212747324c7af5b87378329750fd742de486401384
4
- data.tar.gz: f4a871e05d08f6fce8e6cceedd92a9c07549492c6d8f8133de9885afdbf4bb36
3
+ metadata.gz: 409606d6cd016389acf10a1d9a44211659b2d567bfd72d62aec4151d4d08846b
4
+ data.tar.gz: 3bbefdeee9dff2b530366cbb453fa45390d87f0f45d57fdfd643361fb7a498d2
5
5
  SHA512:
6
- metadata.gz: b25d31be5e4171aa088698a7665b434f9c4f13a6596b597860dee9021c3426682c9a6a873b722f04bc019ebd9c8be4d7c1b5006e72711f76ad3d8a7a0397d215
7
- data.tar.gz: fc9cdd9ae807b018e1d64c15d7ed4175551624b6b5622982bf4b43c445e767aef97483359daff58e89af22a83f37edf3de6c2d1217345fa4709c70935217bf38
6
+ metadata.gz: 0aa662d5e9e82b795f0885337fb033762317fb6a6b4967892ebe777b5adf9e8ec771ae6969f020d26b3a36f33be686ba3a61482cdbd225a8777412a393895c66
7
+ data.tar.gz: 6673f3a65b9bf0e4f9aadfc766b3bc2dfff36a21ce1fbabfdd495a0548663237d369561dd2dfccea507e705cdcb70c9654b4f79819e461df467ca8ead950ae43
@@ -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: ~
@@ -15,6 +15,7 @@ module Bashly
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 @@ module Bashly
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
@@ -1,3 +1,3 @@
1
1
  module Bashly
2
- VERSION = '1.2.11'
2
+ VERSION = '1.2.12'
3
3
  end
@@ -1,6 +1,6 @@
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
 
@@ -15,11 +15,11 @@
15
15
  >
16
16
  if Settings.enabled? :sourcing
17
17
  > if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
18
- > initialize
19
- > run "$@"
18
+ > {{ Settings.function_name :initialize }}
19
+ > {{ Settings.function_name :run }} "$@"
20
20
  > fi
21
21
  else
22
- > initialize
23
- > run "$@"
22
+ > {{ Settings.function_name :initialize }}
23
+ > {{ Settings.function_name :run }} "$@"
24
24
  end
25
25
  >
@@ -1,6 +1,6 @@
1
1
  = view_marker
2
2
 
3
- > run() {
3
+ > {{ Settings.function_name :run }}() {
4
4
  = render(:globals).indent(2)
5
5
  >
6
6
  > normalize_input "$@"
@@ -6,16 +6,20 @@ if validate
6
6
  > values=''
7
7
  > eval "values=(${args['{{ long }}']})"
8
8
  > for value in "${values[@]}"; do
9
- > if [[ -n $(validate_{{ validate }} "$value") ]]; then
10
- > printf "{{ strings[:validation_error] }}\n" "{{ usage_string }}" "$(validate_{{ validate }} "$value")" >&2
9
+ > validation_output="$(validate_{{ validate }} "$value")"
10
+ > if [[ -n "$validation_output" ]]; then
11
+ > printf "{{ strings[:validation_error] }}\n" "{{ usage_string }}" "$validation_output" >&2
11
12
  > exit 1
12
13
  > fi
13
14
  > done
14
15
  > fi
15
16
  else
16
- > if [[ -v args['{{ long }}'] && -n $(validate_{{ validate }} "${args['{{ long }}']:-}") ]]; then
17
- > printf "{{ strings[:validation_error] }}\n" "{{ usage_string }}" "$(validate_{{ validate }} "${args['{{ long }}']:-}")" >&2
18
- > exit 1
17
+ > if [[ -v args['{{ long }}'] ]]; then
18
+ > validation_output="$(validate_{{ validate }} "${args['{{ long }}']:-}")"
19
+ > if [[ -n "${validation_output}" ]]; then
20
+ > printf "{{ strings[:validation_error] }}\n" "{{ usage_string }}" "$validation_output" >&2
21
+ > exit 1
22
+ > fi
19
23
  > fi
20
24
  >
21
25
  end
metadata CHANGED
@@ -1,54 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bashly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.11
4
+ version: 1.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-04 00:00:00.000000000 Z
10
+ date: 2025-05-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: colsole
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - ">="
17
- - !ruby/object:Gem::Version
18
- version: 0.8.1
19
- - - "<"
16
+ - - "~>"
20
17
  - !ruby/object:Gem::Version
21
- version: '2'
18
+ version: '1.0'
22
19
  type: :runtime
23
20
  prerelease: false
24
21
  version_requirements: !ruby/object:Gem::Requirement
25
22
  requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- version: 0.8.1
29
- - - "<"
23
+ - - "~>"
30
24
  - !ruby/object:Gem::Version
31
- version: '2'
25
+ version: '1.0'
32
26
  - !ruby/object:Gem::Dependency
33
27
  name: completely
34
28
  requirement: !ruby/object:Gem::Requirement
35
29
  requirements:
36
- - - ">="
37
- - !ruby/object:Gem::Version
38
- version: 0.6.1
39
- - - "<"
30
+ - - "~>"
40
31
  - !ruby/object:Gem::Version
41
- version: '0.8'
32
+ version: 0.7.0
42
33
  type: :runtime
43
34
  prerelease: false
44
35
  version_requirements: !ruby/object:Gem::Requirement
45
36
  requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: 0.6.1
49
- - - "<"
37
+ - - "~>"
50
38
  - !ruby/object:Gem::Version
51
- version: '0.8'
39
+ version: 0.7.0
52
40
  - !ruby/object:Gem::Dependency
53
41
  name: filewatcher
54
42
  requirement: !ruby/object:Gem::Requirement
@@ -355,7 +343,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
355
343
  requirements:
356
344
  - - ">="
357
345
  - !ruby/object:Gem::Version
358
- version: '3.1'
346
+ version: '3.2'
359
347
  required_rubygems_version: !ruby/object:Gem::Requirement
360
348
  requirements:
361
349
  - - ">="