gloo 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/gloo/app/info.rb +1 -1
- 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/system.txt +1 -1
- data/lib/gloo/help/verbs/execute.txt +27 -0
- data/lib/gloo/verbs/execute.rb +46 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ee9db940becd7ad3a92a145409a9c791d2e3e849e0db32ef6ce36ae4e7d9ac5
|
4
|
+
data.tar.gz: affbd0b5d4d33e382954a3abb044f5489299e9c10f93592afc37d7c41c8b8aea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fdfc7f9e8b39f872d2272bec67550846c02ca4f4601fdf2888fa256158b2f6b89d64a68ca6791064ff2e365762982c24bffc7d69002bc81a6a0662c44083b7f
|
7
|
+
data.tar.gz: f0e156978cdf38255ad19384106a4d124acdb9350d0c1dade4932009d1010f3391c5448d743714160ce812d473c9bd0d37e928477fdd02a2af5e82ec15f4f1c9
|
data/Gemfile.lock
CHANGED
data/lib/gloo/app/info.rb
CHANGED
@@ -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
|
@@ -0,0 +1,46 @@
|
|
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
|
+
system expr.evaluate, chdir: Dir.pwd
|
26
|
+
# `#{expr.evaluate}`
|
27
|
+
# exec expr.evaluate
|
28
|
+
end
|
29
|
+
|
30
|
+
#
|
31
|
+
# Get the Verb's keyword.
|
32
|
+
#
|
33
|
+
def self.keyword
|
34
|
+
return KEYWORD
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# Get the Verb's keyword shortcut.
|
39
|
+
#
|
40
|
+
def self.keyword_shortcut
|
41
|
+
return KEYWORD_SHORT
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
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.1
|
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-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -301,6 +301,7 @@ files:
|
|
301
301
|
- lib/gloo/help/verbs/cls.txt
|
302
302
|
- lib/gloo/help/verbs/context.txt
|
303
303
|
- lib/gloo/help/verbs/create.txt
|
304
|
+
- lib/gloo/help/verbs/execute.txt
|
304
305
|
- lib/gloo/help/verbs/help.txt
|
305
306
|
- lib/gloo/help/verbs/if.txt
|
306
307
|
- lib/gloo/help/verbs/list.txt
|
@@ -364,6 +365,7 @@ files:
|
|
364
365
|
- lib/gloo/verbs/cls.rb
|
365
366
|
- lib/gloo/verbs/context.rb
|
366
367
|
- lib/gloo/verbs/create.rb
|
368
|
+
- lib/gloo/verbs/execute.rb
|
367
369
|
- lib/gloo/verbs/help.rb
|
368
370
|
- lib/gloo/verbs/if.rb
|
369
371
|
- lib/gloo/verbs/list.rb
|