completely 0.8.0.rc6 → 0.8.0.rc7
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e73f9f55e938cf5dad2a448ec33fc23fcd7a10aa2a463c0f6ffd5d98814a4e47
|
|
4
|
+
data.tar.gz: 53aa0b19424b0ddbdd00065b4d2b3541c42e797f8f5d9ebd9c630eef6593b308
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 81351a3c76122aeeb7943a0f5ff82d99aad66dafdcee96b08b0d71944e838154e7778f7cb2db6e123534caa8dcac3b98bbc313e583507b81719067eac3997a5a
|
|
7
|
+
data.tar.gz: 9b760b5ea4c828a01f31aec58a2214f5a3381261ec8da84b11c66fb80ebd034bff9f6806780f76a37e8a44aa7bd3b16a03474d2dc3c27570018a8ffd0f877f0f
|
|
@@ -160,6 +160,18 @@ module Completely
|
|
|
160
160
|
source[:items].empty?
|
|
161
161
|
end
|
|
162
162
|
|
|
163
|
+
def pattern_source_with_values(source, values)
|
|
164
|
+
existing_values = source[:items]
|
|
165
|
+
.select { |item| item[:type] == :value }
|
|
166
|
+
.map { |item| item[:value] }
|
|
167
|
+
|
|
168
|
+
items = values
|
|
169
|
+
.reject { |value| existing_values.include? value }
|
|
170
|
+
.map { |value| { type: :value, value: value } }
|
|
171
|
+
|
|
172
|
+
{ items: [*items, *source[:items]] }
|
|
173
|
+
end
|
|
174
|
+
|
|
163
175
|
def pattern_source_compgen(source)
|
|
164
176
|
wordlist = source[:items]
|
|
165
177
|
.select { |item| item[:type] == :value }
|
|
@@ -132,7 +132,12 @@
|
|
|
132
132
|
% child_words = pattern_node_child_words(node)
|
|
133
133
|
% next if child_words.empty?
|
|
134
134
|
<%= pattern_node_id node %>)
|
|
135
|
+
% first_positional = node[:positionals].first
|
|
136
|
+
% if first_positional && !pattern_source_empty?(first_positional[:source])
|
|
137
|
+
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen <%= pattern_source_compgen pattern_source_with_values(first_positional[:source], child_words) %> -- "$cur")
|
|
138
|
+
% else
|
|
135
139
|
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "<%= bash_double_quote_escape child_words.join(' ') %>" -- "$cur")
|
|
140
|
+
% end
|
|
136
141
|
return
|
|
137
142
|
;;
|
|
138
143
|
% end
|
data/lib/completely/version.rb
CHANGED