Sha256: 616f534e475c3326f91af3d7327cf8c06e4dd55ab5a9ce9e874a00407edd0823

Contents?: true

Size: 924 Bytes

Versions: 12

Compression:

Stored size: 924 Bytes

Contents

module BuildTool

    class Server

        # The host this repository is hosted
        attr_accessor :host

        # Repository name
        attr_reader   :name

        # The relative path on the server
        attr_accessor :path

        # The protocol used to access the repository
        attr_accessor :protocol

        # Create a repository
        def initialize(name)
            if name.nil?
                raise StandardError, "The server name has to be set"
            end
            @name = name
        end

        def url
            if !host
                raise ConfigurationError, "No host specified for server #{name}"
            end

            url = host
            if protocol
                url = "#{protocol}://#{url}"
            end
            if path
                url = "#{url}/#{path}"
            end
            url
        end

    end # class Server


end # module BuildTool

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
build-tool-0.4.1 lib/build-tool/server.rb
build-tool-0.4.0 lib/build-tool/server.rb
build-tool-0.3.3 lib/build-tool/server.rb
build-tool-0.3.2 lib/build-tool/server.rb
build-tool-0.3.1 lib/build-tool/server.rb
build-tool-0.3 lib/build-tool/server.rb
build-tool-0.2 lib/build-tool/server.rb
build-tool-0.1.4 lib/build-tool/server.rb
build-tool-0.1.3 lib/build-tool/server.rb
build-tool-0.1.2 lib/build-tool/server.rb
build-tool-0.1.0 lib/build-tool/server.rb
build-tool-0.1.1 lib/build-tool/server.rb