gloo-lang 0.9.0 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/lib/VERSION +1 -1
  3. data/lib/dependencies.rb +2 -2
  4. data/lib/{gloo_lang.rb → gloo-lang.rb} +7 -9
  5. data/lib/gloo_lang/app/args.rb +112 -0
  6. data/lib/gloo_lang/app/engine.rb +230 -0
  7. data/lib/gloo_lang/app/help.rb +156 -0
  8. data/lib/gloo_lang/app/log.rb +81 -0
  9. data/lib/gloo_lang/app/mode.rb +27 -0
  10. data/lib/gloo_lang/app/settings.rb +186 -0
  11. data/lib/gloo_lang/convert/converter.rb +35 -0
  12. data/lib/gloo_lang/convert/string_to_datetime.rb +21 -0
  13. data/lib/gloo_lang/convert/string_to_decimal.rb +20 -0
  14. data/lib/gloo_lang/convert/string_to_integer.rb +20 -0
  15. data/lib/gloo_lang/core/baseo.rb +30 -0
  16. data/lib/gloo_lang/core/dictionary.rb +181 -0
  17. data/lib/gloo_lang/core/error.rb +61 -0
  18. data/lib/gloo_lang/core/event_manager.rb +44 -0
  19. data/lib/gloo_lang/core/factory.rb +210 -0
  20. data/lib/gloo_lang/core/gloo_system.rb +266 -0
  21. data/lib/gloo_lang/core/heap.rb +52 -0
  22. data/lib/gloo_lang/core/here.rb +36 -0
  23. data/lib/gloo_lang/core/it.rb +36 -0
  24. data/lib/gloo_lang/core/literal.rb +30 -0
  25. data/lib/gloo_lang/core/obj.rb +303 -0
  26. data/lib/gloo_lang/core/obj_finder.rb +30 -0
  27. data/lib/gloo_lang/core/op.rb +40 -0
  28. data/lib/gloo_lang/core/parser.rb +59 -0
  29. data/lib/gloo_lang/core/pn.rb +188 -0
  30. data/lib/gloo_lang/core/tokens.rb +165 -0
  31. data/lib/gloo_lang/core/verb.rb +86 -0
  32. data/lib/gloo_lang/exec/action.rb +48 -0
  33. data/lib/gloo_lang/exec/dispatch.rb +40 -0
  34. data/lib/gloo_lang/exec/exec_env.rb +74 -0
  35. data/lib/gloo_lang/exec/runner.rb +45 -0
  36. data/lib/gloo_lang/exec/script.rb +49 -0
  37. data/lib/gloo_lang/exec/stack.rb +78 -0
  38. data/lib/gloo_lang/expr/expression.rb +118 -0
  39. data/lib/gloo_lang/expr/l_boolean.rb +36 -0
  40. data/lib/gloo_lang/expr/l_decimal.rb +39 -0
  41. data/lib/gloo_lang/expr/l_integer.rb +37 -0
  42. data/lib/gloo_lang/expr/l_string.rb +58 -0
  43. data/lib/gloo_lang/expr/op_div.rb +22 -0
  44. data/lib/gloo_lang/expr/op_minus.rb +22 -0
  45. data/lib/gloo_lang/expr/op_mult.rb +22 -0
  46. data/lib/gloo_lang/expr/op_plus.rb +24 -0
  47. data/lib/gloo_lang/help/app/application.txt +22 -0
  48. data/lib/gloo_lang/help/app/configuration.txt +7 -0
  49. data/lib/gloo_lang/help/app/default_help.txt +14 -0
  50. data/lib/gloo_lang/help/app/logging.txt +16 -0
  51. data/lib/gloo_lang/help/core/color.txt +31 -0
  52. data/lib/gloo_lang/help/core/error.txt +33 -0
  53. data/lib/gloo_lang/help/core/events.txt +21 -0
  54. data/lib/gloo_lang/help/core/gloo_system.txt +57 -0
  55. data/lib/gloo_lang/help/core/here.txt +30 -0
  56. data/lib/gloo_lang/help/core/it.txt +23 -0
  57. data/lib/gloo_lang/help/core/ops.txt +16 -0
  58. data/lib/gloo_lang/help/core/pathname.txt +29 -0
  59. data/lib/gloo_lang/help/objs/basic/alias.txt +36 -0
  60. data/lib/gloo_lang/help/objs/basic/boolean.txt +28 -0
  61. data/lib/gloo_lang/help/objs/basic/container.txt +33 -0
  62. data/lib/gloo_lang/help/objs/basic/decimal.txt +28 -0
  63. data/lib/gloo_lang/help/objs/basic/integer.txt +27 -0
  64. data/lib/gloo_lang/help/objs/basic/script.txt +29 -0
  65. data/lib/gloo_lang/help/objs/basic/string.txt +28 -0
  66. data/lib/gloo_lang/help/objs/basic/text.txt +27 -0
  67. data/lib/gloo_lang/help/objs/basic/untyped.txt +22 -0
  68. data/lib/gloo_lang/help/objs/cli/banner.txt +49 -0
  69. data/lib/gloo_lang/help/objs/cli/bar.txt +37 -0
  70. data/lib/gloo_lang/help/objs/cli/colorize.txt +33 -0
  71. data/lib/gloo_lang/help/objs/cli/confirm.txt +26 -0
  72. data/lib/gloo_lang/help/objs/cli/menu.txt +44 -0
  73. data/lib/gloo_lang/help/objs/cli/menu_item.txt +26 -0
  74. data/lib/gloo_lang/help/objs/cli/pastel.txt +43 -0
  75. data/lib/gloo_lang/help/objs/cli/prompt.txt +27 -0
  76. data/lib/gloo_lang/help/objs/cli/select.txt +34 -0
  77. data/lib/gloo_lang/help/objs/ctrl/each.txt +48 -0
  78. data/lib/gloo_lang/help/objs/ctrl/repeat.txt +38 -0
  79. data/lib/gloo_lang/help/objs/data/markdown.txt +25 -0
  80. data/lib/gloo_lang/help/objs/data/mysql.txt +40 -0
  81. data/lib/gloo_lang/help/objs/data/query.txt +37 -0
  82. data/lib/gloo_lang/help/objs/data/sqlite.txt +26 -0
  83. data/lib/gloo_lang/help/objs/data/table.txt +46 -0
  84. data/lib/gloo_lang/help/objs/dev/git_repo.txt +36 -0
  85. data/lib/gloo_lang/help/objs/dev/stats.txt +36 -0
  86. data/lib/gloo_lang/help/objs/dt/date.txt +23 -0
  87. data/lib/gloo_lang/help/objs/dt/datetime.txt +24 -0
  88. data/lib/gloo_lang/help/objs/dt/time.txt +23 -0
  89. data/lib/gloo_lang/help/objs/ror/erb.txt +37 -0
  90. data/lib/gloo_lang/help/objs/ror/eval.txt +24 -0
  91. data/lib/gloo_lang/help/objs/snd/play.txt +23 -0
  92. data/lib/gloo_lang/help/objs/snd/say.txt +28 -0
  93. data/lib/gloo_lang/help/objs/system/file.txt +48 -0
  94. data/lib/gloo_lang/help/objs/system/ssh_exec.txt +30 -0
  95. data/lib/gloo_lang/help/objs/system/system.txt +32 -0
  96. data/lib/gloo_lang/help/objs/web/http_get.txt +35 -0
  97. data/lib/gloo_lang/help/objs/web/http_post.txt +34 -0
  98. data/lib/gloo_lang/help/objs/web/json.txt +34 -0
  99. data/lib/gloo_lang/help/objs/web/slack.txt +33 -0
  100. data/lib/gloo_lang/help/objs/web/teams.txt +30 -0
  101. data/lib/gloo_lang/help/objs/web/uri.txt +38 -0
  102. data/lib/gloo_lang/help/verbs/alert.txt +33 -0
  103. data/lib/gloo_lang/help/verbs/beep.txt +25 -0
  104. data/lib/gloo_lang/help/verbs/cls.txt +24 -0
  105. data/lib/gloo_lang/help/verbs/context.txt +43 -0
  106. data/lib/gloo_lang/help/verbs/create.txt +33 -0
  107. data/lib/gloo_lang/help/verbs/execute.txt +27 -0
  108. data/lib/gloo_lang/help/verbs/help.txt +34 -0
  109. data/lib/gloo_lang/help/verbs/if.txt +37 -0
  110. data/lib/gloo_lang/help/verbs/list.txt +34 -0
  111. data/lib/gloo_lang/help/verbs/load.txt +38 -0
  112. data/lib/gloo_lang/help/verbs/move.txt +42 -0
  113. data/lib/gloo_lang/help/verbs/put.txt +38 -0
  114. data/lib/gloo_lang/help/verbs/quit.txt +25 -0
  115. data/lib/gloo_lang/help/verbs/run.txt +41 -0
  116. data/lib/gloo_lang/help/verbs/save.txt +26 -0
  117. data/lib/gloo_lang/help/verbs/show.txt +30 -0
  118. data/lib/gloo_lang/help/verbs/tell.txt +34 -0
  119. data/lib/gloo_lang/help/verbs/unless.txt +38 -0
  120. data/lib/gloo_lang/help/verbs/version.txt +32 -0
  121. data/lib/gloo_lang/help/verbs/wait.txt +29 -0
  122. data/lib/gloo_lang/objs/basic/alias.rb +78 -0
  123. data/lib/gloo_lang/objs/basic/boolean.rb +120 -0
  124. data/lib/gloo_lang/objs/basic/container.rb +76 -0
  125. data/lib/gloo_lang/objs/basic/decimal.rb +76 -0
  126. data/lib/gloo_lang/objs/basic/integer.rb +73 -0
  127. data/lib/gloo_lang/objs/basic/script.rb +99 -0
  128. data/lib/gloo_lang/objs/basic/string.rb +77 -0
  129. data/lib/gloo_lang/objs/basic/text.rb +87 -0
  130. data/lib/gloo_lang/objs/basic/untyped.rb +41 -0
  131. data/lib/gloo_lang/objs/cli/banner.rb +108 -0
  132. data/lib/gloo_lang/objs/cli/bar.rb +133 -0
  133. data/lib/gloo_lang/objs/cli/colorize.rb +73 -0
  134. data/lib/gloo_lang/objs/cli/confirm.rb +96 -0
  135. data/lib/gloo_lang/objs/cli/menu.rb +206 -0
  136. data/lib/gloo_lang/objs/cli/menu_item.rb +95 -0
  137. data/lib/gloo_lang/objs/cli/pastel.rb +97 -0
  138. data/lib/gloo_lang/objs/cli/prompt.rb +110 -0
  139. data/lib/gloo_lang/objs/cli/select.rb +126 -0
  140. data/lib/gloo_lang/objs/ctrl/each.rb +279 -0
  141. data/lib/gloo_lang/objs/ctrl/repeat.rb +108 -0
  142. data/lib/gloo_lang/objs/data/markdown.rb +84 -0
  143. data/lib/gloo_lang/objs/data/mysql.rb +192 -0
  144. data/lib/gloo_lang/objs/data/query.rb +176 -0
  145. data/lib/gloo_lang/objs/data/sqlite.rb +159 -0
  146. data/lib/gloo_lang/objs/data/table.rb +140 -0
  147. data/lib/gloo_lang/objs/dev/git.rb +140 -0
  148. data/lib/gloo_lang/objs/dev/stats.rb +120 -0
  149. data/lib/gloo_lang/objs/dt/date.rb +50 -0
  150. data/lib/gloo_lang/objs/dt/datetime.rb +62 -0
  151. data/lib/gloo_lang/objs/dt/time.rb +50 -0
  152. data/lib/gloo_lang/objs/ror/erb.rb +116 -0
  153. data/lib/gloo_lang/objs/ror/eval.rb +107 -0
  154. data/lib/gloo_lang/objs/snd/play.rb +48 -0
  155. data/lib/gloo_lang/objs/snd/say.rb +98 -0
  156. data/lib/gloo_lang/objs/system/file_handle.rb +138 -0
  157. data/lib/gloo_lang/objs/system/ssh_exec.rb +126 -0
  158. data/lib/gloo_lang/objs/system/system.rb +136 -0
  159. data/lib/gloo_lang/objs/web/http_get.rb +159 -0
  160. data/lib/gloo_lang/objs/web/http_post.rb +183 -0
  161. data/lib/gloo_lang/objs/web/json.rb +135 -0
  162. data/lib/gloo_lang/objs/web/slack.rb +130 -0
  163. data/lib/gloo_lang/objs/web/teams.rb +117 -0
  164. data/lib/gloo_lang/objs/web/uri.rb +148 -0
  165. data/lib/gloo_lang/persist/file_loader.rb +191 -0
  166. data/lib/gloo_lang/persist/file_saver.rb +49 -0
  167. data/lib/gloo_lang/persist/file_storage.rb +45 -0
  168. data/lib/gloo_lang/persist/line_splitter.rb +81 -0
  169. data/lib/gloo_lang/persist/persist_man.rb +120 -0
  170. data/lib/gloo_lang/utils/format.rb +21 -0
  171. data/lib/gloo_lang/utils/stats.rb +205 -0
  172. data/lib/gloo_lang/utils/words.rb +19 -0
  173. data/lib/gloo_lang/verbs/alert.rb +79 -0
  174. data/lib/gloo_lang/verbs/beep.rb +40 -0
  175. data/lib/gloo_lang/verbs/cls.rb +37 -0
  176. data/lib/gloo_lang/verbs/context.rb +62 -0
  177. data/lib/gloo_lang/verbs/create.rb +68 -0
  178. data/lib/gloo_lang/verbs/execute.rb +56 -0
  179. data/lib/gloo_lang/verbs/help.rb +264 -0
  180. data/lib/gloo_lang/verbs/if.rb +92 -0
  181. data/lib/gloo_lang/verbs/list.rb +98 -0
  182. data/lib/gloo_lang/verbs/load.rb +45 -0
  183. data/lib/gloo_lang/verbs/move.rb +89 -0
  184. data/lib/gloo_lang/verbs/put.rb +94 -0
  185. data/lib/gloo_lang/verbs/quit.rb +40 -0
  186. data/lib/gloo_lang/verbs/run.rb +75 -0
  187. data/lib/gloo_lang/verbs/save.rb +39 -0
  188. data/lib/gloo_lang/verbs/show.rb +64 -0
  189. data/lib/gloo_lang/verbs/tell.rb +79 -0
  190. data/lib/gloo_lang/verbs/unless.rb +92 -0
  191. data/lib/gloo_lang/verbs/version.rb +37 -0
  192. data/lib/gloo_lang/verbs/wait.rb +42 -0
  193. metadata +191 -3
@@ -0,0 +1,75 @@
1
+ # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
+ # Copyright:: Copyright (c) 2019 Eric Crane. All rights reserved.
3
+ #
4
+ # Run a script.
5
+ # Shortcut for telling a script to run.
6
+ #
7
+
8
+ module GlooLang
9
+ module Verbs
10
+ class Run < GlooLang::Core::Verb
11
+
12
+ KEYWORD = 'run'.freeze
13
+ KEYWORD_SHORT = 'r'.freeze
14
+ EVALUATE_RUN = '~>'.freeze
15
+ MISSING_EXPR_ERR = 'Missing Expression!'.freeze
16
+
17
+ #
18
+ # Run the verb.
19
+ #
20
+ def run
21
+ if @tokens.token_count < 2
22
+ $engine.err MISSING_EXPR_ERR
23
+ return
24
+ end
25
+
26
+ if @tokens.second == EVALUATE_RUN
27
+ run_expression
28
+ else
29
+ run_script
30
+ end
31
+ end
32
+
33
+ #
34
+ # Get the Verb's keyword.
35
+ #
36
+ def self.keyword
37
+ return KEYWORD
38
+ end
39
+
40
+ #
41
+ # Get the Verb's keyword shortcut.
42
+ #
43
+ def self.keyword_shortcut
44
+ return KEYWORD_SHORT
45
+ end
46
+
47
+ # ---------------------------------------------------------------------
48
+ # Private functions
49
+ # ---------------------------------------------------------------------
50
+
51
+ private
52
+
53
+ #
54
+ # Run a script specified by pathname
55
+ #
56
+ def run_script
57
+ GlooLang::Exec::Runner.run @tokens.second
58
+ end
59
+
60
+ #
61
+ # Evaluate an expression and run that.
62
+ #
63
+ def run_expression
64
+ unless @tokens.token_count > 2
65
+ $engine.err MISSING_EXPR_ERR
66
+ return
67
+ end
68
+
69
+ expr = GlooLang::Expr::Expression.new( @tokens.params[ 1..-1 ] )
70
+ $engine.parser.run expr.evaluate
71
+ end
72
+
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,39 @@
1
+ # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
+ # Copyright:: Copyright (c) 2019 Eric Crane. All rights reserved.
3
+ #
4
+ # Save an object to a file or other persistance mechcanism.
5
+ #
6
+
7
+ module GlooLang
8
+ module Verbs
9
+ class Save < GlooLang::Core::Verb
10
+
11
+ KEYWORD = 'save'.freeze
12
+ KEYWORD_SHORT = '>'.freeze
13
+
14
+ #
15
+ # Run the verb.
16
+ #
17
+ def run
18
+ # TODO: Not currently using folders or keeping
19
+ # track of where the object was loaded from.
20
+ $engine.persist_man.save @tokens.second
21
+ end
22
+
23
+ #
24
+ # Get the Verb's keyword.
25
+ #
26
+ def self.keyword
27
+ return KEYWORD
28
+ end
29
+
30
+ #
31
+ # Get the Verb's keyword shortcut.
32
+ #
33
+ def self.keyword_shortcut
34
+ return KEYWORD_SHORT
35
+ end
36
+
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,64 @@
1
+ # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
+ # Copyright:: Copyright (c) 2019 Eric Crane. All rights reserved.
3
+ #
4
+ # Show a single object's value.
5
+ #
6
+ require 'colorized_string'
7
+
8
+ module GlooLang
9
+ module Verbs
10
+ class Show < GlooLang::Core::Verb
11
+
12
+ KEYWORD = 'show'.freeze
13
+ KEYWORD_SHORT = '='.freeze
14
+
15
+ #
16
+ # Run the verb.
17
+ #
18
+ def run
19
+ if @tokens.token_count > 1
20
+ expr = GlooLang::Expr::Expression.new( @tokens.params )
21
+ result = expr.evaluate
22
+ $log.show get_formatted_string( result )
23
+ $engine.heap.it.set_to result
24
+ else
25
+ $log.show ''
26
+ end
27
+ end
28
+
29
+ #
30
+ # Get the Verb's keyword.
31
+ #
32
+ def self.keyword
33
+ return KEYWORD
34
+ end
35
+
36
+ #
37
+ # Get the Verb's keyword shortcut.
38
+ #
39
+ def self.keyword_shortcut
40
+ return KEYWORD_SHORT
41
+ end
42
+
43
+ # ---------------------------------------------------------------------
44
+ # Private functions
45
+ # ---------------------------------------------------------------------
46
+
47
+ private
48
+
49
+ #
50
+ # Get the formatted string.
51
+ #
52
+ def get_formatted_string( str )
53
+ if @params&.token_count&.positive?
54
+ expr = GlooLang::Expr::Expression.new( @params.tokens )
55
+ val = expr.evaluate
56
+ color = val.to_sym
57
+ return ColorizedString[ str.to_s ].colorize( color )
58
+ end
59
+ return str
60
+ end
61
+
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,79 @@
1
+ # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
+ # Copyright:: Copyright (c) 2019 Eric Crane. All rights reserved.
3
+ #
4
+ # Create an object, optionally of a type.
5
+ #
6
+
7
+ module GlooLang
8
+ module Verbs
9
+ class Tell < GlooLang::Core::Verb
10
+
11
+ KEYWORD = 'tell'.freeze
12
+ KEYWORD_SHORT = '->'.freeze
13
+ TO = 'to'.freeze
14
+ OBJ_NOT_FOUND_ERR = 'Object was not found: '.freeze
15
+ UNKNOWN_MSG_ERR = 'Missing message!'.freeze
16
+
17
+ #
18
+ # Run the verb.
19
+ #
20
+ def run
21
+ setup_msg
22
+ return unless @msg
23
+
24
+ setup_target
25
+ dispatch_msg
26
+ end
27
+
28
+ #
29
+ # Get the Verb's keyword.
30
+ #
31
+ def self.keyword
32
+ return KEYWORD
33
+ end
34
+
35
+ #
36
+ # Get the Verb's keyword shortcut.
37
+ #
38
+ def self.keyword_shortcut
39
+ return KEYWORD_SHORT
40
+ end
41
+
42
+ # ---------------------------------------------------------------------
43
+ # Private functions
44
+ # ---------------------------------------------------------------------
45
+
46
+ private
47
+
48
+ #
49
+ # Lookup the message to send.
50
+ #
51
+ def setup_msg
52
+ @msg = @tokens.after_token( TO )
53
+
54
+ $engine.err( UNKNOWN_MSG_ERR ) unless @msg
55
+ end
56
+
57
+ #
58
+ # Setup the target of the message.
59
+ #
60
+ def setup_target
61
+ @obj_name = @tokens.second
62
+ pn = GlooLang::Core::Pn.new @obj_name
63
+ @target_obj = pn.resolve
64
+ end
65
+
66
+ #
67
+ # Dispatch the message to the target object.
68
+ #
69
+ def dispatch_msg
70
+ if @target_obj
71
+ GlooLang::Exec::Dispatch.message @msg, @target_obj, @params
72
+ else
73
+ $engine.err "#{OBJ_NOT_FOUND_ERR} #{@obj_name}"
74
+ end
75
+ end
76
+
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,92 @@
1
+ # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
+ # Copyright:: Copyright (c) 2019 Eric Crane. All rights reserved.
3
+ #
4
+ # If something is false, do something.
5
+ #
6
+
7
+ module GlooLang
8
+ module Verbs
9
+ class Unless < GlooLang::Core::Verb
10
+
11
+ KEYWORD = 'unless'.freeze
12
+ KEYWORD_SHORT = 'if!'.freeze
13
+ DO = 'do'.freeze
14
+ MISSING_EXPR_ERR = 'Missing Expression!'.freeze
15
+
16
+ #
17
+ # Run the verb.
18
+ #
19
+ def run
20
+ value = value_tokens
21
+ return if value.nil?
22
+
23
+ return unless evals_false( value )
24
+
25
+ run_do
26
+ end
27
+
28
+ #
29
+ # Get the Verb's keyword.
30
+ #
31
+ def self.keyword
32
+ return KEYWORD
33
+ end
34
+
35
+ #
36
+ # Get the Verb's keyword shortcut.
37
+ #
38
+ def self.keyword_shortcut
39
+ return KEYWORD_SHORT
40
+ end
41
+
42
+ # ---------------------------------------------------------------------
43
+ # Private functions
44
+ # ---------------------------------------------------------------------
45
+
46
+ private
47
+
48
+ #
49
+ # Get the list of tokens that represent the parameters
50
+ # of the unless command.
51
+ #
52
+ def value_tokens
53
+ value = @tokens.before_token( DO )
54
+ if value && value.count > 1
55
+ # The first token is the verb, so we drop it.
56
+ value = value[ 1..-1 ]
57
+ else
58
+ $engine.err MISSING_EXPR_ERR
59
+ end
60
+
61
+ return value
62
+ end
63
+
64
+ #
65
+ # Does the given value evalute to true?
66
+ #
67
+ def evals_false( value )
68
+ eval_result = false
69
+ if value.count.positive?
70
+ expr = GlooLang::Expr::Expression.new( value )
71
+ result = expr.evaluate
72
+ eval_result = true if result == false
73
+ eval_result = true if result.is_a?( Numeric ) && result.zero?
74
+ end
75
+
76
+ return eval_result
77
+ end
78
+
79
+ #
80
+ # Run the 'do' command.
81
+ #
82
+ def run_do
83
+ cmd = @tokens.expr_after( DO )
84
+ i = $engine.parser.parse_immediate cmd
85
+ return unless i
86
+
87
+ i.run
88
+ end
89
+
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,37 @@
1
+ # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
+ # Copyright:: Copyright (c) 2019 Eric Crane. All rights reserved.
3
+ #
4
+ # Show the current application version.
5
+ #
6
+
7
+ module GlooLang
8
+ module Verbs
9
+ class Version < GlooLang::Core::Verb
10
+
11
+ KEYWORD = 'version'.freeze
12
+ KEYWORD_SHORT = 'v'.freeze
13
+
14
+ #
15
+ # Run the verb.
16
+ #
17
+ def run
18
+ $log.show GlooLang::App::Info.full_version
19
+ end
20
+
21
+ #
22
+ # Get the Verb's keyword.
23
+ #
24
+ def self.keyword
25
+ return KEYWORD
26
+ end
27
+
28
+ #
29
+ # Get the Verb's keyword shortcut.
30
+ #
31
+ def self.keyword_shortcut
32
+ return KEYWORD_SHORT
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,42 @@
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 GlooLang
8
+ module Verbs
9
+ class Wait < GlooLang::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 = GlooLang::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
+ end
41
+ end
42
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gloo-lang
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Crane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-24 00:00:00.000000000 Z
11
+ date: 2022-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -157,8 +157,196 @@ files:
157
157
  - gloo-lang.gemspec
158
158
  - lib/VERSION
159
159
  - lib/dependencies.rb
160
- - lib/gloo_lang.rb
160
+ - lib/gloo-lang.rb
161
+ - lib/gloo_lang/app/args.rb
162
+ - lib/gloo_lang/app/engine.rb
163
+ - lib/gloo_lang/app/help.rb
161
164
  - lib/gloo_lang/app/info.rb
165
+ - lib/gloo_lang/app/log.rb
166
+ - lib/gloo_lang/app/mode.rb
167
+ - lib/gloo_lang/app/settings.rb
168
+ - lib/gloo_lang/convert/converter.rb
169
+ - lib/gloo_lang/convert/string_to_datetime.rb
170
+ - lib/gloo_lang/convert/string_to_decimal.rb
171
+ - lib/gloo_lang/convert/string_to_integer.rb
172
+ - lib/gloo_lang/core/baseo.rb
173
+ - lib/gloo_lang/core/dictionary.rb
174
+ - lib/gloo_lang/core/error.rb
175
+ - lib/gloo_lang/core/event_manager.rb
176
+ - lib/gloo_lang/core/factory.rb
177
+ - lib/gloo_lang/core/gloo_system.rb
178
+ - lib/gloo_lang/core/heap.rb
179
+ - lib/gloo_lang/core/here.rb
180
+ - lib/gloo_lang/core/it.rb
181
+ - lib/gloo_lang/core/literal.rb
182
+ - lib/gloo_lang/core/obj.rb
183
+ - lib/gloo_lang/core/obj_finder.rb
184
+ - lib/gloo_lang/core/op.rb
185
+ - lib/gloo_lang/core/parser.rb
186
+ - lib/gloo_lang/core/pn.rb
187
+ - lib/gloo_lang/core/tokens.rb
188
+ - lib/gloo_lang/core/verb.rb
189
+ - lib/gloo_lang/exec/action.rb
190
+ - lib/gloo_lang/exec/dispatch.rb
191
+ - lib/gloo_lang/exec/exec_env.rb
192
+ - lib/gloo_lang/exec/runner.rb
193
+ - lib/gloo_lang/exec/script.rb
194
+ - lib/gloo_lang/exec/stack.rb
195
+ - lib/gloo_lang/expr/expression.rb
196
+ - lib/gloo_lang/expr/l_boolean.rb
197
+ - lib/gloo_lang/expr/l_decimal.rb
198
+ - lib/gloo_lang/expr/l_integer.rb
199
+ - lib/gloo_lang/expr/l_string.rb
200
+ - lib/gloo_lang/expr/op_div.rb
201
+ - lib/gloo_lang/expr/op_minus.rb
202
+ - lib/gloo_lang/expr/op_mult.rb
203
+ - lib/gloo_lang/expr/op_plus.rb
204
+ - lib/gloo_lang/help/app/application.txt
205
+ - lib/gloo_lang/help/app/configuration.txt
206
+ - lib/gloo_lang/help/app/default_help.txt
207
+ - lib/gloo_lang/help/app/logging.txt
208
+ - lib/gloo_lang/help/core/color.txt
209
+ - lib/gloo_lang/help/core/error.txt
210
+ - lib/gloo_lang/help/core/events.txt
211
+ - lib/gloo_lang/help/core/gloo_system.txt
212
+ - lib/gloo_lang/help/core/here.txt
213
+ - lib/gloo_lang/help/core/it.txt
214
+ - lib/gloo_lang/help/core/ops.txt
215
+ - lib/gloo_lang/help/core/pathname.txt
216
+ - lib/gloo_lang/help/objs/basic/alias.txt
217
+ - lib/gloo_lang/help/objs/basic/boolean.txt
218
+ - lib/gloo_lang/help/objs/basic/container.txt
219
+ - lib/gloo_lang/help/objs/basic/decimal.txt
220
+ - lib/gloo_lang/help/objs/basic/integer.txt
221
+ - lib/gloo_lang/help/objs/basic/script.txt
222
+ - lib/gloo_lang/help/objs/basic/string.txt
223
+ - lib/gloo_lang/help/objs/basic/text.txt
224
+ - lib/gloo_lang/help/objs/basic/untyped.txt
225
+ - lib/gloo_lang/help/objs/cli/banner.txt
226
+ - lib/gloo_lang/help/objs/cli/bar.txt
227
+ - lib/gloo_lang/help/objs/cli/colorize.txt
228
+ - lib/gloo_lang/help/objs/cli/confirm.txt
229
+ - lib/gloo_lang/help/objs/cli/menu.txt
230
+ - lib/gloo_lang/help/objs/cli/menu_item.txt
231
+ - lib/gloo_lang/help/objs/cli/pastel.txt
232
+ - lib/gloo_lang/help/objs/cli/prompt.txt
233
+ - lib/gloo_lang/help/objs/cli/select.txt
234
+ - lib/gloo_lang/help/objs/ctrl/each.txt
235
+ - lib/gloo_lang/help/objs/ctrl/repeat.txt
236
+ - lib/gloo_lang/help/objs/data/markdown.txt
237
+ - lib/gloo_lang/help/objs/data/mysql.txt
238
+ - lib/gloo_lang/help/objs/data/query.txt
239
+ - lib/gloo_lang/help/objs/data/sqlite.txt
240
+ - lib/gloo_lang/help/objs/data/table.txt
241
+ - lib/gloo_lang/help/objs/dev/git_repo.txt
242
+ - lib/gloo_lang/help/objs/dev/stats.txt
243
+ - lib/gloo_lang/help/objs/dt/date.txt
244
+ - lib/gloo_lang/help/objs/dt/datetime.txt
245
+ - lib/gloo_lang/help/objs/dt/time.txt
246
+ - lib/gloo_lang/help/objs/ror/erb.txt
247
+ - lib/gloo_lang/help/objs/ror/eval.txt
248
+ - lib/gloo_lang/help/objs/snd/play.txt
249
+ - lib/gloo_lang/help/objs/snd/say.txt
250
+ - lib/gloo_lang/help/objs/system/file.txt
251
+ - lib/gloo_lang/help/objs/system/ssh_exec.txt
252
+ - lib/gloo_lang/help/objs/system/system.txt
253
+ - lib/gloo_lang/help/objs/web/http_get.txt
254
+ - lib/gloo_lang/help/objs/web/http_post.txt
255
+ - lib/gloo_lang/help/objs/web/json.txt
256
+ - lib/gloo_lang/help/objs/web/slack.txt
257
+ - lib/gloo_lang/help/objs/web/teams.txt
258
+ - lib/gloo_lang/help/objs/web/uri.txt
259
+ - lib/gloo_lang/help/verbs/alert.txt
260
+ - lib/gloo_lang/help/verbs/beep.txt
261
+ - lib/gloo_lang/help/verbs/cls.txt
262
+ - lib/gloo_lang/help/verbs/context.txt
263
+ - lib/gloo_lang/help/verbs/create.txt
264
+ - lib/gloo_lang/help/verbs/execute.txt
265
+ - lib/gloo_lang/help/verbs/help.txt
266
+ - lib/gloo_lang/help/verbs/if.txt
267
+ - lib/gloo_lang/help/verbs/list.txt
268
+ - lib/gloo_lang/help/verbs/load.txt
269
+ - lib/gloo_lang/help/verbs/move.txt
270
+ - lib/gloo_lang/help/verbs/put.txt
271
+ - lib/gloo_lang/help/verbs/quit.txt
272
+ - lib/gloo_lang/help/verbs/run.txt
273
+ - lib/gloo_lang/help/verbs/save.txt
274
+ - lib/gloo_lang/help/verbs/show.txt
275
+ - lib/gloo_lang/help/verbs/tell.txt
276
+ - lib/gloo_lang/help/verbs/unless.txt
277
+ - lib/gloo_lang/help/verbs/version.txt
278
+ - lib/gloo_lang/help/verbs/wait.txt
279
+ - lib/gloo_lang/objs/basic/alias.rb
280
+ - lib/gloo_lang/objs/basic/boolean.rb
281
+ - lib/gloo_lang/objs/basic/container.rb
282
+ - lib/gloo_lang/objs/basic/decimal.rb
283
+ - lib/gloo_lang/objs/basic/integer.rb
284
+ - lib/gloo_lang/objs/basic/script.rb
285
+ - lib/gloo_lang/objs/basic/string.rb
286
+ - lib/gloo_lang/objs/basic/text.rb
287
+ - lib/gloo_lang/objs/basic/untyped.rb
288
+ - lib/gloo_lang/objs/cli/banner.rb
289
+ - lib/gloo_lang/objs/cli/bar.rb
290
+ - lib/gloo_lang/objs/cli/colorize.rb
291
+ - lib/gloo_lang/objs/cli/confirm.rb
292
+ - lib/gloo_lang/objs/cli/menu.rb
293
+ - lib/gloo_lang/objs/cli/menu_item.rb
294
+ - lib/gloo_lang/objs/cli/pastel.rb
295
+ - lib/gloo_lang/objs/cli/prompt.rb
296
+ - lib/gloo_lang/objs/cli/select.rb
297
+ - lib/gloo_lang/objs/ctrl/each.rb
298
+ - lib/gloo_lang/objs/ctrl/repeat.rb
299
+ - lib/gloo_lang/objs/data/markdown.rb
300
+ - lib/gloo_lang/objs/data/mysql.rb
301
+ - lib/gloo_lang/objs/data/query.rb
302
+ - lib/gloo_lang/objs/data/sqlite.rb
303
+ - lib/gloo_lang/objs/data/table.rb
304
+ - lib/gloo_lang/objs/dev/git.rb
305
+ - lib/gloo_lang/objs/dev/stats.rb
306
+ - lib/gloo_lang/objs/dt/date.rb
307
+ - lib/gloo_lang/objs/dt/datetime.rb
308
+ - lib/gloo_lang/objs/dt/time.rb
309
+ - lib/gloo_lang/objs/ror/erb.rb
310
+ - lib/gloo_lang/objs/ror/eval.rb
311
+ - lib/gloo_lang/objs/snd/play.rb
312
+ - lib/gloo_lang/objs/snd/say.rb
313
+ - lib/gloo_lang/objs/system/file_handle.rb
314
+ - lib/gloo_lang/objs/system/ssh_exec.rb
315
+ - lib/gloo_lang/objs/system/system.rb
316
+ - lib/gloo_lang/objs/web/http_get.rb
317
+ - lib/gloo_lang/objs/web/http_post.rb
318
+ - lib/gloo_lang/objs/web/json.rb
319
+ - lib/gloo_lang/objs/web/slack.rb
320
+ - lib/gloo_lang/objs/web/teams.rb
321
+ - lib/gloo_lang/objs/web/uri.rb
322
+ - lib/gloo_lang/persist/file_loader.rb
323
+ - lib/gloo_lang/persist/file_saver.rb
324
+ - lib/gloo_lang/persist/file_storage.rb
325
+ - lib/gloo_lang/persist/line_splitter.rb
326
+ - lib/gloo_lang/persist/persist_man.rb
327
+ - lib/gloo_lang/utils/format.rb
328
+ - lib/gloo_lang/utils/stats.rb
329
+ - lib/gloo_lang/utils/words.rb
330
+ - lib/gloo_lang/verbs/alert.rb
331
+ - lib/gloo_lang/verbs/beep.rb
332
+ - lib/gloo_lang/verbs/cls.rb
333
+ - lib/gloo_lang/verbs/context.rb
334
+ - lib/gloo_lang/verbs/create.rb
335
+ - lib/gloo_lang/verbs/execute.rb
336
+ - lib/gloo_lang/verbs/help.rb
337
+ - lib/gloo_lang/verbs/if.rb
338
+ - lib/gloo_lang/verbs/list.rb
339
+ - lib/gloo_lang/verbs/load.rb
340
+ - lib/gloo_lang/verbs/move.rb
341
+ - lib/gloo_lang/verbs/put.rb
342
+ - lib/gloo_lang/verbs/quit.rb
343
+ - lib/gloo_lang/verbs/run.rb
344
+ - lib/gloo_lang/verbs/save.rb
345
+ - lib/gloo_lang/verbs/show.rb
346
+ - lib/gloo_lang/verbs/tell.rb
347
+ - lib/gloo_lang/verbs/unless.rb
348
+ - lib/gloo_lang/verbs/version.rb
349
+ - lib/gloo_lang/verbs/wait.rb
162
350
  homepage: http://github.com/ecrane/gloo_lang
163
351
  licenses:
164
352
  - MIT