gloo-lang 0.9.9 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 402d31f29ed04334fc22758dd7aaa7cc230f66ccf341e3cc5b1cedc42fdf998d
4
- data.tar.gz: 10d69c788bf1975b3beb2eb79eff6d18a919f2956678be2d6649b407b6b1ad9e
3
+ metadata.gz: 60aa43dd1dedbfb551e5e3a5df9e85faa850bde257385062faf364bc757c1f48
4
+ data.tar.gz: 153fc30d28490c8e55e16e4e9432e552344e31940627b40cc0b2b549c89fda95
5
5
  SHA512:
6
- metadata.gz: 5887c6675f3ca5c7df494f351b7e25c06a118dcc73c84fe0e94242b59d1dcb3ce130216c4e164761a6e0a49855ce49ac88ede67f0a3434594069c8ac693fe937
7
- data.tar.gz: 7849d0fc9c9dabcdb70238b0b1d5b5108fc7c3ed6e41c9d3608ada059ed1d0c514fdcdb8ddb1cb24d8a616beef3933e84e5c6faac2d81bc6a8019bdb00bcf5e6
6
+ metadata.gz: 2f5cf337061911c08ba2c4b58be007008912c90387ddce1cd2007303dd6b70609b97b6aec8524a0d0a992010a70d3e6a393e8a931da8584a64fbcb8ecaf689ed
7
+ data.tar.gz: 460d792ef6934ded17ff3e6a60ccba9c422219b3e93ff353d4c631d5f4bfba19c373845eb58cf4cea82a26f4a401082318793aa2473dc9ac23b3ef81502254ff
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gloo-lang (0.9.7)
4
+ gloo-lang (0.9.11)
5
+ activesupport (~> 6.1, >= 6.1.4.6)
5
6
  chronic (~> 0.10, >= 0.10.2)
6
7
  json (~> 2.1, >= 2.1.0)
7
8
  net-ssh (~> 6.1, >= 6.1.0)
@@ -11,8 +12,17 @@ PATH
11
12
  GEM
12
13
  remote: https://rubygems.org/
13
14
  specs:
15
+ activesupport (6.1.5)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ tzinfo (~> 2.0)
20
+ zeitwerk (~> 2.3)
14
21
  ast (2.4.2)
15
22
  chronic (0.10.2)
23
+ concurrent-ruby (1.1.10)
24
+ i18n (1.10.0)
25
+ concurrent-ruby (~> 1.0)
16
26
  ipaddr (1.2.4)
17
27
  json (2.6.1)
18
28
  minitest (5.15.0)
@@ -39,7 +49,10 @@ GEM
39
49
  parser (>= 3.1.1.0)
40
50
  ruby-progressbar (1.11.0)
41
51
  tty-platform (0.3.0)
52
+ tzinfo (2.0.4)
53
+ concurrent-ruby (~> 1.0)
42
54
  unicode-display_width (2.1.0)
55
+ zeitwerk (2.5.4)
43
56
 
44
57
  PLATFORMS
45
58
  x86_64-darwin-21
@@ -47,7 +60,7 @@ PLATFORMS
47
60
  DEPENDENCIES
48
61
  bundler (~> 2.2.22)
49
62
  gloo-lang!
50
- minitest (~> 5.0)
63
+ minitest (~> 5.1)
51
64
  rake (~> 13.0, >= 13.0.1)
52
65
  rubocop
53
66
 
data/gloo-lang.gemspec CHANGED
@@ -24,10 +24,10 @@ Gem::Specification.new do |spec|
24
24
  spec.require_paths = ['lib']
25
25
 
26
26
  spec.add_development_dependency 'bundler', '~> 2.2.22'
27
- spec.add_development_dependency 'minitest', '~> 5.0'
27
+ spec.add_development_dependency 'minitest', '~> 5.1'
28
28
  spec.add_development_dependency "rake", '~> 13.0', '>= 13.0.1'
29
29
 
30
- # spec.add_dependency "activesupport", '~> 6.1', ">= 6.1.4.6"
30
+ spec.add_dependency "activesupport", '~> 6.1', ">= 6.1.4.6"
31
31
  spec.add_dependency 'chronic', '~> 0.10', '>= 0.10.2'
32
32
  spec.add_dependency 'json', '~> 2.1', '>= 2.1.0'
33
33
  spec.add_dependency 'openssl', '~> 2.1', '>= 2.1.0'
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.9
1
+ 1.0.0
@@ -20,12 +20,15 @@ module GlooLang
20
20
  #
21
21
  # Set up the engine with basic elements.
22
22
  #
23
- def initialize( params = [], platform=Platform, log=Log )
24
- @args = Args.new( self, params )
25
- @settings = Settings.new( self, ENV[ 'GLOO_ENV' ] )
23
+ def initialize( context )
24
+ @args = Args.new( self, context.params )
25
+ @settings = Settings.new( self, context.user_root )
26
26
 
27
- @log = Log.new( self, @args.quiet? )
28
- @platform = platform.new
27
+ @log = context.log.new( self, @args.quiet? )
28
+ @log.debug "log (class: #{@log.class.name}) in use ..."
29
+
30
+ @platform = context.platform
31
+ @log.debug "platform (class: #{@platform.class.name}) in use ..."
29
32
 
30
33
  @log.debug 'engine intialized...'
31
34
  end
@@ -96,7 +99,6 @@ module GlooLang
96
99
  # TODO: open any files specifed in args
97
100
 
98
101
  unless @mode == Mode::SCRIPT || @args.quiet?
99
- @cursor = TTY::Cursor
100
102
  self.loop
101
103
  end
102
104
 
@@ -0,0 +1,25 @@
1
+ # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
+ # Copyright:: Copyright (c) 2022 Eric Crane. All rights reserved.
3
+ #
4
+ # The context (parameters) for the Gloo Script Engine.
5
+ #
6
+
7
+ module GlooLang
8
+ module App
9
+ class EngineContext
10
+
11
+ attr_accessor :params, :platform, :log, :user_root
12
+
13
+ #
14
+ # Create the context, supplying defaults where relevant.
15
+ #
16
+ def initialize( params = [], platform=nil, log=nil, user_root=nil )
17
+ @params = params
18
+ @platform = platform ? platform : Platform.new
19
+ @log = log ? log : Log
20
+ @user_root = user_root
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -23,6 +23,8 @@ module GlooLang
23
23
  @logger = Logger.new( f )
24
24
  @logger.level = Logger::DEBUG
25
25
  @quite = quiet
26
+
27
+ debug 'log intialized...'
26
28
  end
27
29
 
28
30
  #
@@ -10,38 +10,24 @@ module GlooLang
10
10
  module App
11
11
  class Settings
12
12
 
13
- attr_reader :user_root, :log_path, :config_path, :project_path,
14
- :start_with, :list_indent, :tmp_path,
15
- :debug_path, :debug
13
+ attr_reader :user_root, :log_path,
14
+ :config_path, :project_path,
15
+ :start_with, :list_indent, :tmp_path,
16
+ :debug_path, :debug
16
17
 
17
18
  #
18
19
  # Load setting from the yml file.
19
20
  # The mode parameter is used to determine if we are running in TEST.
20
21
  #
21
- def initialize( engine, mode )
22
+ def initialize( engine, root=nil )
22
23
  @engine = engine
23
- @mode = mode
24
- init_root
24
+ # @mode = mode
25
+ init_root( root )
26
+
25
27
  init_path_settings
26
28
  init_user_settings
27
29
  end
28
30
 
29
- #
30
- # Are we in test mode?
31
- #
32
- def in_test_mode?
33
- return @mode == 'TEST'
34
- end
35
-
36
- #
37
- # Get the project path for the current mode.
38
- #
39
- def project_path_for_mode( settings )
40
- return File.join( @user_root, 'projects' ) if in_test_mode?
41
-
42
- return settings[ 'gloo' ][ 'project_path' ]
43
- end
44
-
45
31
  #
46
32
  # Show the current application settings.
47
33
  # Can be seen in app with 'help settings'
@@ -130,12 +116,14 @@ module GlooLang
130
116
  #
131
117
  # Initialize gloo's root path.
132
118
  #
133
- def init_root
134
- if in_test_mode?
135
- path = File.dirname( File.dirname( File.absolute_path( __FILE__ ) ) )
136
- path = File.dirname( File.dirname( path ) )
137
- path = File.join( path, 'test', 'gloo' )
138
- @user_root = path
119
+ def init_root root
120
+ if root
121
+ @user_root = root
122
+ # if in_test_mode?
123
+ # path = File.dirname( File.dirname( File.absolute_path( __FILE__ ) ) )
124
+ # path = File.dirname( File.dirname( path ) )
125
+ # path = File.join( path, 'test', 'gloo' )
126
+ # @user_root = path
139
127
  else
140
128
  @user_root = File.join( Dir.home, 'gloo' )
141
129
  end
@@ -167,7 +155,11 @@ module GlooLang
167
155
  def init_user_settings
168
156
  settings = get_settings
169
157
 
170
- @project_path = project_path_for_mode settings
158
+ @project_path = settings[ 'gloo' ][ 'project_path' ]
159
+ if @project_path.blank?
160
+ @project_path = File.join( @user_root, 'projects' )
161
+ end
162
+
171
163
  @start_with = settings[ 'gloo' ][ 'start_with' ]
172
164
  @list_indent = settings[ 'gloo' ][ 'list_indent' ]
173
165
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gloo-lang
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Crane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-23 00:00:00.000000000 Z
11
+ date: 2022-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '5.0'
33
+ version: '5.1'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '5.0'
40
+ version: '5.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,6 +58,26 @@ dependencies:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: 13.0.1
61
+ - !ruby/object:Gem::Dependency
62
+ name: activesupport
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '6.1'
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 6.1.4.6
71
+ type: :runtime
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '6.1'
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 6.1.4.6
61
81
  - !ruby/object:Gem::Dependency
62
82
  name: chronic
63
83
  requirement: !ruby/object:Gem::Requirement
@@ -180,6 +200,7 @@ files:
180
200
  - lib/gloo-lang.rb
181
201
  - lib/gloo_lang/app/args.rb
182
202
  - lib/gloo_lang/app/engine.rb
203
+ - lib/gloo_lang/app/engine_context.rb
183
204
  - lib/gloo_lang/app/help.rb
184
205
  - lib/gloo_lang/app/info.rb
185
206
  - lib/gloo_lang/app/log.rb