Sha256: 137eb4a18cf6f370c8214cc5e0438b1b62d7551258033c7484e74309d9acf4d8

Contents?: true

Size: 865 Bytes

Versions: 9

Compression:

Stored size: 865 Bytes

Contents

module Fog
  module Storage
    class AzureRM
      # This class provides the actual implemention for service calls.
      class Real
        # Get a public blob url from Azure blob storage
        def get_blob_url(container_name, blob_name, options = {})
          uri = @blob_client.generate_uri("#{container_name}/#{blob_name}", {}, { encode: true })

          if options[:scheme] == 'http'
            uri.to_s.gsub('https:', 'http:')
          else
            uri.to_s
          end
        end
      end

      # This class provides the mock implementation for unit tests.
      class Mock
        def get_blob_url(_container_name, _blob_name, options = {})
          url = 'https://sa.blob.core.windows.net/test_container/test_blob'
          url.gsub!('https:', 'http:') if options[:scheme] == 'http'
          url
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gitlab-fog-azure-rm-1.8.0 lib/fog/azurerm/requests/storage/get_blob_url.rb
gitlab-fog-azure-rm-1.7.0 lib/fog/azurerm/requests/storage/get_blob_url.rb
gitlab-fog-azure-rm-1.6.0 lib/fog/azurerm/requests/storage/get_blob_url.rb
gitlab-fog-azure-rm-1.5.0 lib/fog/azurerm/requests/storage/get_blob_url.rb
gitlab-fog-azure-rm-1.4.0 lib/fog/azurerm/requests/storage/get_blob_url.rb
gitlab-fog-azure-rm-1.3.0 lib/fog/azurerm/requests/storage/get_blob_url.rb
gitlab-fog-azure-rm-1.2.0 lib/fog/azurerm/requests/storage/get_blob_url.rb
gitlab-fog-azure-rm-1.1.1 lib/fog/azurerm/requests/storage/get_blob_url.rb
gitlab-fog-azure-rm-1.0.1 lib/fog/azurerm/requests/storage/get_blob_url.rb