gloo 0.4.0 → 0.5.4

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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.rubocop.yml +1 -1
  4. data/Gemfile.lock +84 -81
  5. data/Rakefile +1 -0
  6. data/gloo.gemspec +4 -1
  7. data/lib/gloo/app/engine.rb +48 -3
  8. data/lib/gloo/app/info.rb +1 -1
  9. data/lib/gloo/app/settings.rb +12 -5
  10. data/lib/gloo/convert/string_to_datetime.rb +21 -0
  11. data/lib/gloo/convert/string_to_decimal.rb +20 -0
  12. data/lib/gloo/convert/string_to_integer.rb +20 -0
  13. data/lib/gloo/core/event_manager.rb +2 -6
  14. data/lib/gloo/core/factory.rb +60 -3
  15. data/lib/gloo/core/gloo_system.rb +72 -0
  16. data/lib/gloo/core/obj.rb +50 -1
  17. data/lib/gloo/core/parser.rb +3 -1
  18. data/lib/gloo/core/pn.rb +3 -2
  19. data/lib/gloo/exec/dispatch.rb +30 -0
  20. data/lib/gloo/exec/runner.rb +43 -0
  21. data/lib/gloo/expr/expression.rb +1 -0
  22. data/lib/gloo/expr/l_decimal.rb +34 -0
  23. data/lib/gloo/expr/op_div.rb +2 -0
  24. data/lib/gloo/expr/op_minus.rb +2 -0
  25. data/lib/gloo/expr/op_mult.rb +2 -0
  26. data/lib/gloo/expr/op_plus.rb +2 -0
  27. data/lib/gloo/objs/basic/alias.rb +111 -0
  28. data/lib/gloo/objs/basic/container.rb +32 -1
  29. data/lib/gloo/objs/basic/decimal.rb +96 -0
  30. data/lib/gloo/objs/basic/integer.rb +5 -0
  31. data/lib/gloo/objs/basic/string.rb +9 -1
  32. data/lib/gloo/objs/basic/text.rb +27 -2
  33. data/lib/gloo/objs/cli/banner.rb +137 -0
  34. data/lib/gloo/objs/cli/bar.rb +141 -0
  35. data/lib/gloo/objs/cli/colorize.rb +1 -1
  36. data/lib/gloo/objs/cli/menu.rb +236 -0
  37. data/lib/gloo/objs/cli/menu_item.rb +128 -0
  38. data/lib/gloo/objs/cli/pastel.rb +120 -0
  39. data/lib/gloo/objs/cli/prompt.rb +19 -11
  40. data/lib/gloo/objs/cli/select.rb +153 -0
  41. data/lib/gloo/objs/ctrl/each.rb +45 -16
  42. data/lib/gloo/objs/ctrl/repeat.rb +129 -0
  43. data/lib/gloo/objs/data/markdown.rb +109 -0
  44. data/lib/gloo/objs/data/table.rb +168 -0
  45. data/lib/gloo/objs/dt/date.rb +72 -0
  46. data/lib/gloo/objs/dt/datetime.rb +84 -0
  47. data/lib/gloo/objs/dt/time.rb +72 -0
  48. data/lib/gloo/objs/ror/erb.rb +1 -0
  49. data/lib/gloo/objs/system/file_handle.rb +50 -1
  50. data/lib/gloo/objs/web/http_get.rb +24 -4
  51. data/lib/gloo/objs/web/http_post.rb +27 -11
  52. data/lib/gloo/objs/web/json.rb +155 -0
  53. data/lib/gloo/objs/web/uri.rb +160 -0
  54. data/lib/gloo/persist/file_loader.rb +17 -6
  55. data/lib/gloo/persist/line_splitter.rb +7 -2
  56. data/lib/gloo/persist/persist_man.rb +37 -13
  57. data/lib/gloo/verbs/cls.rb +67 -0
  58. data/lib/gloo/verbs/help.rb +9 -0
  59. data/lib/gloo/verbs/if.rb +1 -0
  60. data/lib/gloo/verbs/load.rb +3 -2
  61. data/lib/gloo/verbs/move.rb +128 -0
  62. data/lib/gloo/verbs/run.rb +21 -7
  63. data/lib/gloo/verbs/tell.rb +1 -1
  64. data/lib/gloo/verbs/unless.rb +1 -0
  65. data/lib/gloo/verbs/wait.rb +73 -0
  66. metadata +76 -5
  67. data/lib/gloo/core/runner.rb +0 -26
@@ -0,0 +1,73 @@
1
+ # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
+ # Copyright:: Copyright (c) 2020 Eric Crane. All rights reserved.
3
+ #
4
+ # Wait for the given number of seconds.
5
+ #
6
+
7
+ module Gloo
8
+ module Verbs
9
+ class Wait < Gloo::Core::Verb
10
+
11
+ KEYWORD = 'wait'.freeze
12
+ KEYWORD_SHORT = 'w'.freeze
13
+
14
+ #
15
+ # Run the verb.
16
+ #
17
+ def run
18
+ x = 1
19
+ if @tokens.token_count > 1
20
+ expr = Gloo::Expr::Expression.new( @tokens.params )
21
+ x = expr.evaluate.to_i
22
+ end
23
+ sleep x
24
+ end
25
+
26
+ #
27
+ # Get the Verb's keyword.
28
+ #
29
+ def self.keyword
30
+ return KEYWORD
31
+ end
32
+
33
+ #
34
+ # Get the Verb's keyword shortcut.
35
+ #
36
+ def self.keyword_shortcut
37
+ return KEYWORD_SHORT
38
+ end
39
+
40
+ # ---------------------------------------------------------------------
41
+ # Help
42
+ # ---------------------------------------------------------------------
43
+
44
+ #
45
+ # Get help for this verb.
46
+ #
47
+ def self.help
48
+ return <<~TEXT
49
+ WAIT VERB
50
+ NAME: wait
51
+ SHORTCUT: w
52
+
53
+ DESCRIPTION
54
+ Wait for the given number of seconds.
55
+
56
+ SYNTAX
57
+ wait <seconds>
58
+
59
+ PARAMETERS
60
+ seconds - The number of seconds.
61
+ If no value is given, we'll wait for 1 second.
62
+
63
+ RESULT
64
+ None
65
+
66
+ ERRORS
67
+ None
68
+ TEXT
69
+ end
70
+
71
+ end
72
+ end
73
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gloo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Crane
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2020-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,20 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '13.0'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 13.0.1
48
51
  type: :development
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
55
  - - "~>"
53
56
  - !ruby/object:Gem::Version
54
- version: '10.0'
57
+ version: '13.0'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 13.0.1
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: activesupport
57
63
  requirement: !ruby/object:Gem::Requirement
@@ -132,6 +138,46 @@ dependencies:
132
138
  - - ">="
133
139
  - !ruby/object:Gem::Version
134
140
  version: 0.8.1
141
+ - !ruby/object:Gem::Dependency
142
+ name: json
143
+ requirement: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - "~>"
146
+ - !ruby/object:Gem::Version
147
+ version: '2.1'
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: 2.1.0
151
+ type: :runtime
152
+ prerelease: false
153
+ version_requirements: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - "~>"
156
+ - !ruby/object:Gem::Version
157
+ version: '2.1'
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: 2.1.0
161
+ - !ruby/object:Gem::Dependency
162
+ name: openssl
163
+ requirement: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: '2.1'
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: 2.1.0
171
+ type: :runtime
172
+ prerelease: false
173
+ version_requirements: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - "~>"
176
+ - !ruby/object:Gem::Version
177
+ version: '2.1'
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: 2.1.0
135
181
  description: A scripting languge to keep it all together.
136
182
  email:
137
183
  - eric.crane@mac.com
@@ -141,6 +187,7 @@ executables:
141
187
  extensions: []
142
188
  extra_rdoc_files: []
143
189
  files:
190
+ - ".DS_Store"
144
191
  - ".gitignore"
145
192
  - ".rubocop.yml"
146
193
  - ".travis.yml"
@@ -163,6 +210,9 @@ files:
163
210
  - lib/gloo/app/log.rb
164
211
  - lib/gloo/app/mode.rb
165
212
  - lib/gloo/app/settings.rb
213
+ - lib/gloo/convert/string_to_datetime.rb
214
+ - lib/gloo/convert/string_to_decimal.rb
215
+ - lib/gloo/convert/string_to_integer.rb
166
216
  - lib/gloo/core/baseo.rb
167
217
  - lib/gloo/core/dictionary.rb
168
218
  - lib/gloo/core/error.rb
@@ -177,30 +227,46 @@ files:
177
227
  - lib/gloo/core/op.rb
178
228
  - lib/gloo/core/parser.rb
179
229
  - lib/gloo/core/pn.rb
180
- - lib/gloo/core/runner.rb
181
230
  - lib/gloo/core/script.rb
182
231
  - lib/gloo/core/tokens.rb
183
232
  - lib/gloo/core/verb.rb
233
+ - lib/gloo/exec/dispatch.rb
234
+ - lib/gloo/exec/runner.rb
184
235
  - lib/gloo/expr/expression.rb
185
236
  - lib/gloo/expr/l_boolean.rb
237
+ - lib/gloo/expr/l_decimal.rb
186
238
  - lib/gloo/expr/l_integer.rb
187
239
  - lib/gloo/expr/l_string.rb
188
240
  - lib/gloo/expr/op_div.rb
189
241
  - lib/gloo/expr/op_minus.rb
190
242
  - lib/gloo/expr/op_mult.rb
191
243
  - lib/gloo/expr/op_plus.rb
244
+ - lib/gloo/objs/basic/alias.rb
192
245
  - lib/gloo/objs/basic/boolean.rb
193
246
  - lib/gloo/objs/basic/container.rb
247
+ - lib/gloo/objs/basic/decimal.rb
194
248
  - lib/gloo/objs/basic/integer.rb
195
249
  - lib/gloo/objs/basic/script.rb
196
250
  - lib/gloo/objs/basic/string.rb
197
251
  - lib/gloo/objs/basic/text.rb
198
252
  - lib/gloo/objs/basic/untyped.rb
253
+ - lib/gloo/objs/cli/banner.rb
254
+ - lib/gloo/objs/cli/bar.rb
199
255
  - lib/gloo/objs/cli/colorize.rb
200
256
  - lib/gloo/objs/cli/confirm.rb
257
+ - lib/gloo/objs/cli/menu.rb
258
+ - lib/gloo/objs/cli/menu_item.rb
259
+ - lib/gloo/objs/cli/pastel.rb
201
260
  - lib/gloo/objs/cli/prompt.rb
261
+ - lib/gloo/objs/cli/select.rb
202
262
  - lib/gloo/objs/ctrl/each.rb
263
+ - lib/gloo/objs/ctrl/repeat.rb
264
+ - lib/gloo/objs/data/markdown.rb
265
+ - lib/gloo/objs/data/table.rb
203
266
  - lib/gloo/objs/dev/git.rb
267
+ - lib/gloo/objs/dt/date.rb
268
+ - lib/gloo/objs/dt/datetime.rb
269
+ - lib/gloo/objs/dt/time.rb
204
270
  - lib/gloo/objs/ror/erb.rb
205
271
  - lib/gloo/objs/ror/eval.rb
206
272
  - lib/gloo/objs/snd/play.rb
@@ -209,8 +275,10 @@ files:
209
275
  - lib/gloo/objs/system/system.rb
210
276
  - lib/gloo/objs/web/http_get.rb
211
277
  - lib/gloo/objs/web/http_post.rb
278
+ - lib/gloo/objs/web/json.rb
212
279
  - lib/gloo/objs/web/slack.rb
213
280
  - lib/gloo/objs/web/teams.rb
281
+ - lib/gloo/objs/web/uri.rb
214
282
  - lib/gloo/persist/file_loader.rb
215
283
  - lib/gloo/persist/file_saver.rb
216
284
  - lib/gloo/persist/file_storage.rb
@@ -219,12 +287,14 @@ files:
219
287
  - lib/gloo/utils/words.rb
220
288
  - lib/gloo/verbs/alert.rb
221
289
  - lib/gloo/verbs/beep.rb
290
+ - lib/gloo/verbs/cls.rb
222
291
  - lib/gloo/verbs/context.rb
223
292
  - lib/gloo/verbs/create.rb
224
293
  - lib/gloo/verbs/help.rb
225
294
  - lib/gloo/verbs/if.rb
226
295
  - lib/gloo/verbs/list.rb
227
296
  - lib/gloo/verbs/load.rb
297
+ - lib/gloo/verbs/move.rb
228
298
  - lib/gloo/verbs/put.rb
229
299
  - lib/gloo/verbs/quit.rb
230
300
  - lib/gloo/verbs/run.rb
@@ -233,6 +303,7 @@ files:
233
303
  - lib/gloo/verbs/tell.rb
234
304
  - lib/gloo/verbs/unless.rb
235
305
  - lib/gloo/verbs/version.rb
306
+ - lib/gloo/verbs/wait.rb
236
307
  - lib/run.rb
237
308
  homepage: http://github.com/ecrane/gloo
238
309
  licenses:
@@ -1,26 +0,0 @@
1
- # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
- # Copyright:: Copyright (c) 2019 Eric Crane. All rights reserved.
3
- #
4
- # The Runner is a static helper function.
5
- # It is used to send the run command to verbs.
6
- #
7
-
8
- module Gloo
9
- module Core
10
- class Runner
11
-
12
- #
13
- # Dispatch run command to a verb.
14
- # We abstract this out in case there are things
15
- # that need to be done before or after a verb
16
- # is done running.
17
- #
18
- def self.go( verb )
19
- $engine.heap.error.start_tracking
20
- verb&.run
21
- $engine.heap.error.clear_if_no_errors
22
- end
23
-
24
- end
25
- end
26
- end