gloo-lang 0.9.9 → 0.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +14 -1
- data/gloo-lang.gemspec +1 -1
- data/lib/VERSION +1 -1
- data/lib/gloo_lang/app/engine.rb +4 -4
- data/lib/gloo_lang/app/engine_context.rb +25 -0
- data/lib/gloo_lang/app/settings.rb +21 -29
- metadata +23 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 38f13cdfcec13390f7b1332f97c2d2296ba72bfa67008eaf677d04409b3f0f8a
         | 
| 4 | 
            +
              data.tar.gz: 042cb5edc85629209f62ff2b778d29d082128eefb6ae0037d501906ebe776df3
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: bb96a66f19398aa1bfd0ca5251adbcf9740fbe8395a0e24592510a52beceb961cba107e9f7b251d266af8c691f71a9dcf17107fad85398bb0d7d7768cc7e2d49
         | 
| 7 | 
            +
              data.tar.gz: 94b7b46fae7e2f31ae499defffddbc3e09e0fbde3004900f5ded87c6b9e841f86587414c8786f2d53bd2afc57403da1bd38fd47a9270212f245de01e5934230d
         | 
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,7 +1,8 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                gloo-lang (0.9. | 
| 4 | 
            +
                gloo-lang (0.9.10)
         | 
| 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
         | 
    
        data/gloo-lang.gemspec
    CHANGED
    
    | @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| | |
| 27 27 | 
             
              spec.add_development_dependency 'minitest', '~> 5.0'
         | 
| 28 28 | 
             
              spec.add_development_dependency "rake", '~> 13.0', '>= 13.0.1'
         | 
| 29 29 |  | 
| 30 | 
            -
               | 
| 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. | 
| 1 | 
            +
            0.9.10
         | 
    
        data/lib/gloo_lang/app/engine.rb
    CHANGED
    
    | @@ -20,12 +20,12 @@ module GlooLang | |
| 20 20 | 
             
                  #
         | 
| 21 21 | 
             
                  # Set up the engine with basic elements.
         | 
| 22 22 | 
             
                  #
         | 
| 23 | 
            -
                  def initialize(  | 
| 24 | 
            -
                    @args = Args.new( self, params )
         | 
| 25 | 
            -
                    @settings = Settings.new( self,  | 
| 23 | 
            +
                  def initialize( context )
         | 
| 24 | 
            +
                    @args = Args.new( self, context.params )
         | 
| 25 | 
            +
                    @settings = Settings.new( self, context.user_root )
         | 
| 26 26 |  | 
| 27 27 | 
             
                    @log = Log.new( self, @args.quiet? )
         | 
| 28 | 
            -
                    @platform = platform | 
| 28 | 
            +
                    @platform = context.platform
         | 
| 29 29 |  | 
| 30 30 | 
             
                    @log.debug 'engine intialized...'
         | 
| 31 31 | 
             
                  end
         | 
| @@ -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.new if platform.nil?
         | 
| 19 | 
            +
                    @log = Log if log.nil?
         | 
| 20 | 
            +
                    @user_root = user_root
         | 
| 21 | 
            +
                  end
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
            end
         | 
| @@ -10,38 +10,24 @@ module GlooLang | |
| 10 10 | 
             
              module App
         | 
| 11 11 | 
             
                class Settings
         | 
| 12 12 |  | 
| 13 | 
            -
                  attr_reader :user_root, :log_path, | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 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,  | 
| 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  | 
| 135 | 
            -
                       | 
| 136 | 
            -
             | 
| 137 | 
            -
             | 
| 138 | 
            -
             | 
| 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 =  | 
| 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. | 
| 4 | 
            +
              version: 0.9.10
         | 
| 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- | 
| 11 | 
            +
            date: 2022-03-24 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -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
         |