gloo 0.7.0 → 0.7.5
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/VERSION +1 -0
- data/lib/gloo/app/info.rb +11 -1
- data/lib/gloo/core/gloo_system.rb +9 -0
- data/lib/gloo/help/core/gloo_system.txt +3 -0
- data/lib/gloo/help/objs/dev/git_repo.txt +1 -0
- data/lib/gloo/help/objs/ror/erb.txt +1 -1
- data/lib/gloo/help/objs/ror/eval.txt +1 -1
- data/lib/gloo/help/objs/system/file.txt +7 -0
- data/lib/gloo/help/objs/system/system.txt +1 -1
- data/lib/gloo/help/verbs/execute.txt +27 -0
- data/lib/gloo/objs/dev/git.rb +13 -1
- data/lib/gloo/objs/system/file_handle.rb +10 -1
- data/lib/gloo/verbs/execute.rb +56 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcdba5aa6b493f3f3232e5ecce212c6a1721484e0a7b9a2b556a9c8d6079c676
|
4
|
+
data.tar.gz: 4ae56c869dc3030f6dc69e5eab122510b1697fdd863c4063ae2444b517c90ab8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8147b2d8cdf485f64fc8afff2fd1b68e4a5f0817299288af3db70452ca6f149aa6213c19572711d0d420e78a87ab957e4278a883f27517d0ed761ede4a87652
|
7
|
+
data.tar.gz: d516779527dbf11c70c92d2da87b920fe1e9a9ee81b0c5c392f152bba4e60947045420d63c30d306fa42816b81f9a3f9738f0e31146a0b71d39614ae4027c2c9
|
data/Gemfile.lock
CHANGED
data/lib/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.7.5
|
data/lib/gloo/app/info.rb
CHANGED
@@ -8,7 +8,17 @@ module Gloo
|
|
8
8
|
module App
|
9
9
|
class Info
|
10
10
|
|
11
|
-
|
11
|
+
#
|
12
|
+
# Load the version from the VERSION file.
|
13
|
+
#
|
14
|
+
def self.get_version
|
15
|
+
f = File.dirname( File.absolute_path( __FILE__ ) )
|
16
|
+
f = File.dirname( File.dirname( f ) )
|
17
|
+
f = File.join( f, 'VERSION' )
|
18
|
+
return File.read( f )
|
19
|
+
end
|
20
|
+
|
21
|
+
VERSION = Gloo::App::Info.get_version
|
12
22
|
APP_NAME = 'Gloo'.freeze
|
13
23
|
|
14
24
|
#
|
@@ -181,6 +181,15 @@ module Gloo
|
|
181
181
|
return $settings.log_path
|
182
182
|
end
|
183
183
|
|
184
|
+
# ---------------------------------------------------------------------
|
185
|
+
# Special chars
|
186
|
+
# ---------------------------------------------------------------------
|
187
|
+
|
188
|
+
# Carriage return (line feed)
|
189
|
+
def msg_line
|
190
|
+
return "\n"
|
191
|
+
end
|
192
|
+
|
184
193
|
# ---------------------------------------------------------------------
|
185
194
|
# Screen Messages
|
186
195
|
# ---------------------------------------------------------------------
|
@@ -32,6 +32,9 @@ GLOO SYSTEM OBJECTS
|
|
32
32
|
gloo.hostname # Get the system hostname.
|
33
33
|
gloo.user # Get the logged in User.
|
34
34
|
|
35
|
+
SPECIAL CHARS
|
36
|
+
gloo.line # A carriage return (line feed) character.
|
37
|
+
|
35
38
|
FILE SYSTEM
|
36
39
|
gloo.user_home # Get the user's home directory.
|
37
40
|
gloo.working_dir # Get the working directory.
|
@@ -24,6 +24,8 @@ FILE OBJECT TYPE
|
|
24
24
|
regular file. <It> will be true or false.
|
25
25
|
check_is_dir - Check to see if the file specified is a
|
26
26
|
diretory. <It> will be true or false.
|
27
|
+
find_match - Look for the existence of a file matching
|
28
|
+
the file's pattern. <It> will be true or false.
|
27
29
|
|
28
30
|
EXAMPLE
|
29
31
|
|
@@ -38,4 +40,9 @@ FILE OBJECT TYPE
|
|
38
40
|
tell exists.f to check_is_file
|
39
41
|
show "is a file? " + it
|
40
42
|
|
43
|
+
f [file] : /Users/me/gloo/*.gemspec
|
44
|
+
pattern [script] :
|
45
|
+
tell f to find_match
|
46
|
+
show it
|
47
|
+
|
41
48
|
SEE ALSO
|
@@ -0,0 +1,27 @@
|
|
1
|
+
EXECUTE VERB
|
2
|
+
NAME: execute
|
3
|
+
SHORTCUT: exec
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Execute a shell command.
|
7
|
+
|
8
|
+
SYNTAX
|
9
|
+
exec <expression>
|
10
|
+
|
11
|
+
PARAMETERS
|
12
|
+
expression
|
13
|
+
- Evaluate the expression and execute in the shell.
|
14
|
+
|
15
|
+
RESULT
|
16
|
+
none
|
17
|
+
|
18
|
+
ERRORS
|
19
|
+
Missing Expression!
|
20
|
+
- No expression is provided as parameter to the verb.
|
21
|
+
|
22
|
+
EXAMPLE
|
23
|
+
|
24
|
+
> exec 'rake test'
|
25
|
+
|
26
|
+
SEE ALSO
|
27
|
+
system, eval, erb
|
data/lib/gloo/objs/dev/git.rb
CHANGED
@@ -40,7 +40,9 @@ module Gloo
|
|
40
40
|
# Get a list of message names that this object receives.
|
41
41
|
#
|
42
42
|
def self.messages
|
43
|
-
|
43
|
+
actions = %w[validate commit get_branch review]
|
44
|
+
changes = %w[check_changes get_changes]
|
45
|
+
return super + changes + actions
|
44
46
|
end
|
45
47
|
|
46
48
|
#
|
@@ -57,6 +59,16 @@ module Gloo
|
|
57
59
|
$engine.heap.it.set_to branch
|
58
60
|
end
|
59
61
|
|
62
|
+
#
|
63
|
+
# Review pending changes.
|
64
|
+
#
|
65
|
+
def msg_review
|
66
|
+
$log.debug 'Reviewing pending changes'
|
67
|
+
cmd = "cd #{path_value}; git diff"
|
68
|
+
$log.debug cmd
|
69
|
+
system cmd
|
70
|
+
end
|
71
|
+
|
60
72
|
#
|
61
73
|
# Commit pending changes.
|
62
74
|
#
|
@@ -36,8 +36,9 @@ module Gloo
|
|
36
36
|
def self.messages
|
37
37
|
basic = %w[read write]
|
38
38
|
checks = %w[check_exists check_is_file check_is_dir]
|
39
|
+
search = %w[find_match]
|
39
40
|
show = %w[show page open]
|
40
|
-
return super + basic + show + checks
|
41
|
+
return super + basic + show + checks + search
|
41
42
|
end
|
42
43
|
|
43
44
|
#
|
@@ -124,6 +125,14 @@ module Gloo
|
|
124
125
|
$engine.heap.it.set_to result
|
125
126
|
end
|
126
127
|
|
128
|
+
#
|
129
|
+
# Look for any file matching pattern.
|
130
|
+
#
|
131
|
+
def msg_find_match
|
132
|
+
result = !Dir.glob( value ).empty?
|
133
|
+
$engine.heap.it.set_to result
|
134
|
+
end
|
135
|
+
|
127
136
|
end
|
128
137
|
end
|
129
138
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# Author:: Eric Crane (mailto:eric.crane@mac.com)
|
2
|
+
# Copyright:: Copyright (c) 2020 Eric Crane. All rights reserved.
|
3
|
+
#
|
4
|
+
# Execute a shell command.
|
5
|
+
#
|
6
|
+
|
7
|
+
module Gloo
|
8
|
+
module Verbs
|
9
|
+
class Execute < Gloo::Core::Verb
|
10
|
+
|
11
|
+
KEYWORD = 'execute'.freeze
|
12
|
+
KEYWORD_SHORT = 'exec'.freeze
|
13
|
+
MISSING_EXPR_ERR = 'Missing Expression!'.freeze
|
14
|
+
|
15
|
+
#
|
16
|
+
# Run the verb.
|
17
|
+
#
|
18
|
+
def run
|
19
|
+
if @tokens.token_count < 2
|
20
|
+
$engine.err MISSING_EXPR_ERR
|
21
|
+
return
|
22
|
+
end
|
23
|
+
|
24
|
+
expr = Gloo::Expr::Expression.new( @tokens.params )
|
25
|
+
cmd = expr.evaluate
|
26
|
+
$log.debug "starting cmd: #{cmd}"
|
27
|
+
|
28
|
+
pid = fork { exec( cmd ) }
|
29
|
+
Process.wait pid
|
30
|
+
|
31
|
+
# pid = spawn cmd
|
32
|
+
# Process.wait pid
|
33
|
+
$log.debug "done executing cmd: #{cmd}"
|
34
|
+
|
35
|
+
# system expr.evaluate #, chdir: Dir.pwd
|
36
|
+
# `#{expr.evaluate}`
|
37
|
+
# exec expr.evaluate
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Get the Verb's keyword.
|
42
|
+
#
|
43
|
+
def self.keyword
|
44
|
+
return KEYWORD
|
45
|
+
end
|
46
|
+
|
47
|
+
#
|
48
|
+
# Get the Verb's keyword shortcut.
|
49
|
+
#
|
50
|
+
def self.keyword_shortcut
|
51
|
+
return KEYWORD_SHORT
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
56
|
+
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.7.
|
4
|
+
version: 0.7.5
|
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-10-
|
11
|
+
date: 2020-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -202,6 +202,7 @@ files:
|
|
202
202
|
- exe/gloo
|
203
203
|
- exe/o
|
204
204
|
- gloo.gemspec
|
205
|
+
- lib/VERSION
|
205
206
|
- lib/gloo.rb
|
206
207
|
- lib/gloo/app/args.rb
|
207
208
|
- lib/gloo/app/engine.rb
|
@@ -301,6 +302,7 @@ files:
|
|
301
302
|
- lib/gloo/help/verbs/cls.txt
|
302
303
|
- lib/gloo/help/verbs/context.txt
|
303
304
|
- lib/gloo/help/verbs/create.txt
|
305
|
+
- lib/gloo/help/verbs/execute.txt
|
304
306
|
- lib/gloo/help/verbs/help.txt
|
305
307
|
- lib/gloo/help/verbs/if.txt
|
306
308
|
- lib/gloo/help/verbs/list.txt
|
@@ -364,6 +366,7 @@ files:
|
|
364
366
|
- lib/gloo/verbs/cls.rb
|
365
367
|
- lib/gloo/verbs/context.rb
|
366
368
|
- lib/gloo/verbs/create.rb
|
369
|
+
- lib/gloo/verbs/execute.rb
|
367
370
|
- lib/gloo/verbs/help.rb
|
368
371
|
- lib/gloo/verbs/if.rb
|
369
372
|
- lib/gloo/verbs/list.rb
|