cmdlet 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.builders/_.rb +1 -1
- data/.builders/documents/_.rb +4 -0
- data/.builders/documents/categories.rb +24 -0
- data/.builders/documents/commands.rb +31 -0
- data/.builders/documents/functions.rb +226 -0
- data/.builders/documents/use_cases.rb +136 -0
- data/.builders/documents/x_functions.rb +66 -0
- data/CHANGELOG.md +7 -0
- data/lib/cmdlet/configuration.rb +33 -0
- data/lib/cmdlet/version.rb +1 -1
- data/lib/cmdlet.rb +3 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +11 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfdaac05f95db1014dc0a28dca06d7af071a40b46ccf79398ae7e15cef3d73ab
|
4
|
+
data.tar.gz: f90974598208b711a674c2a9dacd850dcea8be72f79d8cf2bddd11425c98a706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04b7ea36c7db18bb2becc84ea1fda21856a906d39d3b0a3c390a159fce77e40dcdb752da1c810ce14cb7b5205bee8ebfe884ac467d724081e16f6adc468078d1
|
7
|
+
data.tar.gz: bc84349086aeb4be3d8c5a9f3e595e84f39596af58592cbc4be16ed2f6856d4c342a1c9ab6b8ab3f4d9f52683665aed7f2fc9cf2a1f7ed7d386dd128898a8a42
|
data/.builders/_.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
require_relative './documents/_'
|
@@ -0,0 +1,24 @@
|
|
1
|
+
def categories
|
2
|
+
return @categories unless @categories.nil?
|
3
|
+
|
4
|
+
|
5
|
+
result = KDoc.model :document do
|
6
|
+
table :rows do
|
7
|
+
fields :name, :description
|
8
|
+
|
9
|
+
row :case , "Tokenize and apply case and/or separator"
|
10
|
+
row :comparison , "Comparison helpers, eg. or, and, equal, not equal, less than, greater than etc."
|
11
|
+
row :inflection , "Inflection handling routines, eg. pluralize, singular, ordinalize"
|
12
|
+
row :string , "String handling helpers"
|
13
|
+
|
14
|
+
row :a_array , "Array handling routines, eg. join, join_prefix, join_post"
|
15
|
+
row :a_transform , "Tokenize and apply case and/or separator"
|
16
|
+
row :a_comparison , "Comparison helpers, eg. or, and, equal, not equal, less than, greater than etc."
|
17
|
+
row :a_inflection , "Inflection handling routines, eg. pluralize, singular, ordinalize"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
@categories = result.raw_data_struct.rows
|
22
|
+
end
|
23
|
+
@categories = nil
|
24
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
def commands
|
2
|
+
functions.map do |function|
|
3
|
+
category = categories.find { |c| c.name == function.category }
|
4
|
+
|
5
|
+
|
6
|
+
log.error("Category '#{function.category}' not found") unless category
|
7
|
+
|
8
|
+
OpenStruct.new(
|
9
|
+
category: function.category,
|
10
|
+
name: function.name,
|
11
|
+
category_description: category.description,
|
12
|
+
function_description: function.description,
|
13
|
+
ruby: function.ruby,
|
14
|
+
usecases: use_cases
|
15
|
+
.select { |uc| uc.category == function.category && uc.function == function.name }
|
16
|
+
.map { |uc|
|
17
|
+
OpenStruct.new({
|
18
|
+
category: uc.category,
|
19
|
+
function: uc.function,
|
20
|
+
inputs: uc.inputs,
|
21
|
+
nice_inputs: nice_inputs(uc.inputs),
|
22
|
+
expected_output: uc.expected_output
|
23
|
+
})
|
24
|
+
}
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def nice_inputs(values)
|
30
|
+
values.map { |value| value.is_a?(String) ? "'#{value}'" : value }.join(', ')
|
31
|
+
end
|
@@ -0,0 +1,226 @@
|
|
1
|
+
def functions
|
2
|
+
return @functions unless @functions.nil?
|
3
|
+
|
4
|
+
result = KDoc.model :document do
|
5
|
+
table :rows do
|
6
|
+
fields :category, :name, :alias, :description, :ruby # , f(name: :params, default: [:value])
|
7
|
+
|
8
|
+
# context 'when array of string' do
|
9
|
+
# let(:value) { %w[the quick fox] }
|
10
|
+
|
11
|
+
# it { is_expected.to eq('the,quick,fox') }
|
12
|
+
# end
|
13
|
+
|
14
|
+
# context 'when array of numbers' do
|
15
|
+
# let(:value) { [1, 2, 3] }
|
16
|
+
|
17
|
+
# it { is_expected.to eq('1,2,3') }
|
18
|
+
# end
|
19
|
+
|
20
|
+
# context 'when array of symbol' do
|
21
|
+
# let(:value) { %i[the quick fox] }
|
22
|
+
|
23
|
+
# it { is_expected.to eq('the,quick,fox') }
|
24
|
+
# end
|
25
|
+
|
26
|
+
row :a_array , :join , [] , "join an array of values with separator as a string", <<-'RUBY'
|
27
|
+
return '' if value.nil? || !value.is_a?(Array)
|
28
|
+
values = value.reject(&:blank?)
|
29
|
+
return '' if value.length.zero?
|
30
|
+
|
31
|
+
separator = ','
|
32
|
+
value.join(separator)
|
33
|
+
RUBY
|
34
|
+
|
35
|
+
row :a_array , :join_pre , [] , "join an array of values with separator as a string and using the separator at the beginning of string", <<-'RUBY'
|
36
|
+
return '' if value.nil? || !value.is_a?(Array)
|
37
|
+
values = value.reject(&:blank?)
|
38
|
+
return '' if value.length.zero?
|
39
|
+
|
40
|
+
separator = ','
|
41
|
+
"#{separator}#{value.join(separator)}"
|
42
|
+
RUBY
|
43
|
+
|
44
|
+
row :a_array , :join_post , [] , "join an array of values with separator as a string and using the separator at the end of string", <<-'RUBY'
|
45
|
+
return '' if value.nil? || !value.is_a?(Array)
|
46
|
+
values = value.reject(&:blank?)
|
47
|
+
return '' if value.length.zero?
|
48
|
+
|
49
|
+
separator = ','
|
50
|
+
"#{value.join(separator)}#{separator}"
|
51
|
+
RUBY
|
52
|
+
|
53
|
+
row :a_transform , :backslash , [:back_slash] , "convert to back slash notation", <<-'RUBY'
|
54
|
+
tokenizer.parse(value, preserve_case: true, separator: '\\')
|
55
|
+
RUBY
|
56
|
+
|
57
|
+
row :a_transform , :camel , [:upper_camel, :pascal] , "convert to camel notation", <<-'RUBY'
|
58
|
+
tokenizer.parse(value).underscore.camelize
|
59
|
+
RUBY
|
60
|
+
|
61
|
+
row :a_transform , :constant , [:constantize] , "", <<-'RUBY'
|
62
|
+
tokenizer.parse(value, separator: '_').upcase
|
63
|
+
RUBY
|
64
|
+
|
65
|
+
row :a_transform , :dash , [:dasherize] , "convert to dash notation", <<-'RUBY'
|
66
|
+
tokenizer.parse(value)
|
67
|
+
RUBY
|
68
|
+
|
69
|
+
row :a_transform , :dot , [:dotirize] , "", <<-'RUBY'
|
70
|
+
tokenizer.parse(value, separator: '.')
|
71
|
+
RUBY
|
72
|
+
|
73
|
+
row :a_transform , :double_colon , [] , "", <<-'RUBY'
|
74
|
+
tokenizer.parse(value, preserve_case: true, separator: '::')
|
75
|
+
RUBY
|
76
|
+
|
77
|
+
row :a_transform , :lower , [:lowercase, :downcase] , "", <<-'RUBY'
|
78
|
+
return '' if value.nil?
|
79
|
+
|
80
|
+
value.downcase
|
81
|
+
RUBY
|
82
|
+
|
83
|
+
# row :a_transform , :format_as , [] , "", <<-'RUBY'
|
84
|
+
|
85
|
+
# RUBY
|
86
|
+
|
87
|
+
row :a_transform , :proper , [] , "Proper case capitalizes the first letter of ALL words in a string", <<-'RUBY'
|
88
|
+
tokenizer.parse(value,
|
89
|
+
separator: ' ',
|
90
|
+
preserve_case: true,
|
91
|
+
compress_prefix_numerals: false,
|
92
|
+
compress_suffix_numerals: false)
|
93
|
+
.titleize
|
94
|
+
RUBY
|
95
|
+
|
96
|
+
row :a_transform , :sentence , [:human, :humanize] , "Upper case for first letter only. Numbers will maintain their spacing", <<-'RUBY'
|
97
|
+
tokenizer.parse(value,
|
98
|
+
separator: ' ',
|
99
|
+
preserve_case: true,
|
100
|
+
compress_prefix_numerals: false,
|
101
|
+
compress_suffix_numerals: false)
|
102
|
+
.humanize
|
103
|
+
RUBY
|
104
|
+
|
105
|
+
row :a_transform , :lamel , [:lower_camel] , "", <<-'RUBY'
|
106
|
+
tokenizer.parse(value, separator: '_').camelize(:lower)
|
107
|
+
RUBY
|
108
|
+
|
109
|
+
row :a_transform , :slash , [:forwardslash, :forward_slash] , "", <<-'RUBY'
|
110
|
+
tokenizer.parse(value, preserve_case: true, separator: '/')
|
111
|
+
RUBY
|
112
|
+
|
113
|
+
row :a_transform , :snake , [:snake] , "", <<-'RUBY'
|
114
|
+
tokenizer.parse(value, separator: '_', forced_separator: true)
|
115
|
+
RUBY
|
116
|
+
|
117
|
+
row :a_transform , :title , [:titleize] , "", <<-'RUBY'
|
118
|
+
tokenizer.parse(value,
|
119
|
+
separator: ' ',
|
120
|
+
preserve_case: true,
|
121
|
+
compress_prefix_numerals: false,
|
122
|
+
compress_suffix_numerals: false)
|
123
|
+
.titleize
|
124
|
+
RUBY
|
125
|
+
|
126
|
+
row :a_transform , :upper , [:upper_case, :upcase] , "", <<-'RUBY'
|
127
|
+
return '' if value.nil?
|
128
|
+
|
129
|
+
value.upcase
|
130
|
+
RUBY
|
131
|
+
|
132
|
+
|
133
|
+
row :a_comparison , :and , [:all] , "", <<-'RUBY'
|
134
|
+
values.all? { |value| value }
|
135
|
+
RUBY
|
136
|
+
|
137
|
+
# DEFAULT does not make sense in comparison
|
138
|
+
row :a_comparison , :default , [:fallback] , "", <<-'RUBY'
|
139
|
+
default_value = values[-1]
|
140
|
+
|
141
|
+
find_value = values[0..-2].find { |value| !value.nil? }
|
142
|
+
|
143
|
+
find_value || default_value
|
144
|
+
RUBY
|
145
|
+
|
146
|
+
row :a_comparison , :eq , [:equal] , "", <<-'RUBY'
|
147
|
+
lhs = lhs.to_s if lhs.is_a?(Symbol)
|
148
|
+
rhs = rhs.to_s if rhs.is_a?(Symbol)
|
149
|
+
|
150
|
+
lhs == rhs
|
151
|
+
RUBY
|
152
|
+
|
153
|
+
row :a_comparison , :gt , [] , "", <<-'RUBY'
|
154
|
+
lhs > rhs
|
155
|
+
RUBY
|
156
|
+
|
157
|
+
row :a_comparison , :gte , [] , "", <<-'RUBY'
|
158
|
+
lhs >= rhs
|
159
|
+
RUBY
|
160
|
+
|
161
|
+
row :a_comparison , :lt , [:less_than] , "# Lt: (less than) Block helper that renders a block if `a` is **less than** `b`. If an inverse block is specified it will be rendered when falsy.", <<-'RUBY'
|
162
|
+
lhs < rhs
|
163
|
+
RUBY
|
164
|
+
|
165
|
+
row :a_comparison , :lte , [:less_than_or_equal_to] , "# Lte: (less than or equal to) Block helper that renders a block if `a` is **less than or equal to** `b`. If an inverse block is specified it will be rendered when falsy.", <<-'RUBY'
|
166
|
+
lhs <= rhs
|
167
|
+
RUBY
|
168
|
+
|
169
|
+
row :a_comparison , :ne , [:not_equal] , "# Ne: (not equal) Block helper that renders a block if `a` is **not equal to** `b`. If an inverse block is specified it will be rendered when falsy.", <<-'RUBY'
|
170
|
+
lhs = lhs.to_s if lhs.is_a?(Symbol)
|
171
|
+
rhs = rhs.to_s if rhs.is_a?(Symbol)
|
172
|
+
|
173
|
+
lhs != rhs
|
174
|
+
RUBY
|
175
|
+
|
176
|
+
row :a_comparison , :or , [:any] , "", <<-'RUBY'
|
177
|
+
values.any? { |value| value }
|
178
|
+
RUBY
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
row :a_inflection , :ordinal , [] , "The suffix that should be added to a number to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th", <<-RUBY
|
183
|
+
return '' if value.nil?
|
184
|
+
|
185
|
+
value = value.to_i if value.is_a? String
|
186
|
+
|
187
|
+
value.ordinal
|
188
|
+
RUBY
|
189
|
+
|
190
|
+
row :a_inflection , :ordinalize , [] , "Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.", <<-RUBY
|
191
|
+
return '' if value.nil?
|
192
|
+
|
193
|
+
value = value.to_i if value.is_a? String
|
194
|
+
|
195
|
+
value.ordinalize
|
196
|
+
RUBY
|
197
|
+
|
198
|
+
row :a_inflection , :pluralize , [] , "Returns the plural form of the word in the string", <<-RUBY
|
199
|
+
return '' if value.nil?
|
200
|
+
|
201
|
+
value = value.to_s if value.is_a?(Symbol)
|
202
|
+
|
203
|
+
value.pluralize
|
204
|
+
RUBY
|
205
|
+
|
206
|
+
row :a_inflection , :pluralize_by_number , [] , "Uses both a word and number to decide if the plural or singular form should be used.", <<-'RUBY'
|
207
|
+
return '' if value.nil?
|
208
|
+
|
209
|
+
count = count.to_i if count.is_a? String
|
210
|
+
format = :word if format.nil?
|
211
|
+
|
212
|
+
case format.to_sym
|
213
|
+
when :number_word, :number_and_word
|
214
|
+
"#{count} #{value.pluralize(count)}"
|
215
|
+
else # aka :word
|
216
|
+
value.pluralize(count)
|
217
|
+
end
|
218
|
+
RUBY
|
219
|
+
|
220
|
+
# row :a_inflection , :singularize , [] , ""
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
@functions = result.raw_data_struct.rows
|
225
|
+
end
|
226
|
+
@functions = nil
|
@@ -0,0 +1,136 @@
|
|
1
|
+
def use_cases
|
2
|
+
return @use_cases unless @use_cases.nil?
|
3
|
+
|
4
|
+
result = KDoc.model :document do
|
5
|
+
|
6
|
+
# table :inputs do
|
7
|
+
# fields :name, :value
|
8
|
+
|
9
|
+
# row :title , "Account Category"
|
10
|
+
# row :bsb_account , "ABC 123"
|
11
|
+
# row :text1 , "the Quick brown Fox 99"
|
12
|
+
# row :sentence1 , "The quick brown fox, jumped over the lazy dog"
|
13
|
+
# row :sentence2 , "The quick brown fox"
|
14
|
+
# row :sentence3 , "jumped over the lazy dog"
|
15
|
+
# row :num1 , 1
|
16
|
+
# row :num2 , 2
|
17
|
+
# row :num3 , 3
|
18
|
+
|
19
|
+
# end
|
20
|
+
|
21
|
+
sentence1 = "The quick brown fox, jumped over the lazy dog"
|
22
|
+
sentence2 = "coyote and the acme company"
|
23
|
+
text1 = "the Quick brown Fox 99"
|
24
|
+
|
25
|
+
table :rows do
|
26
|
+
# fields :category, :function, :input, :commands, :expected_value
|
27
|
+
fields :category , :function, :inputs, :expected_output
|
28
|
+
|
29
|
+
row :a_inflection , :ordinal , [1], 'st'
|
30
|
+
row :a_inflection , :ordinal , [2], 'nd'
|
31
|
+
row :a_inflection , :ordinal , [3], 'rd'
|
32
|
+
row :a_inflection , :ordinal , [4], 'th'
|
33
|
+
row :a_inflection , :ordinal , ['101'], 'st'
|
34
|
+
row :a_inflection , :ordinal , ['105'], 'th'
|
35
|
+
|
36
|
+
row :a_inflection , :ordinalize , [1], '1st'
|
37
|
+
row :a_inflection , :ordinalize , [2], '2nd'
|
38
|
+
row :a_inflection , :ordinalize , [3], '3rd'
|
39
|
+
row :a_inflection , :ordinalize , [4], '4th'
|
40
|
+
row :a_inflection , :ordinalize , ['101'], '101st'
|
41
|
+
row :a_inflection , :ordinalize , ['105'], '105th'
|
42
|
+
|
43
|
+
row :a_inflection , :pluralize , ['name'], 'names'
|
44
|
+
row :a_inflection , :pluralize , ['octopus'], 'octopi'
|
45
|
+
|
46
|
+
row :a_transform , :backslash , [text1] , 'the\quick\brown\fox99'
|
47
|
+
row :a_transform , :camel , [text1] , 'TheQuickBrownFox99'
|
48
|
+
row :a_transform , :constant , [text1] , 'THE_QUICK_BROWN_FOX99'
|
49
|
+
row :a_transform , :dash , [text1] , 'the-quick-brown-fox99'
|
50
|
+
row :a_transform , :dot , [text1] , 'the.quick.brown.fox99'
|
51
|
+
row :a_transform , :double_colon , [text1] , 'The::Quick::Brown::Fox99'
|
52
|
+
row :a_transform , :lower , [text1] , 'the quick brown fox 99'
|
53
|
+
row :a_transform , :lamel , [text1] , 'theQuickBrownFox99'
|
54
|
+
row :a_transform , :proper , [text1] , 'The Quick Brown Fox 99'
|
55
|
+
row :a_transform , :proper , [sentence1] , 'The Quick Brown Fox Jumped Over The Lazy Dog'
|
56
|
+
row :a_transform , :sentence , [text1] , 'The quick brown fox 99'
|
57
|
+
row :a_transform , :sentence , [sentence1] , 'The quick brown fox jumped over the lazy dog'
|
58
|
+
# row :a_transform , :sentence , [sentence2] , 'Coyote and the ACME company'
|
59
|
+
|
60
|
+
row :a_transform , :slash , [text1] , 'the/Quick/brown/Fox99'
|
61
|
+
row :a_transform , :snake , [text1] , 'the_quick_brown_fox99'
|
62
|
+
row :a_transform , :title , [text1] , 'The Quick Brown Fox 99'
|
63
|
+
row :a_transform , :title , [sentence1] , 'The Quick Brown Fox Jumped over the Lazy Dog'
|
64
|
+
row :a_transform , :upper , [text1] , 'THE QUICK BROWN FOX 99'
|
65
|
+
|
66
|
+
|
67
|
+
row :a_comparison , :and , [nil, nil] , false
|
68
|
+
row :a_comparison , :and , ['data', nil] , false
|
69
|
+
row :a_comparison , :and , [nil, 'data'] , false
|
70
|
+
row :a_comparison , :and , ['data', 'data'] , true
|
71
|
+
row :a_comparison , :and , ['aaa', 'bbb'] , true
|
72
|
+
|
73
|
+
# DEFAULT does not make sense in comparison
|
74
|
+
row :a_comparison , :default , [nil, 'happy'] , "happy"
|
75
|
+
row :a_comparison , :default , ['sad', 'happy'] , "sad"
|
76
|
+
row :a_comparison , :default , [nil, nil, nil, nil, 'david'] , "david"
|
77
|
+
row :a_comparison , :default , ['', 'happy'] , "happy"
|
78
|
+
|
79
|
+
# type: :strict, :equiv, :cast, :insensitive
|
80
|
+
row :a_comparison , :eq , [111, '111' ], false
|
81
|
+
row :a_comparison , :eq , [111, 111.0 ], false
|
82
|
+
row :a_comparison , :eq , ['aaa', 'aaa'], true
|
83
|
+
row :a_comparison , :eq , ['aaa', 'bbb'], false
|
84
|
+
row :a_comparison , :eq , [:aaa, :aaa] , true
|
85
|
+
row :a_comparison , :eq , ['aaa', :aaa] , false
|
86
|
+
row :a_comparison , :eq , ['aaa', 'bbb'], false
|
87
|
+
row :a_comparison , :eq , ['aaa', 'AAA'], false
|
88
|
+
|
89
|
+
row :a_comparison , :gt , [2, 1] , true
|
90
|
+
row :a_comparison , :gt , [2, 2] , false
|
91
|
+
|
92
|
+
row :a_comparison , :gte , [1, 2] , false
|
93
|
+
row :a_comparison , :gte , [1, 1] , true
|
94
|
+
row :a_comparison , :gte , [2, 1] , true
|
95
|
+
|
96
|
+
row :a_comparison , :lt , [1, 2] , true
|
97
|
+
row :a_comparison , :lt , [2, 1] , false
|
98
|
+
|
99
|
+
row :a_comparison , :lte , [1, 2] , true
|
100
|
+
row :a_comparison , :lte , [2, 2] , true
|
101
|
+
row :a_comparison , :lte , [2, 1] , false
|
102
|
+
|
103
|
+
row :a_comparison , :ne , [1, 2] , true
|
104
|
+
row :a_comparison , :ne , [1, 1] , false
|
105
|
+
|
106
|
+
row :a_comparison , :or , [nil, nil] , false
|
107
|
+
row :a_comparison , :or , ['data', nil] , true
|
108
|
+
row :a_comparison , :or , [nil, 'data'] , true
|
109
|
+
row :a_comparison , :or , ['data', 'data'] , true
|
110
|
+
row :a_comparison , :or , ['aaa', 'bbb'] , true
|
111
|
+
# row :text1 , %i[backslash] , 'the\quick\brown\fox99'
|
112
|
+
# row :text1 , %i[camel] , 'TheQuickBrownFox99'
|
113
|
+
|
114
|
+
|
115
|
+
# row :sentence3 , %i[plural] , "jumped over the lazy dogs"
|
116
|
+
# row :title , %i[plural] , "Account Categories"
|
117
|
+
# row :sentence1 , %i[dash] , "The-quick-brown-fox-jumped-over-the-lazy-dog"
|
118
|
+
# row :sentence1 , %i[natural] , "The quick brown fox, jumped over the lazy dog"
|
119
|
+
# row :sentence1 , %i[lower dash] , "the-quick-brown-fox-jumped-over-the-lazy-dog"
|
120
|
+
# row :bsb_account , %i[lower snake] , "abc_123"
|
121
|
+
# row :bsb_account , %i[slash] , "ABC/123"
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
|
126
|
+
@use_cases = result.raw_data_struct.rows
|
127
|
+
end
|
128
|
+
@use_cases = nil
|
129
|
+
|
130
|
+
# def self.camel_case(string, tokenizer = PreservePrefixedUnderscoreTokenizer.new)
|
131
|
+
# # DAVE INPUT 9 Oct 21 from lucky_case play
|
132
|
+
# # dependency injection: to use enhanced tokenizer
|
133
|
+
# a = split_case_string string
|
134
|
+
# converted = ([a[0]] + a[1..-1].map { |e| capital e }).join('')
|
135
|
+
# tokenizer.parse(converted)
|
136
|
+
# end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
|
2
|
+
def category_blueprint
|
3
|
+
|
4
|
+
fn_builder
|
5
|
+
.init
|
6
|
+
.category(:array , active: 0 , title: 'Array' , description: 'Functions for working with Array')
|
7
|
+
.category(:cases , active: 0 , title: 'Cases' , description: 'Functions for working with Cases')
|
8
|
+
.category(:code , active: 0 , title: 'Code' , description: 'Functions for working with Code')
|
9
|
+
.category(:collection , active: 0 , title: 'Collection' , description: 'Functions for working with Collection')
|
10
|
+
.category(:comparison , active: 0 , title: 'Comparison' , description: 'Functions for working with Comparison')
|
11
|
+
.category(:date , active: 0 , title: 'Date' , description: 'Functions for working with Date')
|
12
|
+
.category(:file , active: 0 , title: 'File' , description: 'Functions for working with File')
|
13
|
+
.category(:html , active: 0 , title: 'Html' , description: 'Functions for working with Html')
|
14
|
+
.category(:i18n , active: 0 , title: 'I18n' , description: 'Functions for working with Internationalization')
|
15
|
+
.category(:inflection , active: 1 , title: 'Inflection' , description: 'Functions for working with Inflection')
|
16
|
+
.category(:logging , active: 0 , title: 'Logging' , description: 'Functions for working with Logging')
|
17
|
+
.category(:markdown , active: 0 , title: 'Markdown' , description: 'Functions for working with Markdown')
|
18
|
+
.category(:match , active: 0 , title: 'Match' , description: 'Functions for working with Match')
|
19
|
+
.category(:math , active: 0 , title: 'Math' , description: 'Functions for working with Math')
|
20
|
+
.category(:misc , active: 0 , title: 'Misc' , description: 'Functions for working with Misc')
|
21
|
+
.category(:number , active: 0 , title: 'Number' , description: 'Functions for working with Number')
|
22
|
+
.category(:object , active: 0 , title: 'Object' , description: 'Functions for working with Object')
|
23
|
+
.category(:path , active: 0 , title: 'Path' , description: 'Functions for working with Path')
|
24
|
+
.category(:regex , active: 0 , title: 'Regex' , description: 'Functions for working with Regex')
|
25
|
+
.category(:string , active: 0 , title: 'String' , description: 'Functions for working with String')
|
26
|
+
.category(:url , active: 0 , title: 'Url' , description: 'Functions for working with Url')
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
def function_blueprint
|
31
|
+
|
32
|
+
fn_builder
|
33
|
+
.init
|
34
|
+
.for_category(:array)
|
35
|
+
.for_category(:cases)
|
36
|
+
.for_category(:code)
|
37
|
+
.for_category(:collection)
|
38
|
+
.for_category(:comparison)
|
39
|
+
.for_category(:date)
|
40
|
+
.for_category(:file)
|
41
|
+
.for_category(:html)
|
42
|
+
.for_category(:i18n)
|
43
|
+
.for_category(:inflection)
|
44
|
+
.function(:ordinal)
|
45
|
+
.function(:ordinalize)
|
46
|
+
.function(:pluralize_by_number)
|
47
|
+
.function(:pluralize)
|
48
|
+
.function(:singularize)
|
49
|
+
.for_category(:logging)
|
50
|
+
.for_category(:markdown)
|
51
|
+
.for_category(:match)
|
52
|
+
.for_category(:math)
|
53
|
+
.for_category(:misc)
|
54
|
+
.for_category(:number)
|
55
|
+
.for_category(:object)
|
56
|
+
.for_category(:path)
|
57
|
+
.for_category(:regex)
|
58
|
+
.for_category(:string)
|
59
|
+
.for_category(:url)
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
# {{arrayify}}
|
64
|
+
# Cast the given value to an array.
|
65
|
+
# {{before}}
|
66
|
+
# Return all of the items in the collection before the specified count. Opposite of after.
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.0.3](https://github.com/klueless-io/cmdlet/compare/v0.0.2...v0.0.3) (2022-07-08)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* base files for new GEM - [#2](https://github.com/klueless-io/cmdlet/issues/2) ([9d52c68](https://github.com/klueless-io/cmdlet/commit/9d52c68acfe98954c456859d40edf7db6e74e044))
|
7
|
+
|
1
8
|
## [0.0.2](https://github.com/klueless-io/cmdlet/compare/v0.0.1...v0.0.2) (2022-07-08)
|
2
9
|
|
3
10
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cmdlet
|
4
|
+
# Register this configuration access extension for Cmdlet configuration
|
5
|
+
module CmdletConfigurationExtension
|
6
|
+
def cmdlet
|
7
|
+
return @cmdlet if defined? @cmdlet
|
8
|
+
|
9
|
+
@cmdlet = CmdletConfiguration.new
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# Structure for storing Cmdlet configuration
|
14
|
+
class CmdletConfiguration
|
15
|
+
include KLog::Logging
|
16
|
+
|
17
|
+
attr_accessor :tokenizer
|
18
|
+
attr_accessor :padl_count
|
19
|
+
attr_accessor :padl_char
|
20
|
+
attr_accessor :padr_count
|
21
|
+
attr_accessor :padr_char
|
22
|
+
|
23
|
+
def initialize
|
24
|
+
# @tokenizer = Funcky::StringTokenizer.new
|
25
|
+
@padr_count = 30
|
26
|
+
@padr_char = ' '
|
27
|
+
@padl_count = 30
|
28
|
+
@padl_char = ' '
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
KConfig::Configuration.register(:cmdlet, Cmdlet::CmdletConfigurationExtension)
|
data/lib/cmdlet/version.rb
CHANGED
data/lib/cmdlet.rb
CHANGED
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "cmdlet",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.4",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "cmdlet",
|
9
|
-
"version": "0.0.
|
9
|
+
"version": "0.0.4",
|
10
10
|
"devDependencies": {
|
11
11
|
"@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
|
12
12
|
"@semantic-release/changelog": "^6.0.1",
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmdlet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
@@ -11,19 +11,19 @@ cert_chain: []
|
|
11
11
|
date: 2022-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: k_config
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.
|
19
|
+
version: 0.0.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.
|
26
|
+
version: 0.0.3
|
27
27
|
description: " Cmdlet provides a set of functions (wrapped in the command pattern)
|
28
28
|
that perform simple actions\n"
|
29
29
|
email:
|
@@ -34,6 +34,12 @@ extra_rdoc_files: []
|
|
34
34
|
files:
|
35
35
|
- ".builders/_.rb"
|
36
36
|
- ".builders/boot.rb"
|
37
|
+
- ".builders/documents/_.rb"
|
38
|
+
- ".builders/documents/categories.rb"
|
39
|
+
- ".builders/documents/commands.rb"
|
40
|
+
- ".builders/documents/functions.rb"
|
41
|
+
- ".builders/documents/use_cases.rb"
|
42
|
+
- ".builders/documents/x_functions.rb"
|
37
43
|
- ".builders/generators/01-bootstrap.rb"
|
38
44
|
- ".releaserc.json"
|
39
45
|
- ".rspec"
|
@@ -48,6 +54,7 @@ files:
|
|
48
54
|
- bin/console
|
49
55
|
- bin/setup
|
50
56
|
- lib/cmdlet.rb
|
57
|
+
- lib/cmdlet/configuration.rb
|
51
58
|
- lib/cmdlet/version.rb
|
52
59
|
- package-lock.json
|
53
60
|
- package.json
|