superbot-cloud 0.1.21 → 0.1.22
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 +1 -1
- data/lib/superbot/cloud/api.rb +1 -0
- data/lib/superbot/cloud/cli/member/add_command.rb +3 -0
- data/lib/superbot/cloud/cli/member/list_command.rb +3 -0
- data/lib/superbot/cloud/cli/member/remove_command.rb +3 -0
- data/lib/superbot/cloud/cli/test/base_command.rb +13 -0
- data/lib/superbot/cloud/cli/test/delete_command.rb +1 -2
- data/lib/superbot/cloud/cli/test/download_command.rb +49 -0
- data/lib/superbot/cloud/cli/test/list_command.rb +1 -3
- data/lib/superbot/cloud/cli/test/upload_command.rb +1 -3
- data/lib/superbot/cloud/cli/test_command.rb +3 -0
- data/lib/superbot/cloud/version.rb +1 -1
- metadata +3 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 236b54d121ca0847ea9e218994a43aaa73aeacfcd817a343b19f773b80e0eac3
         | 
| 4 | 
            +
              data.tar.gz: 834355e7f75a9bf38539af8dcb99cd279523db4cba22ef67f5f64a0803f1f929
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b85e340908cf50d182a9ce1a1cc50e1baa86871ff1580f955266b8cf8858a8b180029be179e068c5097569aee6d74bb39e6a83bb0ec8bccac7cb9595fa96c642
         | 
| 7 | 
            +
              data.tar.gz: ee5d064d978b99c5ba2158e3c602b902ba801f9bdee0812050e5e3d23882664c8208ef44388f7de212baee4535f29ce209b57a654c1c9415623781620474a705
         | 
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/lib/superbot/cloud/api.rb
    CHANGED
    
    | @@ -12,6 +12,7 @@ module Superbot | |
| 12 12 | 
             
                    organization_list:          { method: :get, endpoint: 'organizations' },
         | 
| 13 13 | 
             
                    test_list:                  { method: :get, endpoint: 'tests' },
         | 
| 14 14 | 
             
                    test_upload:                { method: :post_multipart, endpoint: 'tests' },
         | 
| 15 | 
            +
                    test_download:              { method: :get, endpoint: 'tests', required_param: :name },
         | 
| 15 16 | 
             
                    delete_test:                { method: :delete, endpoint: 'tests', required_param: :name },
         | 
| 16 17 | 
             
                    webdriver_session_list:     { method: :get, endpoint: 'webdriver_sessions' },
         | 
| 17 18 | 
             
                    delete_webdriver_session:   { method: :delete, endpoint: 'webdriver_sessions', required_param: :session_id },
         | 
| @@ -0,0 +1,13 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Superbot
         | 
| 4 | 
            +
              module Cloud
         | 
| 5 | 
            +
                module CLI
         | 
| 6 | 
            +
                  module Test
         | 
| 7 | 
            +
                    class BaseCommand < Clamp::Command
         | 
| 8 | 
            +
                      option ["--org"], "ORGANIZATION", "Organization to to take actions on", attribute_name: :organization
         | 
| 9 | 
            +
                    end
         | 
| 10 | 
            +
                  end
         | 
| 11 | 
            +
                end
         | 
| 12 | 
            +
              end
         | 
| 13 | 
            +
            end
         | 
| @@ -4,10 +4,9 @@ module Superbot | |
| 4 4 | 
             
              module Cloud
         | 
| 5 5 | 
             
                module CLI
         | 
| 6 6 | 
             
                  module Test
         | 
| 7 | 
            -
                    class DeleteCommand <  | 
| 7 | 
            +
                    class DeleteCommand < BaseCommand
         | 
| 8 8 | 
             
                      include Superbot::Cloud::Validations
         | 
| 9 9 |  | 
| 10 | 
            -
                      option ["-o", "--org"], "ORGANIZATION", "Organization to search test for deletion", attribute_name: :organization
         | 
| 11 10 | 
             
                      parameter "NAME", "the name of the test to delete", required: true
         | 
| 12 11 |  | 
| 13 12 | 
             
                      def execute
         | 
| @@ -0,0 +1,49 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            require 'fileutils'
         | 
| 4 | 
            +
            require 'pathname'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            module Superbot
         | 
| 7 | 
            +
              module Cloud
         | 
| 8 | 
            +
                module CLI
         | 
| 9 | 
            +
                  module Test
         | 
| 10 | 
            +
                    class DownloadCommand < BaseCommand
         | 
| 11 | 
            +
                      include Superbot::Cloud::Validations
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                      parameter "NAME", "the name of test to download"
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                      def execute
         | 
| 16 | 
            +
                        require_login
         | 
| 17 | 
            +
                        download_test
         | 
| 18 | 
            +
                      end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                      def download_test
         | 
| 21 | 
            +
                        puts "Downloading #{name}..."
         | 
| 22 | 
            +
                        test = Superbot::Cloud::Api.request(
         | 
| 23 | 
            +
                          :test_download,
         | 
| 24 | 
            +
                          params: {
         | 
| 25 | 
            +
                            name: name,
         | 
| 26 | 
            +
                            organization_name: organization
         | 
| 27 | 
            +
                          }
         | 
| 28 | 
            +
                        )
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                        if Dir.exist?(test[:name])
         | 
| 31 | 
            +
                          puts "Directory #{test[:name]} already exists"
         | 
| 32 | 
            +
                          print "Override files? [Y/n] "
         | 
| 33 | 
            +
                          answer = $stdin.gets.rstrip
         | 
| 34 | 
            +
                          abort "Aborted." unless answer.downcase.start_with?('y') || answer.empty?
         | 
| 35 | 
            +
                        end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                        FileUtils.mkdir_p test[:name]
         | 
| 38 | 
            +
                        test[:files].each do |file|
         | 
| 39 | 
            +
                          File.write(File.join(test[:name], file[:filename]), file[:content])
         | 
| 40 | 
            +
                          print file[:filename], ' - ', 'Success'
         | 
| 41 | 
            +
                          puts
         | 
| 42 | 
            +
                        end
         | 
| 43 | 
            +
                        puts "Test files successfully downloaded to #{File.join(Dir.pwd, test[:name])}"
         | 
| 44 | 
            +
                      end
         | 
| 45 | 
            +
                    end
         | 
| 46 | 
            +
                  end
         | 
| 47 | 
            +
                end
         | 
| 48 | 
            +
              end
         | 
| 49 | 
            +
            end
         | 
| @@ -4,11 +4,9 @@ module Superbot | |
| 4 4 | 
             
              module Cloud
         | 
| 5 5 | 
             
                module CLI
         | 
| 6 6 | 
             
                  module Test
         | 
| 7 | 
            -
                    class ListCommand <  | 
| 7 | 
            +
                    class ListCommand < BaseCommand
         | 
| 8 8 | 
             
                      include Superbot::Cloud::Validations
         | 
| 9 9 |  | 
| 10 | 
            -
                      option ["-o", "--org"], "ORGANIZATION", "Organization to list tests for", attribute_name: :organization
         | 
| 11 | 
            -
             | 
| 12 10 | 
             
                      def execute
         | 
| 13 11 | 
             
                        require_login
         | 
| 14 12 | 
             
                        list_tests
         | 
| @@ -9,13 +9,11 @@ module Superbot | |
| 9 9 | 
             
              module Cloud
         | 
| 10 10 | 
             
                module CLI
         | 
| 11 11 | 
             
                  module Test
         | 
| 12 | 
            -
                    class UploadCommand <  | 
| 12 | 
            +
                    class UploadCommand < BaseCommand
         | 
| 13 13 | 
             
                      include Superbot::Cloud::Validations
         | 
| 14 14 |  | 
| 15 15 | 
             
                      parameter "PATH", "the path to folder containing tests to upload"
         | 
| 16 16 |  | 
| 17 | 
            -
                      option ["-o", "--org"], "ORGANIZATION", "Organization to upload tests for", attribute_name: :organization
         | 
| 18 | 
            -
             | 
| 19 17 | 
             
                      def execute
         | 
| 20 18 | 
             
                        require_login
         | 
| 21 19 | 
             
                        upload_tests
         | 
| @@ -1,7 +1,9 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 | 
            +
            require_relative 'test/base_command'
         | 
| 3 4 | 
             
            require_relative 'test/list_command'
         | 
| 4 5 | 
             
            require_relative 'test/upload_command'
         | 
| 6 | 
            +
            require_relative 'test/download_command'
         | 
| 5 7 | 
             
            require_relative 'test/delete_command'
         | 
| 6 8 |  | 
| 7 9 | 
             
            module Superbot
         | 
| @@ -10,6 +12,7 @@ module Superbot | |
| 10 12 | 
             
                  class TestCommand < Clamp::Command
         | 
| 11 13 | 
             
                    subcommand ['list'], "List user tests from the cloud", Test::ListCommand
         | 
| 12 14 | 
             
                    subcommand ['upload'], "Upload test to the cloud", Test::UploadCommand
         | 
| 15 | 
            +
                    subcommand ['download'], "Download test from the cloud", Test::DownloadCommand
         | 
| 13 16 | 
             
                    subcommand ['delete'], "Delete test from the cloud", Test::DeleteCommand
         | 
| 14 17 |  | 
| 15 18 | 
             
                    def self.run
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: superbot-cloud
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.22
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Superbots
         | 
| @@ -143,7 +143,9 @@ files: | |
| 143 143 | 
             
            - lib/superbot/cloud/cli/organization/list_command.rb
         | 
| 144 144 | 
             
            - lib/superbot/cloud/cli/organization_command.rb
         | 
| 145 145 | 
             
            - lib/superbot/cloud/cli/root_command.rb
         | 
| 146 | 
            +
            - lib/superbot/cloud/cli/test/base_command.rb
         | 
| 146 147 | 
             
            - lib/superbot/cloud/cli/test/delete_command.rb
         | 
| 148 | 
            +
            - lib/superbot/cloud/cli/test/download_command.rb
         | 
| 147 149 | 
             
            - lib/superbot/cloud/cli/test/list_command.rb
         | 
| 148 150 | 
             
            - lib/superbot/cloud/cli/test/upload_command.rb
         | 
| 149 151 | 
             
            - lib/superbot/cloud/cli/test_command.rb
         |