gloo 0.7.3 → 0.7.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +38 -4
- data/Gemfile +4 -0
- data/Gemfile.lock +43 -17
- data/gloo.gemspec +3 -0
- data/lib/VERSION +1 -0
- data/lib/dependencies.rb +28 -0
- data/lib/gloo/app/engine.rb +4 -4
- data/lib/gloo/app/info.rb +11 -1
- data/lib/gloo/app/settings.rb +3 -3
- data/lib/gloo/core/baseo.rb +2 -0
- data/lib/gloo/core/factory.rb +22 -0
- data/lib/gloo/core/gloo_system.rb +9 -0
- data/lib/gloo/help/core/gloo_system.txt +3 -0
- data/lib/gloo/help/objs/cli/bar.txt +3 -0
- data/lib/gloo/help/objs/data/mysql.txt +40 -0
- data/lib/gloo/help/objs/data/query.txt +37 -0
- data/lib/gloo/help/objs/data/sqlite.txt +26 -0
- data/lib/gloo/help/objs/dev/git_repo.txt +2 -1
- data/lib/gloo/help/objs/dev/stats.txt +36 -0
- data/lib/gloo/help/objs/system/file.txt +7 -0
- data/lib/gloo/help/objs/system/ssh_exec.txt +30 -0
- data/lib/gloo/help/objs/web/http_post.txt +2 -0
- data/lib/gloo/help/objs/web/uri.txt +2 -1
- data/lib/gloo/objs/basic/boolean.rb +3 -0
- data/lib/gloo/objs/cli/bar.rb +22 -1
- data/lib/gloo/objs/data/mysql.rb +192 -0
- data/lib/gloo/objs/data/query.rb +176 -0
- data/lib/gloo/objs/data/sqlite.rb +159 -0
- data/lib/gloo/objs/dev/git.rb +13 -1
- data/lib/gloo/objs/dev/stats.rb +120 -0
- data/lib/gloo/objs/system/file_handle.rb +10 -1
- data/lib/gloo/objs/system/ssh_exec.rb +126 -0
- data/lib/gloo/objs/web/http_post.rb +53 -16
- data/lib/gloo/objs/web/json.rb +1 -1
- data/lib/gloo/objs/web/slack.rb +1 -1
- data/lib/gloo/objs/web/teams.rb +1 -1
- data/lib/gloo/objs/web/uri.rb +18 -1
- data/lib/gloo/persist/file_loader.rb +2 -0
- data/lib/gloo/utils/format.rb +21 -0
- data/lib/gloo/utils/stats.rb +205 -0
- data/lib/gloo/verbs/execute.rb +1 -1
- data/lib/gloo.rb +2 -4
- data/lib/run.rb +3 -2
- metadata +80 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a3e2cb80e6c835a4b74747356c94b4f67ce2ae0fa36d76324f1fb16d92b4baf
|
4
|
+
data.tar.gz: b4577bc7f5ef1aed113600c3df5b39bbbb3292bff4c050aa81a5d7f0031fd891
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dd3bff3c3e0dfe95dc82b53382d4c38528d0588007b1cb42d98747b2cf0fd06d2a9ca3486c7e29b836584e793f7eab18b74f51864f53a2dd86ca700116d8c1c
|
7
|
+
data.tar.gz: 41d2029d98b4d70472d822f3636c8ad5ed5c97c906f179751469e98e962ef8503582201d7aac7a8c5b5b1db7ce667f13e16e82d8f71103c6585ceb722349fff8
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
AllCops:
|
2
2
|
Exclude:
|
3
3
|
- 'gloo.gemspec'
|
4
|
+
- 'Gemfile'
|
5
|
+
- 'Rakefile'
|
6
|
+
- 'bin/**/*'
|
7
|
+
- 'test/**/*'
|
4
8
|
|
5
9
|
# -------------- Layout -------------- #
|
6
10
|
Layout/SpaceInsideParens:
|
@@ -38,7 +42,25 @@ Style/Documentation:
|
|
38
42
|
Enabled: false
|
39
43
|
Style/RedundantSelf:
|
40
44
|
Enabled: false
|
41
|
-
|
45
|
+
Style/IfUnlessModifier:
|
46
|
+
Enabled: false
|
47
|
+
Style/ClassEqualityComparison:
|
48
|
+
Enabled: false
|
49
|
+
Style/ArgumentsForwarding: # (new in 1.1)
|
50
|
+
Enabled: true
|
51
|
+
Style/CollectionCompact: # (new in 1.2)
|
52
|
+
Enabled: true
|
53
|
+
Style/DocumentDynamicEvalDefinition: # (new in 1.1)
|
54
|
+
Enabled: true
|
55
|
+
Style/NegatedIfElseCondition: # (new in 1.2)
|
56
|
+
Enabled: true
|
57
|
+
Style/SwapValues: # (new in 1.1)
|
58
|
+
Enabled: true
|
59
|
+
Style/OptionalBooleanParameter:
|
60
|
+
Enabled: false
|
61
|
+
Style/CaseLikeIf:
|
62
|
+
Enabled: false
|
63
|
+
|
42
64
|
# -------------- Naming -------------- #
|
43
65
|
Naming/PredicateName:
|
44
66
|
Enabled: true
|
@@ -50,15 +72,15 @@ Metrics/MethodLength:
|
|
50
72
|
Max: 17 # Default is 10
|
51
73
|
Enabled: true
|
52
74
|
Metrics/CyclomaticComplexity:
|
53
|
-
Max:
|
75
|
+
Max: 11 # Default is 6
|
54
76
|
Naming/MethodParameterName:
|
55
77
|
MinNameLength: 2 # Default value is 3
|
56
78
|
Metrics/PerceivedComplexity:
|
57
|
-
Max:
|
79
|
+
Max: 11 # default value is 7
|
58
80
|
Metrics/ClassLength:
|
59
81
|
Max: 157 # default is 100
|
60
82
|
Metrics/AbcSize:
|
61
|
-
Max:
|
83
|
+
Max: 39 # default is 15
|
62
84
|
|
63
85
|
# -------------- Lint -------------- #
|
64
86
|
Lint/RaiseException:
|
@@ -67,6 +89,18 @@ Lint/StructNewOverride:
|
|
67
89
|
Enabled: true
|
68
90
|
Lint/NonDeterministicRequireOrder:
|
69
91
|
Enabled: false
|
92
|
+
Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
|
93
|
+
Enabled: true
|
94
|
+
Lint/EmptyBlock: # (new in 1.1)
|
95
|
+
Enabled: true
|
96
|
+
Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
|
97
|
+
Enabled: true
|
98
|
+
Lint/ToEnumArguments: # (new in 1.1)
|
99
|
+
Enabled: true
|
100
|
+
Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
|
101
|
+
Enabled: true
|
102
|
+
Lint/MissingSuper:
|
103
|
+
Enabled: false
|
70
104
|
|
71
105
|
# -------------- Security -------------- #
|
72
106
|
Security/Eval:
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,44 +1,69 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gloo (0.7.
|
4
|
+
gloo (0.7.7)
|
5
5
|
activesupport (~> 5.2, >= 5.2.4.3)
|
6
6
|
chronic (~> 0.10, >= 0.10.2)
|
7
7
|
colorize (~> 0.8, >= 0.8.1)
|
8
8
|
json (~> 2.1, >= 2.1.0)
|
9
|
+
mysql2 (~> 0.5, >= 0.5.3)
|
10
|
+
net-ssh (~> 6.1, >= 6.1.0)
|
9
11
|
openssl (~> 2.1, >= 2.1.0)
|
12
|
+
sqlite3 (~> 1.4, >= 1.4.2)
|
10
13
|
tty (~> 0.8, >= 0.8.1)
|
11
14
|
|
12
15
|
GEM
|
13
16
|
remote: https://rubygems.org/
|
14
17
|
specs:
|
15
|
-
activesupport (5.2.
|
18
|
+
activesupport (5.2.6)
|
16
19
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
20
|
i18n (>= 0.7, < 2)
|
18
21
|
minitest (~> 5.1)
|
19
22
|
tzinfo (~> 1.1)
|
23
|
+
ast (2.4.1)
|
20
24
|
chronic (0.10.2)
|
21
25
|
colorize (0.8.1)
|
22
|
-
concurrent-ruby (1.1.
|
26
|
+
concurrent-ruby (1.1.9)
|
23
27
|
diff-lcs (1.4.4)
|
24
|
-
equatable (0.
|
25
|
-
i18n (1.8.
|
28
|
+
equatable (0.7.0)
|
29
|
+
i18n (1.8.11)
|
26
30
|
concurrent-ruby (~> 1.0)
|
27
|
-
json (2.
|
31
|
+
json (2.5.1)
|
28
32
|
kramdown (1.16.2)
|
29
|
-
minitest (5.
|
33
|
+
minitest (5.14.2)
|
34
|
+
mysql2 (0.5.3)
|
30
35
|
necromancer (0.5.1)
|
36
|
+
net-ssh (6.1.0)
|
31
37
|
openssl (2.2.0)
|
38
|
+
parallel (1.19.2)
|
39
|
+
parser (2.7.2.0)
|
40
|
+
ast (~> 2.4.1)
|
32
41
|
pastel (0.7.4)
|
33
42
|
equatable (~> 0.6)
|
34
43
|
tty-color (~> 0.5)
|
44
|
+
rainbow (3.0.0)
|
35
45
|
rake (13.0.1)
|
36
|
-
|
46
|
+
regexp_parser (1.8.2)
|
47
|
+
rexml (3.2.4)
|
48
|
+
rouge (3.26.1)
|
49
|
+
rubocop (1.2.0)
|
50
|
+
parallel (~> 1.10)
|
51
|
+
parser (>= 2.7.1.5)
|
52
|
+
rainbow (>= 2.2.2, < 4.0)
|
53
|
+
regexp_parser (>= 1.8)
|
54
|
+
rexml
|
55
|
+
rubocop-ast (>= 1.0.1)
|
56
|
+
ruby-progressbar (~> 1.7)
|
57
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
58
|
+
rubocop-ast (1.1.1)
|
59
|
+
parser (>= 2.7.1.5)
|
60
|
+
ruby-progressbar (1.10.1)
|
61
|
+
sqlite3 (1.4.2)
|
37
62
|
strings (0.1.8)
|
38
63
|
strings-ansi (~> 0.1)
|
39
64
|
unicode-display_width (~> 1.5)
|
40
65
|
unicode_utils (~> 1.4)
|
41
|
-
strings-ansi (0.
|
66
|
+
strings-ansi (0.2.0)
|
42
67
|
thor (0.20.3)
|
43
68
|
thread_safe (0.3.6)
|
44
69
|
tty (0.10.0)
|
@@ -70,7 +95,7 @@ GEM
|
|
70
95
|
pastel (~> 0.7.2)
|
71
96
|
strings (~> 0.1.6)
|
72
97
|
tty-cursor (~> 0.7)
|
73
|
-
tty-color (0.
|
98
|
+
tty-color (0.6.0)
|
74
99
|
tty-command (0.9.0)
|
75
100
|
pastel (~> 0.7.0)
|
76
101
|
tty-config (0.3.2)
|
@@ -99,11 +124,11 @@ GEM
|
|
99
124
|
pastel (~> 0.7.3)
|
100
125
|
tty-cursor (~> 0.7)
|
101
126
|
tty-platform (0.3.0)
|
102
|
-
tty-progressbar (0.
|
103
|
-
strings-ansi (~> 0.
|
127
|
+
tty-progressbar (0.18.2)
|
128
|
+
strings-ansi (~> 0.2)
|
104
129
|
tty-cursor (~> 0.7)
|
105
|
-
tty-screen (~> 0.
|
106
|
-
unicode-display_width (
|
130
|
+
tty-screen (~> 0.8)
|
131
|
+
unicode-display_width (>= 1.6, < 3.0)
|
107
132
|
tty-prompt (0.21.0)
|
108
133
|
necromancer (~> 0.5.0)
|
109
134
|
pastel (~> 0.7.0)
|
@@ -122,8 +147,8 @@ GEM
|
|
122
147
|
strings (~> 0.1.5)
|
123
148
|
tty-screen (~> 0.7)
|
124
149
|
tty-tree (0.4.0)
|
125
|
-
tty-which (0.
|
126
|
-
tzinfo (1.2.
|
150
|
+
tty-which (0.5.0)
|
151
|
+
tzinfo (1.2.9)
|
127
152
|
thread_safe (~> 0.1)
|
128
153
|
unicode-display_width (1.7.0)
|
129
154
|
unicode_utils (1.4.0)
|
@@ -137,6 +162,7 @@ DEPENDENCIES
|
|
137
162
|
gloo!
|
138
163
|
minitest (~> 5.0)
|
139
164
|
rake (~> 13.0, >= 13.0.1)
|
165
|
+
rubocop
|
140
166
|
|
141
167
|
BUNDLED WITH
|
142
|
-
1.
|
168
|
+
1.17.3
|
data/gloo.gemspec
CHANGED
@@ -39,4 +39,7 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_dependency 'tty', '~> 0.8', '>= 0.8.1'
|
40
40
|
spec.add_dependency 'json', '~> 2.1', '>= 2.1.0'
|
41
41
|
spec.add_dependency 'openssl', '~> 2.1', '>= 2.1.0'
|
42
|
+
spec.add_dependency 'net-ssh', '~> 6.1', '>= 6.1.0'
|
43
|
+
spec.add_dependency 'mysql2', '~> 0.5', '>= 0.5.3'
|
44
|
+
spec.add_dependency 'sqlite3', '~> 1.4', '>= 1.4.2'
|
42
45
|
end
|
data/lib/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.7.7
|
data/lib/dependencies.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#
|
2
|
+
# Script to build a list of dependencies
|
3
|
+
#
|
4
|
+
|
5
|
+
require 'gloo/core/baseo'
|
6
|
+
require 'gloo/core/obj'
|
7
|
+
|
8
|
+
path = File.dirname( File.absolute_path( __FILE__ ) )
|
9
|
+
|
10
|
+
files = []
|
11
|
+
#
|
12
|
+
# We want to start with these to avoid dependency errors later on.
|
13
|
+
#
|
14
|
+
files << File.join( path, 'gloo', 'core', 'baseo.rb' )
|
15
|
+
files << File.join( path, 'gloo', 'core', 'obj.rb' )
|
16
|
+
|
17
|
+
root = File.join( path, 'gloo', '**/*.rb' )
|
18
|
+
Dir.glob( root ).each do |ruby_file|
|
19
|
+
files << ruby_file unless files.include?( ruby_file )
|
20
|
+
end
|
21
|
+
|
22
|
+
#
|
23
|
+
# Now that we have the first with some key dependencies
|
24
|
+
# at the top, we'll require them.
|
25
|
+
#
|
26
|
+
files.each do |ruby_file|
|
27
|
+
require ruby_file
|
28
|
+
end
|
data/lib/gloo/app/engine.rb
CHANGED
@@ -15,10 +15,10 @@ module Gloo
|
|
15
15
|
module App
|
16
16
|
class Engine
|
17
17
|
|
18
|
-
attr_reader :args, :mode, :running
|
19
|
-
|
20
|
-
attr_accessor :last_cmd, :persist_man, :event_manager
|
21
|
-
|
18
|
+
attr_reader :args, :mode, :running,
|
19
|
+
:dictionary, :parser, :heap, :factory
|
20
|
+
attr_accessor :last_cmd, :persist_man, :event_manager,
|
21
|
+
:exec_env, :help, :converter
|
22
22
|
|
23
23
|
#
|
24
24
|
# Set up the engine with basic elements.
|
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
|
#
|
data/lib/gloo/app/settings.rb
CHANGED
@@ -12,9 +12,9 @@ module Gloo
|
|
12
12
|
module App
|
13
13
|
class Settings
|
14
14
|
|
15
|
-
attr_reader :user_root, :log_path, :config_path, :project_path
|
16
|
-
|
17
|
-
|
15
|
+
attr_reader :user_root, :log_path, :config_path, :project_path,
|
16
|
+
:start_with, :list_indent, :tmp_path,
|
17
|
+
:debug_path, :debug
|
18
18
|
|
19
19
|
#
|
20
20
|
# Load setting from the yml file.
|
data/lib/gloo/core/baseo.rb
CHANGED
data/lib/gloo/core/factory.rb
CHANGED
@@ -23,6 +23,17 @@ module Gloo
|
|
23
23
|
# Factory Helpers
|
24
24
|
# ---------------------------------------------------------------------
|
25
25
|
|
26
|
+
#
|
27
|
+
# Helper shortcut to create an alias child object.
|
28
|
+
#
|
29
|
+
def create_alias( name, value, parent )
|
30
|
+
params = { :name => name,
|
31
|
+
:type => 'alias',
|
32
|
+
:value => value,
|
33
|
+
:parent => parent }
|
34
|
+
create params
|
35
|
+
end
|
36
|
+
|
26
37
|
#
|
27
38
|
# Helper shortcut to create a string child object.
|
28
39
|
#
|
@@ -100,6 +111,17 @@ module Gloo
|
|
100
111
|
create params
|
101
112
|
end
|
102
113
|
|
114
|
+
#
|
115
|
+
# Helper shortcut to create a file child object.
|
116
|
+
#
|
117
|
+
def create_file( name, value, parent )
|
118
|
+
params = { :name => name,
|
119
|
+
:type => 'file',
|
120
|
+
:value => value,
|
121
|
+
:parent => parent }
|
122
|
+
create params
|
123
|
+
end
|
124
|
+
|
103
125
|
# ---------------------------------------------------------------------
|
104
126
|
# Object Factory
|
105
127
|
# ---------------------------------------------------------------------
|
@@ -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.
|
@@ -15,6 +15,9 @@ BAR OBJECT TYPE
|
|
15
15
|
start - Start the bar.
|
16
16
|
advance <amount> - Advance by the given amount.
|
17
17
|
stop - Complete the bar.
|
18
|
+
run <seconds> - Run for the given number of seconds
|
19
|
+
and advance the bar so that it completes at the end
|
20
|
+
of the time specified.
|
18
21
|
|
19
22
|
EXAMPLE
|
20
23
|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
SYSTEM OBJECT TYPE
|
2
|
+
NAME: mysql
|
3
|
+
SHORTCUT: mysql
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A MySQL database connection.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
host - string
|
10
|
+
The database server host
|
11
|
+
database - string
|
12
|
+
The name of the database.
|
13
|
+
username - string
|
14
|
+
The username with which to connect.
|
15
|
+
pasword - string
|
16
|
+
The user's password.
|
17
|
+
|
18
|
+
MESSAGES
|
19
|
+
verify - Verify that the database connection can be established.
|
20
|
+
|
21
|
+
EXAMPLE
|
22
|
+
|
23
|
+
mysql [can] :
|
24
|
+
on_load [script] :
|
25
|
+
run mysql.get_passwd
|
26
|
+
run mysql.sql
|
27
|
+
db [mysql] :
|
28
|
+
host : localhost
|
29
|
+
database : my_database
|
30
|
+
username : my_user
|
31
|
+
password [alias] : mysql.get_passwd.result
|
32
|
+
sql [query] :
|
33
|
+
database [alias] : mysql.db
|
34
|
+
sql : SELECT first, last, phone FROM people
|
35
|
+
get_passwd [ask] :
|
36
|
+
prompt [string] : Database Password?
|
37
|
+
result [string] :
|
38
|
+
|
39
|
+
SEE ALSO
|
40
|
+
query, sqlite
|
@@ -0,0 +1,37 @@
|
|
1
|
+
SYSTEM OBJECT TYPE
|
2
|
+
NAME: query
|
3
|
+
SHORTCUT: sql
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A SQL Query.
|
7
|
+
A SELECT, INSERT, UPDATE or other SQL statement.
|
8
|
+
The query requires a valid database connection.
|
9
|
+
|
10
|
+
CHILDREN
|
11
|
+
database - string
|
12
|
+
The name of the database.
|
13
|
+
sql - string
|
14
|
+
The SQL query to execute.
|
15
|
+
result - container
|
16
|
+
The result of the query will be a container for each row,
|
17
|
+
with an object for each column.
|
18
|
+
The result container is optional. If it is not present,
|
19
|
+
the results will be displayed in the console.
|
20
|
+
params - container
|
21
|
+
Optional list of parameters for the query.
|
22
|
+
|
23
|
+
MESSAGES
|
24
|
+
run - Run the query and get back the data.
|
25
|
+
|
26
|
+
EXAMPLE
|
27
|
+
|
28
|
+
sqlite [can] :
|
29
|
+
on_load [script] : run sqlite.sql
|
30
|
+
db [sqlite] :
|
31
|
+
database : test.db
|
32
|
+
sql [query] :
|
33
|
+
database [alias] : sqlite.db
|
34
|
+
sql : SELECT id, key, value FROM key_values
|
35
|
+
|
36
|
+
SEE ALSO
|
37
|
+
mysql, sqlite
|
@@ -0,0 +1,26 @@
|
|
1
|
+
SYSTEM OBJECT TYPE
|
2
|
+
NAME: sqlite
|
3
|
+
SHORTCUT: sqlite
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A Sqlite3 database connection.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
database - string - 'test.db'
|
10
|
+
The path to the database file.
|
11
|
+
|
12
|
+
MESSAGES
|
13
|
+
verify - Verify that the database connection can be established.
|
14
|
+
|
15
|
+
EXAMPLE
|
16
|
+
|
17
|
+
sqlite [can] :
|
18
|
+
on_load [script] : run sqlite.sql
|
19
|
+
db [sqlite] :
|
20
|
+
database : test.db
|
21
|
+
sql [query] :
|
22
|
+
database [alias] : sqlite.db
|
23
|
+
sql : SELECT id, key, value FROM key_values
|
24
|
+
|
25
|
+
SEE ALSO
|
26
|
+
query, mysql
|
@@ -4,7 +4,7 @@ GIT OBJECT TYPE
|
|
4
4
|
|
5
5
|
DESCRIPTION
|
6
6
|
Reference to a git repository in the file system.
|
7
|
-
The value of the git_repo
|
7
|
+
The value of the git_repo object is a string.
|
8
8
|
There are no children needed.
|
9
9
|
|
10
10
|
CHILDREN
|
@@ -16,6 +16,7 @@ GIT OBJECT TYPE
|
|
16
16
|
get_changes - Get the list of pending changes.
|
17
17
|
commit - Commit changes.
|
18
18
|
get_branch - Get the current branch.
|
19
|
+
review - Review pending changes.
|
19
20
|
|
20
21
|
EXAMPLE
|
21
22
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
GIT OBJECT TYPE
|
2
|
+
NAME: stats
|
3
|
+
SHORTCUT: stats
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Development project statistics.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
folder - file
|
10
|
+
The project's root folder.
|
11
|
+
types - string
|
12
|
+
The list of code file types.
|
13
|
+
We'll use this to count lines of code and to find the
|
14
|
+
longest files.
|
15
|
+
The list is a string of space-delimited file extensions.
|
16
|
+
For example: rb erb js
|
17
|
+
skip - string
|
18
|
+
List of files or folders we'll skip while building stats.
|
19
|
+
For example: .git tmp
|
20
|
+
|
21
|
+
MESSAGES
|
22
|
+
show_all - Show all project statistics
|
23
|
+
show_busy_folders - Show a list of folders with the most files
|
24
|
+
show_types - Show file types and counts
|
25
|
+
|
26
|
+
EXAMPLE
|
27
|
+
|
28
|
+
main [can] :
|
29
|
+
stats [stats] :
|
30
|
+
folder [file] : /Users/me/dev/project
|
31
|
+
types [string] : rb erb js
|
32
|
+
skip [string] : .git tmp
|
33
|
+
on_load [script] :
|
34
|
+
tell main.stats to show_all
|
35
|
+
|
36
|
+
SEE ALSO
|
@@ -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,30 @@
|
|
1
|
+
SYSTEM OBJECT TYPE
|
2
|
+
NAME: ssh_exec
|
3
|
+
SHORTCUT: ssh
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Open an SSH session to host and execute a system command.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
host - string - 'localhost'
|
10
|
+
The remote host to which to open a connection.
|
11
|
+
The object assumes that the user has password-less SSH
|
12
|
+
set up to the remote host.
|
13
|
+
cmd - string
|
14
|
+
The command to execute on the remote system.
|
15
|
+
result - string
|
16
|
+
The result of running the command.
|
17
|
+
|
18
|
+
MESSAGES
|
19
|
+
run - Open the connection and execute the command.
|
20
|
+
Set the result value to the output of the command.
|
21
|
+
|
22
|
+
EXAMPLE
|
23
|
+
|
24
|
+
remote [ssh_exec] :
|
25
|
+
host [string] : localhost
|
26
|
+
cmd [string] : hostname
|
27
|
+
result [string] :
|
28
|
+
|
29
|
+
SEE ALSO
|
30
|
+
execute, system
|
@@ -13,6 +13,8 @@ HTTP_POST OBJECT TYPE
|
|
13
13
|
result - string - Optional parameter
|
14
14
|
The result of the request. Whatever was returned in the body
|
15
15
|
of the HTTP POST.
|
16
|
+
skip_ssl_verify - boolean (optional)
|
17
|
+
Skip the SSL verification as part of the request.
|
16
18
|
|
17
19
|
MESSAGES
|
18
20
|
run - Run the HTTP Post sending the body data to the
|
@@ -13,8 +13,9 @@ URI OBJECT TYPE
|
|
13
13
|
get_scheme - get the URI scheme; example: http
|
14
14
|
get_host - get the URI host; example: google.com
|
15
15
|
get_path - get the URI resource path; example: /post
|
16
|
-
get_query - get the URI query
|
16
|
+
get_query - get the URI query parameters; example: id=121
|
17
17
|
get_fragment - get the URI fragment
|
18
|
+
get_cert_expires - get the web site's certificate expiration date
|
18
19
|
|
19
20
|
EXAMPLE
|
20
21
|
|
@@ -40,6 +40,9 @@ module Gloo
|
|
40
40
|
def self.coerse_to_bool( new_value )
|
41
41
|
return false if new_value.nil?
|
42
42
|
|
43
|
+
# I should be able to use this:
|
44
|
+
# if new_value.kind_of?( String )
|
45
|
+
# but it doesn't work. I don't know why.
|
43
46
|
if new_value.class.name == 'String'
|
44
47
|
return true if new_value.strip.downcase == TRUE
|
45
48
|
return false if new_value.strip.downcase == FALSE
|
data/lib/gloo/objs/cli/bar.rb
CHANGED
@@ -76,7 +76,7 @@ module Gloo
|
|
76
76
|
# Get a list of message names that this object receives.
|
77
77
|
#
|
78
78
|
def self.messages
|
79
|
-
return super + %w[start advance stop]
|
79
|
+
return super + %w[start advance stop run]
|
80
80
|
end
|
81
81
|
|
82
82
|
#
|
@@ -107,6 +107,27 @@ module Gloo
|
|
107
107
|
@bar.advance x
|
108
108
|
end
|
109
109
|
|
110
|
+
#
|
111
|
+
# Run for the given number of seconds advancing
|
112
|
+
# the bar to the end.
|
113
|
+
#
|
114
|
+
def msg_run
|
115
|
+
msg_start
|
116
|
+
|
117
|
+
x = 1
|
118
|
+
if @params&.token_count&.positive?
|
119
|
+
expr = Gloo::Expr::Expression.new( @params.tokens )
|
120
|
+
x = expr.evaluate.to_i
|
121
|
+
end
|
122
|
+
|
123
|
+
100.times do
|
124
|
+
sleep ( 0.0 + x ) / 100.0
|
125
|
+
@bar.advance 1
|
126
|
+
end
|
127
|
+
|
128
|
+
msg_stop
|
129
|
+
end
|
130
|
+
|
110
131
|
end
|
111
132
|
end
|
112
133
|
end
|