gloo-lang 0.9.11 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/gloo-lang.gemspec +1 -3
- data/lib/VERSION +1 -1
- data/lib/gloo_lang/app/engine.rb +50 -2
- data/lib/gloo_lang/app/log.rb +42 -1
- data/lib/gloo_lang/core/heap.rb +2 -2
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eaf0cc0e5ed992c2a11536a38506170a840099823bacd260b0e2bf6e4384dd14
|
4
|
+
data.tar.gz: c07498a7140679627f936db05d0d71b69c2853e4e87fe504cf7182ac47eb38f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5667685e248cd7fba038d9913c766ab3bfe899a7333d07977b517168eacf6d6b5843cb7a8d4e750dd02e94f7faf2c5921775cce2920ad6ac59913ba89bc9b9ee
|
7
|
+
data.tar.gz: 425a61000ca83a501a656e01c241e927a7de3d909058d1760266a5d026128e103ea69d412443d2a1a78a5247412799bbf68a6ee0ddbe55bfc5eddbc9595220e0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gloo-lang (0.
|
4
|
+
gloo-lang (1.0.1)
|
5
5
|
activesupport (~> 6.1, >= 6.1.4.6)
|
6
6
|
chronic (~> 0.10, >= 0.10.2)
|
7
7
|
json (~> 2.1, >= 2.1.0)
|
@@ -60,7 +60,7 @@ PLATFORMS
|
|
60
60
|
DEPENDENCIES
|
61
61
|
bundler (~> 2.2.22)
|
62
62
|
gloo-lang!
|
63
|
-
minitest (~> 5.
|
63
|
+
minitest (~> 5.1, >= 5.14.2)
|
64
64
|
rake (~> 13.0, >= 13.0.1)
|
65
65
|
rubocop
|
66
66
|
|
data/gloo-lang.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
26
|
spec.add_development_dependency 'bundler', '~> 2.2.22'
|
27
|
-
spec.add_development_dependency 'minitest', '~> 5.
|
27
|
+
spec.add_development_dependency 'minitest', '~> 5.1', '>= 5.14.2'
|
28
28
|
spec.add_development_dependency "rake", '~> 13.0', '>= 13.0.1'
|
29
29
|
|
30
30
|
spec.add_dependency "activesupport", '~> 6.1', ">= 6.1.4.6"
|
@@ -33,6 +33,4 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_dependency 'openssl', '~> 2.1', '>= 2.1.0'
|
34
34
|
spec.add_dependency 'net-ssh', '~> 6.1', '>= 6.1.0'
|
35
35
|
spec.add_dependency 'tty-platform', '~> 0.3', '>= 0.3.0'
|
36
|
-
# spec.add_dependency 'mysql2', '~> 0.5', '>= 0.5.3'
|
37
|
-
# spec.add_dependency 'sqlite3', '~> 1.4', '>= 1.4.2'
|
38
36
|
end
|
data/lib/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
1.0.2
|
data/lib/gloo_lang/app/engine.rb
CHANGED
@@ -24,8 +24,11 @@ module GlooLang
|
|
24
24
|
@args = Args.new( self, context.params )
|
25
25
|
@settings = Settings.new( self, context.user_root )
|
26
26
|
|
27
|
-
@log =
|
27
|
+
@log = context.log.new( self, @args.quiet? )
|
28
|
+
@log.debug "log (class: #{@log.class.name}) in use ..."
|
29
|
+
|
28
30
|
@platform = context.platform
|
31
|
+
@log.debug "platform (class: #{@platform.class.name}) in use ..."
|
29
32
|
|
30
33
|
@log.debug 'engine intialized...'
|
31
34
|
end
|
@@ -56,6 +59,42 @@ module GlooLang
|
|
56
59
|
run_mode
|
57
60
|
end
|
58
61
|
|
62
|
+
# ---------------------------------------------------------------------
|
63
|
+
# Serialization
|
64
|
+
# ---------------------------------------------------------------------
|
65
|
+
|
66
|
+
#
|
67
|
+
# Prepare for serialization by removing any file references.
|
68
|
+
# Without this, the engine cannot be serialized.
|
69
|
+
#
|
70
|
+
def prep_serialize
|
71
|
+
@log.prep_serialize
|
72
|
+
end
|
73
|
+
|
74
|
+
#
|
75
|
+
# Get the serialized version of this Engine.
|
76
|
+
#
|
77
|
+
def serialize
|
78
|
+
prep_serialize
|
79
|
+
Marshal::dump( self )
|
80
|
+
end
|
81
|
+
|
82
|
+
#
|
83
|
+
# Deserialize the Engine data.
|
84
|
+
#
|
85
|
+
def self.deserialize data
|
86
|
+
e = Marshal::load( data )
|
87
|
+
e.restore_after_deserialization
|
88
|
+
return e
|
89
|
+
end
|
90
|
+
|
91
|
+
#
|
92
|
+
# Restore the engine after deserialization.
|
93
|
+
#
|
94
|
+
def restore_after_deserialization
|
95
|
+
@log.restore_after_deserialization
|
96
|
+
end
|
97
|
+
|
59
98
|
# ---------------------------------------------------------------------
|
60
99
|
# Run
|
61
100
|
# ---------------------------------------------------------------------
|
@@ -72,6 +111,8 @@ module GlooLang
|
|
72
111
|
show_help_and_quit
|
73
112
|
elsif @mode == Mode::SCRIPT
|
74
113
|
run_files
|
114
|
+
elsif @mode == Mode::EMBED
|
115
|
+
run_keep_alive
|
75
116
|
else
|
76
117
|
run
|
77
118
|
end
|
@@ -96,13 +137,20 @@ module GlooLang
|
|
96
137
|
# TODO: open any files specifed in args
|
97
138
|
|
98
139
|
unless @mode == Mode::SCRIPT || @args.quiet?
|
99
|
-
@cursor = TTY::Cursor
|
100
140
|
self.loop
|
101
141
|
end
|
102
142
|
|
103
143
|
quit
|
104
144
|
end
|
105
145
|
|
146
|
+
#
|
147
|
+
# Run in Embedded mode, which means we'll
|
148
|
+
# start the engine, but wait for external inputs.
|
149
|
+
#
|
150
|
+
def run_keep_alive
|
151
|
+
@log.debug 'Running in Embedded mode...'
|
152
|
+
end
|
153
|
+
|
106
154
|
#
|
107
155
|
# Get the setting for the start_with file and open it.
|
108
156
|
#
|
data/lib/gloo_lang/app/log.rb
CHANGED
@@ -12,6 +12,10 @@ module GlooLang
|
|
12
12
|
attr_accessor :quiet
|
13
13
|
attr_reader :logger
|
14
14
|
|
15
|
+
# ---------------------------------------------------------------------
|
16
|
+
# Initialization
|
17
|
+
# ---------------------------------------------------------------------
|
18
|
+
|
15
19
|
#
|
16
20
|
# Set up a logger.
|
17
21
|
# If quiet is true, then message are written to the log
|
@@ -19,12 +23,26 @@ module GlooLang
|
|
19
23
|
#
|
20
24
|
def initialize( engine, quiet=true )
|
21
25
|
@engine = engine
|
26
|
+
@quite = quiet
|
27
|
+
|
28
|
+
create_logger
|
29
|
+
|
30
|
+
debug 'log intialized...'
|
31
|
+
end
|
32
|
+
|
33
|
+
#
|
34
|
+
# Create the default [file] logger.
|
35
|
+
#
|
36
|
+
def create_logger
|
22
37
|
f = File.join( @engine.settings.log_path, 'gloo.log' )
|
23
38
|
@logger = Logger.new( f )
|
24
39
|
@logger.level = Logger::DEBUG
|
25
|
-
@quite = quiet
|
26
40
|
end
|
27
41
|
|
42
|
+
# ---------------------------------------------------------------------
|
43
|
+
# Standard Output
|
44
|
+
# ---------------------------------------------------------------------
|
45
|
+
|
28
46
|
#
|
29
47
|
# Show a message unless we're in quite mode.
|
30
48
|
#
|
@@ -32,6 +50,10 @@ module GlooLang
|
|
32
50
|
puts msg unless @quiet
|
33
51
|
end
|
34
52
|
|
53
|
+
# ---------------------------------------------------------------------
|
54
|
+
# Logging functions
|
55
|
+
# ---------------------------------------------------------------------
|
56
|
+
|
35
57
|
#
|
36
58
|
# Write a debug message to the log.
|
37
59
|
#
|
@@ -76,6 +98,25 @@ module GlooLang
|
|
76
98
|
end
|
77
99
|
end
|
78
100
|
|
101
|
+
# ---------------------------------------------------------------------
|
102
|
+
# Serialization
|
103
|
+
# ---------------------------------------------------------------------
|
104
|
+
|
105
|
+
#
|
106
|
+
# Prepare for serialization by removing the file reference.
|
107
|
+
# Without this, the engine cannot be serialized.
|
108
|
+
#
|
109
|
+
def prep_serialize
|
110
|
+
@logger = nil
|
111
|
+
end
|
112
|
+
|
113
|
+
#
|
114
|
+
# Restore the logger after deserialization.
|
115
|
+
#
|
116
|
+
def restore_after_deserialization
|
117
|
+
create_logger
|
118
|
+
end
|
119
|
+
|
79
120
|
end
|
80
121
|
end
|
81
122
|
end
|
data/lib/gloo_lang/core/heap.rb
CHANGED
@@ -23,10 +23,10 @@ module GlooLang
|
|
23
23
|
@engine = engine
|
24
24
|
@engine.log.debug 'object heap intialized...'
|
25
25
|
|
26
|
-
@root = GlooLang::Objs::Container.new( @engine)
|
26
|
+
@root = GlooLang::Objs::Container.new( @engine )
|
27
27
|
@root.name = 'root'
|
28
28
|
|
29
|
-
@context = Pn.root engine
|
29
|
+
@context = Pn.root @engine
|
30
30
|
@it = It.new
|
31
31
|
@error = Error.new
|
32
32
|
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.
|
4
|
+
version: 1.0.2
|
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-03-
|
11
|
+
date: 2022-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,20 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '5.
|
33
|
+
version: '5.1'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 5.14.2
|
34
37
|
type: :development
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
41
|
- - "~>"
|
39
42
|
- !ruby/object:Gem::Version
|
40
|
-
version: '5.
|
43
|
+
version: '5.1'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 5.14.2
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: rake
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|