gloo-lang 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/VERSION +1 -1
- data/lib/gloo_lang/app/engine.rb +5 -2
- data/lib/gloo_lang/app/log.rb +8 -10
- data/lib/gloo_lang/app/settings.rb +34 -10
- data/lib/gloo_lang/verbs/show.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42b1ca8c03074ae64ac797bfcdc72b17479cabead579fb94dd8232cbeef3fc6a
|
4
|
+
data.tar.gz: 34c0a1d8d4aabfd76f8d34d170de91760030ce15f49cdbceacad202cd43dfa55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8578816796520b92afdc8671fd914d2612dd5a512b6cc03bff9602ea3f9851902fe61753a59c58526e2aedafbe4f00eb6647c25df49cfbbf046d4c02545ad5b8
|
7
|
+
data.tar.gz: 132b981e50798bfdada690d892ddb67677d001036b08faa058c705317bf995006c2d40e022ca79269d45610e0535f9b0f2422f77f6b48b79b03c04f95ec67958
|
data/lib/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.6
|
data/lib/gloo_lang/app/engine.rb
CHANGED
@@ -19,11 +19,14 @@ module GlooLang
|
|
19
19
|
#
|
20
20
|
# Set up the engine with basic elements.
|
21
21
|
#
|
22
|
-
def initialize( params = [], platform=nil )
|
22
|
+
def initialize( params = [], platform=nil, log=nil )
|
23
23
|
$engine = self
|
24
24
|
@args = Args.new( params )
|
25
25
|
$settings = Settings.new( ENV[ 'GLOO_ENV' ] )
|
26
|
-
|
26
|
+
|
27
|
+
$log = log ? log : Log.new
|
28
|
+
$log.quiet = @args.quiet?
|
29
|
+
|
27
30
|
@platform = platform ? platform : Platform.new
|
28
31
|
$log.debug 'engine intialized...'
|
29
32
|
end
|
data/lib/gloo_lang/app/log.rb
CHANGED
@@ -4,25 +4,23 @@
|
|
4
4
|
# Application Logging wrapper.
|
5
5
|
#
|
6
6
|
require 'active_support'
|
7
|
-
require 'colorize'
|
8
|
-
require 'colorized_string'
|
9
7
|
|
10
8
|
module GlooLang
|
11
9
|
module App
|
12
10
|
class Log
|
13
11
|
|
14
|
-
attr_reader :logger
|
12
|
+
attr_reader :logger
|
13
|
+
attr_accessor :quiet
|
15
14
|
|
16
15
|
#
|
17
16
|
# Set up a logger.
|
18
17
|
# If quiet is true, then message are written to the log
|
19
18
|
# but not to the console.
|
20
19
|
#
|
21
|
-
def initialize( quiet )
|
20
|
+
def initialize( quiet=true )
|
22
21
|
f = File.join( $settings.log_path, 'gloo.log' )
|
23
22
|
@logger = Logger.new( f )
|
24
23
|
@logger.level = Logger::DEBUG
|
25
|
-
@quiet = quiet
|
26
24
|
end
|
27
25
|
|
28
26
|
#
|
@@ -45,7 +43,7 @@ module GlooLang
|
|
45
43
|
#
|
46
44
|
def info( msg )
|
47
45
|
@logger.info msg
|
48
|
-
puts msg
|
46
|
+
puts msg unless @quiet
|
49
47
|
end
|
50
48
|
|
51
49
|
#
|
@@ -54,7 +52,7 @@ module GlooLang
|
|
54
52
|
#
|
55
53
|
def warn( msg )
|
56
54
|
@logger.warn msg
|
57
|
-
puts msg
|
55
|
+
puts msg unless @quiet
|
58
56
|
end
|
59
57
|
|
60
58
|
#
|
@@ -68,11 +66,11 @@ module GlooLang
|
|
68
66
|
if ex
|
69
67
|
@logger.error ex.message
|
70
68
|
@logger.error ex.backtrace
|
71
|
-
puts msg
|
72
|
-
puts ex.message
|
69
|
+
puts msg unless @quiet
|
70
|
+
puts ex.message unless @quiet
|
73
71
|
puts ex.backtrace unless @quiet
|
74
72
|
else
|
75
|
-
puts msg
|
73
|
+
puts msg unless @quiet
|
76
74
|
end
|
77
75
|
end
|
78
76
|
|
@@ -5,7 +5,6 @@
|
|
5
5
|
#
|
6
6
|
|
7
7
|
require 'yaml'
|
8
|
-
require 'colorize'
|
9
8
|
|
10
9
|
module GlooLang
|
11
10
|
module App
|
@@ -47,11 +46,11 @@ module GlooLang
|
|
47
46
|
# Can be seen in app with 'help settings'
|
48
47
|
#
|
49
48
|
def show
|
50
|
-
puts "\nApplication Settings:"
|
51
|
-
puts ' Startup with: '
|
52
|
-
puts ' Indent in Listing: '
|
53
|
-
puts ' Screen Lines: '
|
54
|
-
puts ' Page Size: '
|
49
|
+
puts "\nApplication Settings:"
|
50
|
+
puts ' Startup with: ' + @start_with
|
51
|
+
puts ' Indent in Listing: ' + @list_indent.to_s
|
52
|
+
puts ' Screen Lines: ' + GlooLang::App::Settings.lines.to_s
|
53
|
+
puts ' Page Size: ' + GlooLang::App::Settings.page_size.to_s
|
55
54
|
puts ''
|
56
55
|
self.show_paths
|
57
56
|
puts ''
|
@@ -61,12 +60,37 @@ module GlooLang
|
|
61
60
|
# Show path settings
|
62
61
|
#
|
63
62
|
def show_paths
|
64
|
-
puts ' User Root Path is here: '
|
65
|
-
puts ' Projects Path: '
|
66
|
-
puts ' Tmp Path: '
|
67
|
-
puts ' Debug Path: '
|
63
|
+
puts ' User Root Path is here: ' + @user_root
|
64
|
+
puts ' Projects Path: ' + @project_path
|
65
|
+
puts ' Tmp Path: ' + @tmp_path
|
66
|
+
puts ' Debug Path: ' + @debug_path
|
68
67
|
end
|
69
68
|
|
69
|
+
# #
|
70
|
+
# # Show the current application settings.
|
71
|
+
# # Can be seen in app with 'help settings'
|
72
|
+
# #
|
73
|
+
# def show
|
74
|
+
# puts "\nApplication Settings:".blue
|
75
|
+
# puts ' Startup with: '.yellow + @start_with.white
|
76
|
+
# puts ' Indent in Listing: '.yellow + @list_indent.to_s.white
|
77
|
+
# puts ' Screen Lines: '.yellow + GlooLang::App::Settings.lines.to_s.white
|
78
|
+
# puts ' Page Size: '.yellow + GlooLang::App::Settings.page_size.to_s.white
|
79
|
+
# puts ''
|
80
|
+
# self.show_paths
|
81
|
+
# puts ''
|
82
|
+
# end
|
83
|
+
#
|
84
|
+
# #
|
85
|
+
# # Show path settings
|
86
|
+
# #
|
87
|
+
# def show_paths
|
88
|
+
# puts ' User Root Path is here: '.yellow + @user_root.white
|
89
|
+
# puts ' Projects Path: '.yellow + @project_path.white
|
90
|
+
# puts ' Tmp Path: '.yellow + @tmp_path.white
|
91
|
+
# puts ' Debug Path: '.yellow + @debug_path.white
|
92
|
+
# end
|
93
|
+
|
70
94
|
#
|
71
95
|
# Get the number of vertical lines on screen.
|
72
96
|
#
|
data/lib/gloo_lang/verbs/show.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# Show a single object's value.
|
5
5
|
#
|
6
|
-
require 'colorized_string'
|
6
|
+
# require 'colorized_string'
|
7
7
|
|
8
8
|
module GlooLang
|
9
9
|
module Verbs
|
@@ -54,7 +54,8 @@ module GlooLang
|
|
54
54
|
expr = GlooLang::Expr::Expression.new( @params.tokens )
|
55
55
|
val = expr.evaluate
|
56
56
|
color = val.to_sym
|
57
|
-
return ColorizedString[ str.to_s ].colorize( color )
|
57
|
+
# return ColorizedString[ str.to_s ].colorize( color )
|
58
|
+
return str.to_s
|
58
59
|
end
|
59
60
|
return str
|
60
61
|
end
|