Sha256: 66f460a38dbca6687a85d9b2f5fdb6a5239dba62af19918c15fae1d0fc588be5
Contents?: true
Size: 1.08 KB
Versions: 8
Compression:
Stored size: 1.08 KB
Contents
module OodAppkit module Urls # A class used to handle URLs for the system Shell app. class Shell < Url # @param (see Url#initialize) # @param ssh_url [#to_s] the ssh URL used to access the terminal def initialize(ssh_url: '/ssh', template: '{/url*}/{host}{+path}', **kwargs) super(template: template, **kwargs) @ssh_url = parse_url_segments(ssh_url.to_s) end # URL to access this app for a given host and absolute file path # @param opts [#to_h] the available options for this method # @option opts [#to_s, nil] :host ("default") The host the app will make # an ssh connection to # @option opts [#to_s, nil] :path ("") The absolute path to the directory # the ssh app opens up in # @return [Addressable::URI] the url used to access the app def url(opts = {}) opts = opts.to_h.compact.symbolize_keys host = opts.fetch(:host, "default").to_s path = opts.fetch(:path, "").to_s @template.expand url: @base_url + @ssh_url, host: host, path: path end end end end
Version data entries
8 entries across 8 versions & 1 rubygems