gloo 3.3.0 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/gloo.gemspec +8 -3
  4. data/lib/VERSION +1 -1
  5. data/lib/VERSION_NOTES +12 -0
  6. data/lib/gloo/app/engine.rb +1 -1
  7. data/lib/gloo/app/log.rb +15 -16
  8. data/lib/gloo/app/platform.rb +11 -90
  9. data/lib/gloo/app/prompt.rb +90 -0
  10. data/lib/gloo/app/table.rb +51 -0
  11. data/lib/gloo/core/gloo_system.rb +7 -14
  12. data/lib/gloo/objs/basic/container.rb +1 -2
  13. data/lib/gloo/objs/basic/integer.rb +23 -1
  14. data/lib/gloo/objs/basic/string.rb +116 -1
  15. data/lib/gloo/objs/basic/string_generator.rb +49 -0
  16. data/lib/gloo/objs/basic/text.rb +1 -17
  17. data/lib/gloo/objs/cli/menu.rb +5 -4
  18. data/lib/gloo/objs/cli/select.rb +3 -2
  19. data/lib/gloo/objs/data/markdown.rb +25 -30
  20. data/lib/gloo/objs/data/mysql.rb +39 -27
  21. data/lib/gloo/objs/data/pg.rb +1 -1
  22. data/lib/gloo/objs/data/query_result.rb +4 -9
  23. data/lib/gloo/objs/data/table.rb +1 -1
  24. data/lib/gloo/objs/security/cipher.rb +193 -0
  25. data/lib/gloo/objs/security/password.rb +167 -0
  26. data/lib/gloo/objs/system/file_handle.rb +1 -3
  27. data/lib/gloo/objs/web/json.rb +3 -0
  28. data/lib/gloo/objs/web_svr/page.rb +24 -8
  29. data/lib/gloo/objs/web_svr/partial.rb +7 -6
  30. data/lib/gloo/objs/web_svr/svr.rb +267 -14
  31. data/lib/gloo/persist/disc_mech.rb +8 -0
  32. data/lib/gloo/verbs/version.rb +1 -1
  33. data/lib/gloo/web_svr/asset.rb +34 -13
  34. data/lib/gloo/web_svr/config.rb +1 -1
  35. data/lib/gloo/web_svr/embedded_renderer.rb +1 -1
  36. data/lib/gloo/web_svr/handler.rb +6 -4
  37. data/lib/gloo/web_svr/request.rb +34 -8
  38. data/lib/gloo/web_svr/response.rb +14 -2
  39. data/lib/gloo/web_svr/response_code.rb +1 -1
  40. data/lib/gloo/web_svr/routing/router.rb +1 -2
  41. data/lib/gloo/web_svr/routing/show_routes.rb +4 -7
  42. data/lib/gloo/web_svr/server.rb +1 -1
  43. data/lib/gloo/web_svr/session.rb +161 -0
  44. data/lib/gloo/web_svr/table_renderer.rb +1 -1
  45. metadata +58 -27
  46. data/lib/gloo/objs/cli/banner.rb +0 -118
  47. data/lib/gloo/objs/cli/bar.rb +0 -133
  48. data/lib/gloo/objs/cli/pastel.rb +0 -104
  49. data/lib/gloo/objs/snd/play.rb +0 -48
  50. data/lib/gloo/objs/snd/say.rb +0 -98
@@ -1,104 +0,0 @@
1
- # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
- # Copyright:: Copyright (c) 2020 Eric Crane. All rights reserved.
3
- #
4
- # Show colorized output with the pastel gem.
5
- #
6
- require 'pastel'
7
-
8
- module Gloo
9
- module Objs
10
- class Pastel < Gloo::Core::Obj
11
-
12
- KEYWORD = 'pastel'.freeze
13
- KEYWORD_SHORT = 'pastel'.freeze
14
- TEXT = 'text'.freeze
15
- COLOR = 'color'.freeze
16
-
17
- #
18
- # The name of the object type.
19
- #
20
- def self.typename
21
- return KEYWORD
22
- end
23
-
24
- #
25
- # The short name of the object type.
26
- #
27
- def self.short_typename
28
- return KEYWORD_SHORT
29
- end
30
-
31
- #
32
- # Get the text from the child object.
33
- #
34
- def text_value
35
- o = find_child TEXT
36
- return '' unless o
37
-
38
- return o.value
39
- end
40
-
41
- #
42
- # Get the color from the child object.
43
- #
44
- def color_value
45
- o = find_child COLOR
46
- return '' unless o
47
-
48
- return o.value
49
- end
50
-
51
- # ---------------------------------------------------------------------
52
- # Children
53
- # ---------------------------------------------------------------------
54
-
55
- #
56
- # Does this object have children to add when an object
57
- # is created in interactive mode?
58
- # This does not apply during obj load, etc.
59
- #
60
- def add_children_on_create?
61
- return true
62
- end
63
-
64
- #
65
- # Add children to this object.
66
- # This is used by containers to add children needed
67
- # for default configurations.
68
- #
69
- def add_default_children
70
- fac = @engine.factory
71
- fac.create_string TEXT, '', self
72
- fac.create_string COLOR, '', self
73
- end
74
-
75
- # ---------------------------------------------------------------------
76
- # Messages
77
- # ---------------------------------------------------------------------
78
-
79
- #
80
- # Get a list of message names that this object receives.
81
- #
82
- def self.messages
83
- return super + %w[run show]
84
- end
85
-
86
- #
87
- # Alias to show the banner bar
88
- #
89
- def msg_run
90
- msg_show
91
- end
92
-
93
- #
94
- # Show the banner bar
95
- #
96
- def msg_show
97
- pastel = ::Pastel.new
98
- c = self.color_value.split( ' ' ).map( &:to_sym )
99
- puts pastel.decorate( self.text_value, *c )
100
- end
101
-
102
- end
103
- end
104
- end
@@ -1,48 +0,0 @@
1
- # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
- # Copyright:: Copyright (c) 2020 Eric Crane. All rights reserved.
3
- #
4
- # Play an audio file (MP3).
5
- #
6
-
7
- module Gloo
8
- module Objs
9
- class Play < Gloo::Core::Obj
10
-
11
- KEYWORD = 'play'.freeze
12
- KEYWORD_SHORT = 'play'.freeze
13
-
14
- #
15
- # The name of the object type.
16
- #
17
- def self.typename
18
- return KEYWORD
19
- end
20
-
21
- #
22
- # The short name of the object type.
23
- #
24
- def self.short_typename
25
- return KEYWORD_SHORT
26
- end
27
-
28
- # ---------------------------------------------------------------------
29
- # Messages
30
- # ---------------------------------------------------------------------
31
-
32
- #
33
- # Get a list of message names that this object receives.
34
- #
35
- def self.messages
36
- return super + [ 'run' ]
37
- end
38
-
39
- #
40
- # Play the audio file.
41
- #
42
- def msg_run
43
- system "afplay #{value}"
44
- end
45
-
46
- end
47
- end
48
- end
@@ -1,98 +0,0 @@
1
- # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
- # Copyright:: Copyright (c) 2020 Eric Crane. All rights reserved.
3
- #
4
- # Wrapper for the 'say something' function on the Mac.
5
- #
6
- require 'erb'
7
-
8
- module Gloo
9
- module Objs
10
- class Say < Gloo::Core::Obj
11
-
12
- KEYWORD = 'say'.freeze
13
- KEYWORD_SHORT = 'say'.freeze
14
- VOICE = 'voice'.freeze
15
- MSG = 'message'.freeze
16
- DEFAULT_MSG = 'talk to me'.freeze
17
-
18
- #
19
- # The name of the object type.
20
- #
21
- def self.typename
22
- return KEYWORD
23
- end
24
-
25
- #
26
- # The short name of the object type.
27
- #
28
- def self.short_typename
29
- return KEYWORD_SHORT
30
- end
31
-
32
- #
33
- # Get the voice to use.
34
- #
35
- def voice_value
36
- v = find_child VOICE
37
- return nil unless v
38
-
39
- return v.value
40
- end
41
-
42
- #
43
- # Get the message to speak.
44
- #
45
- def msg_value
46
- o = find_child MSG
47
- return nil unless o
48
-
49
- return o.value
50
- end
51
-
52
- # ---------------------------------------------------------------------
53
- # Children
54
- # ---------------------------------------------------------------------
55
-
56
- #
57
- # Does this object have children to add when an object
58
- # is created in interactive mode?
59
- # This does not apply during obj load, etc.
60
- #
61
- def add_children_on_create?
62
- return true
63
- end
64
-
65
- #
66
- # Add children to this object.
67
- # This is used by containers to add children needed
68
- # for default configurations.
69
- #
70
- def add_default_children
71
- fac = @engine.factory
72
- fac.create_string VOICE, '', self
73
- fac.create_string MSG, DEFAULT_MSG, self
74
- end
75
-
76
- # ---------------------------------------------------------------------
77
- # Messages
78
- # ---------------------------------------------------------------------
79
-
80
- #
81
- # Get a list of message names that this object receives.
82
- #
83
- def self.messages
84
- return super + [ 'run' ]
85
- end
86
-
87
- #
88
- # Have the computer 'speak' the message.
89
- #
90
- def msg_run
91
- v = voice_value.empty? ? '' : "-v '#{voice_value}'"
92
- cmd = "say #{v} '#{msg_value}'"
93
- system cmd
94
- end
95
-
96
- end
97
- end
98
- end