gloo 0.3.0 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/.rubocop.yml +73 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +86 -83
- data/Rakefile +7 -6
- data/bin/console +4 -4
- data/gloo.gemspec +22 -18
- data/lib/gloo.rb +6 -6
- data/lib/gloo/app/args.rb +30 -31
- data/lib/gloo/app/engine.rb +80 -30
- data/lib/gloo/app/help.rb +17 -11
- data/lib/gloo/app/info.rb +3 -3
- data/lib/gloo/app/log.rb +17 -17
- data/lib/gloo/app/mode.rb +4 -4
- data/lib/gloo/app/settings.rb +51 -41
- data/lib/gloo/convert/string_to_datetime.rb +21 -0
- data/lib/gloo/convert/string_to_decimal.rb +20 -0
- data/lib/gloo/convert/string_to_integer.rb +20 -0
- data/lib/gloo/core/baseo.rb +7 -7
- data/lib/gloo/core/dictionary.rb +30 -27
- data/lib/gloo/core/error.rb +50 -0
- data/lib/gloo/core/event_manager.rb +17 -23
- data/lib/gloo/core/factory.rb +149 -39
- data/lib/gloo/core/gloo_system.rb +121 -54
- data/lib/gloo/core/heap.rb +15 -13
- data/lib/gloo/core/it.rb +5 -5
- data/lib/gloo/core/literal.rb +7 -7
- data/lib/gloo/core/obj.rb +138 -79
- data/lib/gloo/core/obj_finder.rb +9 -14
- data/lib/gloo/core/op.rb +8 -8
- data/lib/gloo/core/parser.rb +27 -26
- data/lib/gloo/core/pn.rb +68 -52
- data/lib/gloo/core/script.rb +7 -7
- data/lib/gloo/core/tokens.rb +39 -41
- data/lib/gloo/core/verb.rb +30 -19
- data/lib/gloo/exec/dispatch.rb +30 -0
- data/lib/gloo/exec/runner.rb +43 -0
- data/lib/gloo/expr/expression.rb +36 -43
- data/lib/gloo/expr/l_boolean.rb +7 -6
- data/lib/gloo/expr/l_decimal.rb +34 -0
- data/lib/gloo/expr/l_integer.rb +5 -4
- data/lib/gloo/expr/l_string.rb +13 -15
- data/lib/gloo/expr/op_div.rb +5 -5
- data/lib/gloo/expr/op_minus.rb +5 -5
- data/lib/gloo/expr/op_mult.rb +5 -5
- data/lib/gloo/expr/op_plus.rb +7 -7
- data/lib/gloo/objs/basic/alias.rb +111 -0
- data/lib/gloo/objs/basic/boolean.rb +63 -38
- data/lib/gloo/objs/basic/container.rb +71 -12
- data/lib/gloo/objs/basic/decimal.rb +96 -0
- data/lib/gloo/objs/basic/integer.rb +45 -16
- data/lib/gloo/objs/basic/script.rb +62 -38
- data/lib/gloo/objs/basic/string.rb +47 -15
- data/lib/gloo/objs/basic/text.rb +69 -21
- data/lib/gloo/objs/basic/untyped.rb +35 -10
- data/lib/gloo/objs/cli/banner.rb +137 -0
- data/lib/gloo/objs/cli/bar.rb +141 -0
- data/lib/gloo/objs/cli/colorize.rb +54 -24
- data/lib/gloo/objs/cli/confirm.rb +63 -29
- data/lib/gloo/objs/cli/menu.rb +236 -0
- data/lib/gloo/objs/cli/menu_item.rb +128 -0
- data/lib/gloo/objs/cli/pastel.rb +120 -0
- data/lib/gloo/objs/cli/prompt.rb +73 -31
- data/lib/gloo/objs/cli/select.rb +153 -0
- data/lib/gloo/objs/ctrl/each.rb +128 -61
- data/lib/gloo/objs/ctrl/repeat.rb +129 -0
- data/lib/gloo/objs/data/markdown.rb +109 -0
- data/lib/gloo/objs/data/table.rb +168 -0
- data/lib/gloo/objs/dev/git.rb +98 -64
- data/lib/gloo/objs/dt/date.rb +72 -0
- data/lib/gloo/objs/dt/datetime.rb +84 -0
- data/lib/gloo/objs/dt/time.rb +72 -0
- data/lib/gloo/objs/ror/erb.rb +82 -41
- data/lib/gloo/objs/ror/eval.rb +73 -31
- data/lib/gloo/objs/snd/play.rb +71 -0
- data/lib/gloo/objs/snd/say.rb +120 -0
- data/lib/gloo/objs/system/file_handle.rb +129 -48
- data/lib/gloo/objs/system/system.rb +84 -38
- data/lib/gloo/objs/web/http_get.rb +103 -46
- data/lib/gloo/objs/web/http_post.rb +70 -44
- data/lib/gloo/objs/web/json.rb +155 -0
- data/lib/gloo/objs/web/slack.rb +89 -58
- data/lib/gloo/objs/web/teams.rb +88 -53
- data/lib/gloo/objs/web/uri.rb +160 -0
- data/lib/gloo/persist/file_loader.rb +95 -85
- data/lib/gloo/persist/file_saver.rb +12 -12
- data/lib/gloo/persist/file_storage.rb +15 -15
- data/lib/gloo/persist/line_splitter.rb +79 -0
- data/lib/gloo/persist/persist_man.rb +63 -39
- data/lib/gloo/utils/words.rb +2 -2
- data/lib/gloo/verbs/alert.rb +67 -16
- data/lib/gloo/verbs/beep.rb +70 -0
- data/lib/gloo/verbs/cls.rb +67 -0
- data/lib/gloo/verbs/context.rb +61 -21
- data/lib/gloo/verbs/create.rb +52 -21
- data/lib/gloo/verbs/help.rb +186 -27
- data/lib/gloo/verbs/if.rb +55 -21
- data/lib/gloo/verbs/list.rb +55 -24
- data/lib/gloo/verbs/load.rb +47 -12
- data/lib/gloo/verbs/move.rb +128 -0
- data/lib/gloo/verbs/put.rb +90 -34
- data/lib/gloo/verbs/quit.rb +43 -12
- data/lib/gloo/verbs/run.rb +63 -18
- data/lib/gloo/verbs/save.rb +45 -10
- data/lib/gloo/verbs/show.rb +56 -22
- data/lib/gloo/verbs/tell.rb +45 -13
- data/lib/gloo/verbs/unless.rb +56 -21
- data/lib/gloo/verbs/version.rb +42 -12
- data/lib/gloo/verbs/wait.rb +73 -0
- data/lib/run.rb +5 -5
- metadata +90 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3c1b097b88823cb4f2295c3f5c78cea3d03f5150c77417e013678dcec59b6ee
|
4
|
+
data.tar.gz: 73ecf73cc7d4879c1abd1cad7a2fb9f8a60bdcc39eccf77671c2f2d44583a6f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a108a19699bc347f4dced3b53863a39f6eec154861c40cd673d6964d27549b38607e5e276c5c74313d1648fd454db9667296ee0429abed3a793a687261b67c3
|
7
|
+
data.tar.gz: 0e0e9e2540d76a57ae268f1f70e51e8735575743819a5d89e7c3947bdb6cdfb3d44566cbc0359081056bd93e0f75c745046686cb3a5183f94681bd09d410f9c1
|
data/.DS_Store
ADDED
Binary file
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- 'gloo.gemspec'
|
4
|
+
|
5
|
+
# -------------- Layout -------------- #
|
6
|
+
Layout/SpaceInsideParens:
|
7
|
+
EnforcedStyle: space
|
8
|
+
Layout/EmptyLinesAroundClassBody:
|
9
|
+
EnforcedStyle: empty_lines
|
10
|
+
Layout/SpaceAroundMethodCallOperator:
|
11
|
+
Enabled: true
|
12
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
13
|
+
EnforcedStyle: space
|
14
|
+
Layout/SpaceInsideReferenceBrackets:
|
15
|
+
Enabled: true
|
16
|
+
EnforcedStyle: space
|
17
|
+
|
18
|
+
# -------------- Style -------------- #
|
19
|
+
Style/RescueStandardError:
|
20
|
+
EnforcedStyle: implicit
|
21
|
+
Style/HashSyntax:
|
22
|
+
EnforcedStyle: no_mixed_keys
|
23
|
+
Style/ExponentialNotation:
|
24
|
+
Enabled: true
|
25
|
+
Style/HashEachMethods:
|
26
|
+
Enabled: true
|
27
|
+
Style/HashTransformKeys:
|
28
|
+
Enabled: true
|
29
|
+
Style/HashTransformValues:
|
30
|
+
Enabled: true
|
31
|
+
Style/RedundantReturn:
|
32
|
+
Enabled: false
|
33
|
+
Style/FrozenStringLiteralComment:
|
34
|
+
Enabled: false
|
35
|
+
Style/GlobalVars:
|
36
|
+
Enabled: false
|
37
|
+
Style/Documentation:
|
38
|
+
Enabled: false
|
39
|
+
Style/RedundantSelf:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
# -------------- Naming -------------- #
|
43
|
+
Naming/PredicateName:
|
44
|
+
Enabled: true
|
45
|
+
Naming/AccessorMethodName:
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
# -------------- Metrics -------------- #
|
49
|
+
Metrics/MethodLength:
|
50
|
+
Max: 17 # Default is 10
|
51
|
+
Enabled: true
|
52
|
+
Metrics/CyclomaticComplexity:
|
53
|
+
Max: 9 # Default is 6
|
54
|
+
Naming/MethodParameterName:
|
55
|
+
MinNameLength: 2 # Default value is 3
|
56
|
+
Metrics/PerceivedComplexity:
|
57
|
+
Max: 10 # default value is 7
|
58
|
+
Metrics/ClassLength:
|
59
|
+
Max: 157 # default is 100
|
60
|
+
Metrics/AbcSize:
|
61
|
+
Max: 37 # default is 15
|
62
|
+
|
63
|
+
# -------------- Lint -------------- #
|
64
|
+
Lint/RaiseException:
|
65
|
+
Enabled: true
|
66
|
+
Lint/StructNewOverride:
|
67
|
+
Enabled: true
|
68
|
+
Lint/NonDeterministicRequireOrder:
|
69
|
+
Enabled: false
|
70
|
+
|
71
|
+
# -------------- Security -------------- #
|
72
|
+
Security/Eval:
|
73
|
+
Enabled: true
|
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
3
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in gloo.gemspec
|
6
6
|
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,130 +1,133 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gloo (0.
|
5
|
-
activesupport (~> 5.2, >= 5.2.
|
4
|
+
gloo (0.5.2)
|
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
|
+
json (~> 2.1, >= 2.1.0)
|
9
|
+
openssl (~> 2.1, >= 2.1.0)
|
8
10
|
tty (~> 0.8, >= 0.8.1)
|
9
11
|
|
10
12
|
GEM
|
11
13
|
remote: https://rubygems.org/
|
12
14
|
specs:
|
13
|
-
activesupport (5.2.
|
15
|
+
activesupport (5.2.4.3)
|
14
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
17
|
i18n (>= 0.7, < 2)
|
16
18
|
minitest (~> 5.1)
|
17
19
|
tzinfo (~> 1.1)
|
18
20
|
chronic (0.10.2)
|
19
21
|
colorize (0.8.1)
|
20
|
-
concurrent-ruby (1.1.
|
21
|
-
diff-lcs (1.
|
22
|
-
equatable (0.
|
23
|
-
i18n (1.
|
22
|
+
concurrent-ruby (1.1.7)
|
23
|
+
diff-lcs (1.4.4)
|
24
|
+
equatable (0.6.1)
|
25
|
+
i18n (1.8.5)
|
24
26
|
concurrent-ruby (~> 1.0)
|
27
|
+
json (2.3.1)
|
25
28
|
kramdown (1.16.2)
|
26
29
|
minitest (5.11.3)
|
27
|
-
necromancer (0.
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
necromancer (0.5.1)
|
31
|
+
openssl (2.2.0)
|
32
|
+
pastel (0.7.4)
|
33
|
+
equatable (~> 0.6)
|
34
|
+
tty-color (~> 0.5)
|
35
|
+
rake (13.0.1)
|
36
|
+
rouge (3.22.0)
|
37
|
+
strings (0.1.8)
|
38
|
+
strings-ansi (~> 0.1)
|
39
|
+
unicode-display_width (~> 1.5)
|
40
|
+
unicode_utils (~> 1.4)
|
37
41
|
strings-ansi (0.1.0)
|
38
42
|
thor (0.20.3)
|
39
43
|
thread_safe (0.3.6)
|
40
|
-
|
41
|
-
tty (0.9.1)
|
44
|
+
tty (0.10.0)
|
42
45
|
bundler (~> 1.16, < 2.0)
|
43
46
|
equatable (~> 0.5)
|
44
47
|
pastel (~> 0.7.2)
|
45
48
|
thor (~> 0.20.0)
|
46
|
-
tty-box (~> 0.
|
47
|
-
tty-color (~> 0.
|
48
|
-
tty-command (~> 0.
|
49
|
-
tty-config (~> 0.3.
|
50
|
-
tty-cursor (~> 0.
|
51
|
-
tty-editor (~> 0.5
|
52
|
-
tty-file (~> 0.
|
53
|
-
tty-font (~> 0.
|
54
|
-
tty-
|
55
|
-
tty-
|
56
|
-
tty-
|
57
|
-
tty-
|
58
|
-
tty-
|
59
|
-
tty-
|
60
|
-
tty-
|
61
|
-
tty-
|
62
|
-
tty-
|
63
|
-
tty-
|
49
|
+
tty-box (~> 0.4.1)
|
50
|
+
tty-color (~> 0.5)
|
51
|
+
tty-command (~> 0.9.0)
|
52
|
+
tty-config (~> 0.3.2)
|
53
|
+
tty-cursor (~> 0.7)
|
54
|
+
tty-editor (~> 0.5)
|
55
|
+
tty-file (~> 0.8.0)
|
56
|
+
tty-font (~> 0.4.0)
|
57
|
+
tty-logger (~> 0.2.0)
|
58
|
+
tty-markdown (~> 0.6.0)
|
59
|
+
tty-pager (~> 0.12)
|
60
|
+
tty-pie (~> 0.3.0)
|
61
|
+
tty-platform (~> 0.2)
|
62
|
+
tty-progressbar (~> 0.17)
|
63
|
+
tty-prompt (~> 0.19)
|
64
|
+
tty-screen (~> 0.7)
|
65
|
+
tty-spinner (~> 0.9)
|
66
|
+
tty-table (~> 0.11.0)
|
67
|
+
tty-tree (~> 0.3)
|
64
68
|
tty-which (~> 0.4)
|
65
|
-
tty-box (0.
|
69
|
+
tty-box (0.4.1)
|
66
70
|
pastel (~> 0.7.2)
|
67
|
-
strings (~> 0.1.
|
68
|
-
tty-cursor (~> 0.
|
69
|
-
tty-color (0.
|
70
|
-
tty-command (0.
|
71
|
+
strings (~> 0.1.6)
|
72
|
+
tty-cursor (~> 0.7)
|
73
|
+
tty-color (0.5.2)
|
74
|
+
tty-command (0.9.0)
|
71
75
|
pastel (~> 0.7.0)
|
72
|
-
tty-config (0.3.
|
73
|
-
tty-cursor (0.
|
74
|
-
tty-editor (0.5.
|
75
|
-
tty-prompt (~> 0.
|
76
|
+
tty-config (0.3.2)
|
77
|
+
tty-cursor (0.7.1)
|
78
|
+
tty-editor (0.5.1)
|
79
|
+
tty-prompt (~> 0.19)
|
76
80
|
tty-which (~> 0.4)
|
77
|
-
tty-file (0.
|
81
|
+
tty-file (0.8.0)
|
78
82
|
diff-lcs (~> 1.3)
|
79
83
|
pastel (~> 0.7.2)
|
80
84
|
tty-prompt (~> 0.18)
|
81
|
-
tty-font (0.
|
82
|
-
tty-
|
85
|
+
tty-font (0.4.0)
|
86
|
+
tty-logger (0.2.0)
|
87
|
+
pastel (~> 0.7.0)
|
88
|
+
tty-markdown (0.6.0)
|
83
89
|
kramdown (~> 1.16.2)
|
84
90
|
pastel (~> 0.7.2)
|
85
91
|
rouge (~> 3.3)
|
86
92
|
strings (~> 0.1.4)
|
87
93
|
tty-color (~> 0.4)
|
88
94
|
tty-screen (~> 0.6)
|
89
|
-
tty-pager (0.
|
90
|
-
strings (~> 0.1.
|
91
|
-
tty-screen (~> 0.
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
tty-
|
97
|
-
tty-progressbar (0.16.0)
|
95
|
+
tty-pager (0.13.0)
|
96
|
+
strings (~> 0.1.8)
|
97
|
+
tty-screen (~> 0.8)
|
98
|
+
tty-pie (0.3.0)
|
99
|
+
pastel (~> 0.7.3)
|
100
|
+
tty-cursor (~> 0.7)
|
101
|
+
tty-platform (0.3.0)
|
102
|
+
tty-progressbar (0.17.0)
|
98
103
|
strings-ansi (~> 0.1.0)
|
99
|
-
tty-cursor (~> 0.
|
100
|
-
tty-screen (~> 0.
|
101
|
-
unicode-display_width (~> 1.
|
102
|
-
tty-prompt (0.
|
103
|
-
necromancer (~> 0.
|
104
|
+
tty-cursor (~> 0.7)
|
105
|
+
tty-screen (~> 0.7)
|
106
|
+
unicode-display_width (~> 1.6)
|
107
|
+
tty-prompt (0.21.0)
|
108
|
+
necromancer (~> 0.5.0)
|
104
109
|
pastel (~> 0.7.0)
|
105
|
-
|
106
|
-
|
107
|
-
tty-
|
108
|
-
|
109
|
-
tty-cursor (~> 0.6.0)
|
110
|
-
tty-screen (~> 0.6.4)
|
110
|
+
tty-reader (~> 0.7.0)
|
111
|
+
tty-reader (0.7.0)
|
112
|
+
tty-cursor (~> 0.7)
|
113
|
+
tty-screen (~> 0.7)
|
111
114
|
wisper (~> 2.0.0)
|
112
|
-
tty-screen (0.
|
113
|
-
tty-spinner (0.9.
|
114
|
-
tty-cursor (~> 0.
|
115
|
-
tty-table (0.
|
116
|
-
equatable (~> 0.
|
117
|
-
necromancer (~> 0.
|
115
|
+
tty-screen (0.8.1)
|
116
|
+
tty-spinner (0.9.3)
|
117
|
+
tty-cursor (~> 0.7)
|
118
|
+
tty-table (0.11.0)
|
119
|
+
equatable (~> 0.6)
|
120
|
+
necromancer (~> 0.5)
|
118
121
|
pastel (~> 0.7.2)
|
119
|
-
strings (~> 0.1.
|
120
|
-
tty-screen (~> 0.
|
121
|
-
tty-tree (0.
|
122
|
-
tty-which (0.4.
|
123
|
-
tzinfo (1.2.
|
122
|
+
strings (~> 0.1.5)
|
123
|
+
tty-screen (~> 0.7)
|
124
|
+
tty-tree (0.4.0)
|
125
|
+
tty-which (0.4.2)
|
126
|
+
tzinfo (1.2.7)
|
124
127
|
thread_safe (~> 0.1)
|
125
|
-
unicode-display_width (1.
|
128
|
+
unicode-display_width (1.7.0)
|
126
129
|
unicode_utils (1.4.0)
|
127
|
-
wisper (2.0.
|
130
|
+
wisper (2.0.1)
|
128
131
|
|
129
132
|
PLATFORMS
|
130
133
|
ruby
|
@@ -133,7 +136,7 @@ DEPENDENCIES
|
|
133
136
|
bundler (~> 1.16)
|
134
137
|
gloo!
|
135
138
|
minitest (~> 5.0)
|
136
|
-
rake (~>
|
139
|
+
rake (~> 13.0, >= 13.0.1)
|
137
140
|
|
138
141
|
BUNDLED WITH
|
139
142
|
1.16.2
|
data/Rakefile
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rake/testtask'
|
3
3
|
|
4
4
|
Rake::TestTask.new(:test) do |t|
|
5
|
-
ENV[ 'GLOO_ENV' ] =
|
5
|
+
ENV[ 'GLOO_ENV' ] = 'TEST'
|
6
6
|
|
7
|
-
t.
|
8
|
-
t.libs <<
|
9
|
-
t.
|
7
|
+
t.warning = false
|
8
|
+
t.libs << 'test'
|
9
|
+
t.libs << 'lib'
|
10
|
+
t.test_files = FileList['test/**/*_test.rb']
|
10
11
|
end
|
11
12
|
|
12
13
|
task :default => :test
|
data/bin/console
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'gloo'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
8
8
|
|
9
9
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require
|
10
|
+
# require 'pry'
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start(__FILE__)
|
data/gloo.gemspec
CHANGED
@@ -4,15 +4,15 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require "gloo/app/info"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'gloo'
|
8
8
|
spec.version = Gloo::App::Info::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Eric Crane']
|
10
|
+
spec.email = ['eric.crane@mac.com']
|
11
11
|
|
12
12
|
spec.summary = %q{Gloo scripting language. A scripting language built on ruby.}
|
13
13
|
spec.description = %q{A scripting languge to keep it all together.}
|
14
14
|
spec.homepage = "http://github.com/ecrane/gloo"
|
15
|
-
spec.license =
|
15
|
+
spec.license = 'MIT'
|
16
16
|
|
17
17
|
# Specify which files should be added to the gem when it is released.
|
18
18
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -20,19 +20,23 @@ Gem::Specification.new do |spec|
|
|
20
20
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
21
|
end
|
22
22
|
|
23
|
-
spec.bindir =
|
23
|
+
spec.bindir = 'exe'
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
|
-
spec.require_paths = [
|
26
|
-
|
27
|
-
spec.executables <<
|
28
|
-
spec.executables <<
|
29
|
-
|
30
|
-
spec.add_development_dependency
|
31
|
-
spec.add_development_dependency
|
32
|
-
spec.add_development_dependency
|
33
|
-
|
34
|
-
|
35
|
-
spec.add_dependency "
|
36
|
-
spec.add_dependency
|
37
|
-
spec.add_dependency
|
25
|
+
spec.require_paths = ['lib']
|
26
|
+
|
27
|
+
spec.executables << 'o'
|
28
|
+
spec.executables << 'gloo'
|
29
|
+
|
30
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
31
|
+
spec.add_development_dependency 'minitest', '~> 5.0'
|
32
|
+
# spec.add_development_dependency 'rake', '~> 10.0'
|
33
|
+
spec.add_development_dependency "rake", '~> 13.0', '>= 13.0.1'
|
34
|
+
|
35
|
+
spec.add_dependency "activesupport", '~> 5.2', ">= 5.2.4.3"
|
36
|
+
# spec.add_dependency 'activesupport', '~> 5.2', '>= 5.2.1'
|
37
|
+
spec.add_dependency 'chronic', '~> 0.10', '>= 0.10.2'
|
38
|
+
spec.add_dependency 'colorize', '~> 0.8', '>= 0.8.1'
|
39
|
+
spec.add_dependency 'tty', '~> 0.8', '>= 0.8.1'
|
40
|
+
spec.add_dependency 'json', '~> 2.1', '>= 2.1.0'
|
41
|
+
spec.add_dependency 'openssl', '~> 2.1', '>= 2.1.0'
|
38
42
|
end
|
data/lib/gloo.rb
CHANGED
@@ -5,15 +5,15 @@
|
|
5
5
|
#
|
6
6
|
|
7
7
|
path = File.dirname( File.absolute_path( __FILE__ ) )
|
8
|
-
root = File.join( path,
|
9
|
-
Dir.glob( root )
|
10
|
-
|
11
|
-
|
8
|
+
root = File.join( path, 'gloo', '**/*.rb' )
|
9
|
+
Dir.glob( root ).each do |ruby_file|
|
10
|
+
require ruby_file
|
11
|
+
end
|
12
12
|
|
13
|
+
module Gloo
|
13
14
|
def self.run
|
14
15
|
params = []
|
15
|
-
( params <<
|
16
|
+
( params << '--cli' ) if ARGV.count.zero?
|
16
17
|
Gloo::App::Engine.new( params ).start
|
17
18
|
end
|
18
|
-
|
19
19
|
end
|
data/lib/gloo/app/args.rb
CHANGED
@@ -11,61 +11,60 @@ require 'colorize'
|
|
11
11
|
module Gloo
|
12
12
|
module App
|
13
13
|
class Args
|
14
|
-
|
15
|
-
attr_reader :switches, :files
|
16
|
-
|
14
|
+
|
15
|
+
attr_reader :switches, :files
|
16
|
+
|
17
17
|
def initialize( params = [] )
|
18
18
|
@switches = []
|
19
19
|
@files = []
|
20
|
-
|
20
|
+
|
21
21
|
params.each { |o| process_one_arg( o ) }
|
22
22
|
ARGV.each { |o| process_one_arg( o ) }
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
# Was the --quiet arg passed?
|
26
26
|
def quiet?
|
27
|
-
return @switches.include?(
|
27
|
+
return @switches.include?( 'quiet' )
|
28
28
|
end
|
29
|
-
|
30
|
-
#
|
29
|
+
|
30
|
+
#
|
31
31
|
# Detect the mode to be run in.
|
32
32
|
# Start by seeing if a mode is specified.
|
33
33
|
# Then look for the presence of files.
|
34
34
|
# Then finally use the default: embedded mode.
|
35
|
-
#
|
35
|
+
#
|
36
36
|
def detect_mode
|
37
|
-
if ENV[ 'GLOO_ENV' ] ==
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
37
|
+
mode = if ENV[ 'GLOO_ENV' ] == 'test'
|
38
|
+
Mode::TEST
|
39
|
+
elsif @switches.include?( 'version' )
|
40
|
+
Mode::VERSION
|
41
|
+
elsif @switches.include?( 'help' )
|
42
|
+
Mode::HELP
|
43
|
+
elsif @switches.include?( 'cli' )
|
44
|
+
Mode::CLI
|
45
|
+
elsif @switches.include?( 'embed' )
|
46
|
+
Mode::EMBED
|
47
|
+
elsif @files.count.positive?
|
48
|
+
Mode::SCRIPT
|
49
|
+
else
|
50
|
+
Mode.default_mode
|
51
|
+
end
|
52
52
|
$log.debug "running in #{mode} mode"
|
53
|
-
|
53
|
+
|
54
54
|
return mode
|
55
55
|
end
|
56
56
|
|
57
|
-
|
58
57
|
private
|
59
|
-
|
58
|
+
|
60
59
|
# Process one argument or parameter.
|
61
|
-
def process_one_arg arg
|
62
|
-
if arg.start_with?
|
63
|
-
switches << arg[2..-1]
|
60
|
+
def process_one_arg( arg )
|
61
|
+
if arg.start_with? '--'
|
62
|
+
switches << arg[ 2..-1 ]
|
64
63
|
else
|
65
64
|
files << arg
|
66
65
|
end
|
67
66
|
end
|
68
|
-
|
67
|
+
|
69
68
|
end
|
70
69
|
end
|
71
70
|
end
|