spectre-core 1.14.3 → 1.14.4
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/exe/spectre +5 -5
- data/lib/spectre/curl.rb +1 -1
- data/lib/spectre/helpers.rb +4 -4
- data/lib/spectre/http.rb +1 -1
- data/lib/spectre.rb +1 -1
- metadata +4 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: f8470cdbef9dc67f036af360df1d1ff660177ea2ecc9a139b9730cef0a8f5495
         | 
| 4 | 
            +
              data.tar.gz: 5cecca539f615f7a34cac05575f897b3788b4e9f4778a5b4be7111d0de816d5c
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 2e43b4db881a0d53877f2a1f2db6389f8475bc469781219e4ee286cc9aa89a7079d12b84d17757f166cf9cc3a7e4ce826eb69a0bdf89691b8ff01fbfb370991b
         | 
| 7 | 
            +
              data.tar.gz: 73be4cdc4745b16a44988e6cd62f5da2316ac7cdbbc273228fb88cfca7fda6e387d2df7efdf290c7d7bed974803a7ccfb60e1dd68d97957f5cef87bf2cf6308b
         | 
    
        data/exe/spectre
    CHANGED
    
    | @@ -187,7 +187,7 @@ cfg.deep_merge! DEFAULT_CONFIG | |
| 187 187 | 
             
            # Load global config file first
         | 
| 188 188 | 
             
            global_config_file = File.join File.expand_path('~'), '.spectre'
         | 
| 189 189 |  | 
| 190 | 
            -
            if File. | 
| 190 | 
            +
            if File.exist? global_config_file
         | 
| 191 191 | 
             
              global_options = load_yaml(global_config_file)
         | 
| 192 192 | 
             
              cfg.deep_merge! global_options if global_options
         | 
| 193 193 | 
             
            end
         | 
| @@ -195,7 +195,7 @@ end | |
| 195 195 | 
             
            # Then load local config file
         | 
| 196 196 | 
             
            config_file = cmd_options['config_file'] || cfg['config_file']
         | 
| 197 197 |  | 
| 198 | 
            -
            if File. | 
| 198 | 
            +
            if File.exist? config_file
         | 
| 199 199 | 
             
              file_options = load_yaml(config_file)
         | 
| 200 200 | 
             
              cfg.deep_merge! file_options
         | 
| 201 201 | 
             
              Dir.chdir File.dirname(config_file)
         | 
| @@ -332,10 +332,10 @@ if ['list', 'run'].include? action | |
| 332 332 | 
             
                      mod_file = mod + '.rb'
         | 
| 333 333 | 
             
                      spectre_lib_mod = File.join(File.dirname(__dir__), 'lib', mod_file)
         | 
| 334 334 |  | 
| 335 | 
            -
                      if File. | 
| 335 | 
            +
                      if File.exist? mod_file
         | 
| 336 336 | 
             
                        require_relative mod_file
         | 
| 337 337 |  | 
| 338 | 
            -
                      elsif File. | 
| 338 | 
            +
                      elsif File.exist? spectre_lib_mod
         | 
| 339 339 | 
             
                        require_relative spectre_lib_mod
         | 
| 340 340 |  | 
| 341 341 | 
             
                      else
         | 
| @@ -550,7 +550,7 @@ if 'init' == action | |
| 550 550 | 
             
              end
         | 
| 551 551 |  | 
| 552 552 | 
             
              DEFAULT_FILES.each do |file, content|
         | 
| 553 | 
            -
                unless File. | 
| 553 | 
            +
                unless File.exist? file
         | 
| 554 554 | 
             
                  File.write(file, content)
         | 
| 555 555 | 
             
                end
         | 
| 556 556 | 
             
              end
         | 
    
        data/lib/spectre/curl.rb
    CHANGED
    
    | @@ -281,7 +281,7 @@ module Spectre::Curl | |
| 281 281 |  | 
| 282 282 | 
             
                  # Add certificate path if one is given
         | 
| 283 283 | 
             
                  if req['cert']
         | 
| 284 | 
            -
                    raise "Certificate '#{req['cert']}' does not exist" unless File. | 
| 284 | 
            +
                    raise "Certificate '#{req['cert']}' does not exist" unless File.exist? req['cert']
         | 
| 285 285 |  | 
| 286 286 | 
             
                    cmd.append('--cacert', req['cert'])
         | 
| 287 287 | 
             
                  elsif req['use_ssl'] or uri.start_with? 'https'
         | 
    
        data/lib/spectre/helpers.rb
    CHANGED
    
    | @@ -52,7 +52,7 @@ class ::String | |
| 52 52 | 
             
              # File helpers
         | 
| 53 53 |  | 
| 54 54 | 
             
              def content with: nil
         | 
| 55 | 
            -
                fail "'#{self}' is not a file path, or the file does not exist." unless File. | 
| 55 | 
            +
                fail "'#{self}' is not a file path, or the file does not exist." unless File.exist? self
         | 
| 56 56 |  | 
| 57 57 | 
             
                file_content = File.read(self)
         | 
| 58 58 |  | 
| @@ -64,17 +64,17 @@ class ::String | |
| 64 64 | 
             
              end
         | 
| 65 65 |  | 
| 66 66 | 
             
              def file_size
         | 
| 67 | 
            -
                fail "'#{self}' is not a file path, or the file does not exist." unless File. | 
| 67 | 
            +
                fail "'#{self}' is not a file path, or the file does not exist." unless File.exist? self
         | 
| 68 68 |  | 
| 69 69 | 
             
                File.size(self)
         | 
| 70 70 | 
             
              end
         | 
| 71 71 |  | 
| 72 72 | 
             
              def exists?
         | 
| 73 | 
            -
                File. | 
| 73 | 
            +
                File.exist? self
         | 
| 74 74 | 
             
              end
         | 
| 75 75 |  | 
| 76 76 | 
             
              def remove!
         | 
| 77 | 
            -
                fail "'#{self}' is not a file path, or the file does not exist." unless File. | 
| 77 | 
            +
                fail "'#{self}' is not a file path, or the file does not exist." unless File.exist? self
         | 
| 78 78 |  | 
| 79 79 | 
             
                File.delete self
         | 
| 80 80 | 
             
              end
         | 
    
        data/lib/spectre/http.rb
    CHANGED
    
    | @@ -282,7 +282,7 @@ module Spectre | |
| 282 282 | 
             
                      net_http.use_ssl = true
         | 
| 283 283 |  | 
| 284 284 | 
             
                      if req['cert']
         | 
| 285 | 
            -
                        raise HttpError.new("Certificate '#{req['cert']}' does not exist") unless File. | 
| 285 | 
            +
                        raise HttpError.new("Certificate '#{req['cert']}' does not exist") unless File.exist? req['cert']
         | 
| 286 286 |  | 
| 287 287 | 
             
                        net_http.verify_mode = OpenSSL::SSL::VERIFY_PEER
         | 
| 288 288 | 
             
                        net_http.ca_file = req['cert']
         | 
    
        data/lib/spectre.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,27 +1,27 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: spectre-core
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.14. | 
| 4 | 
            +
              version: 1.14.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Christian Neubauer
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2024-01-31 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: ectoplasm
         | 
| 15 15 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 16 | 
             
                requirements:
         | 
| 17 | 
            -
                - - " | 
| 17 | 
            +
                - - "~>"
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 19 | 
             
                    version: 1.2.3
         | 
| 20 20 | 
             
              type: :runtime
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 | 
            -
                - - " | 
| 24 | 
            +
                - - "~>"
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 26 | 
             
                    version: 1.2.3
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         |