Sha256: 82ed503b8d0fb7e82df6cdcb0c3d198dc6363564575c65ed6c8bb991d2ff0e4c

Contents?: true

Size: 1.4 KB

Versions: 37

Compression:

Stored size: 1.4 KB

Contents

require 'erb'

require 'connection_manager/commands'
require 'connection_manager/connection_store'
require 'connection_manager/controller'
require 'connection_manager/filter_dialog'
require 'connection_manager/private_key_store'

module Redcar
  class ConnectionManager
    CONNECTION_SUPER_CLASS ||= Struct.new(:name, :protocol, :host, :port, :user, :path)

    def self.open_connection(c)
      Project::Manager.connect_to_remote(c.protocol, c.host, c.user, c.path, PrivateKeyStore.paths)
    end

    class Connection < CONNECTION_SUPER_CLASS
      def to_hash
        {
          "name" => name,
          "host" => host,
          "port" => port,
          "user" => user,
          "protocol" => protocol,
          "path" => path
        }
      end
    end

    class OpenRemoteFilter < Command
      def execute
        FilterDialog.new.open
      end
    end

    # def self.keymaps
    #   osx = Redcar::Keymap.build("main", :osx) do
    #     link "Cmd+P", OpenRemoteFilter
    #   end
    #   linwin = Redcar::Keymap.build("main", [:linux, :windows]) do
    #     link "Ctrl+P", OpenRemoteFilter
    #   end
    #   [osx, linwin]
    # end

    def self.menus
      Menu::Builder.build do
        sub_menu "Plugins" do
          sub_menu "Connections", :priority => 36 do
            item "Manage", OpenCommand
            item "Remote Filter", OpenRemoteFilter
          end
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
redcar-dev-0.13.5dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.13.4dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.13.3dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.13.2dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.13.1dev plugins/connection_manager/lib/connection_manager.rb
redcar-0.12.1 plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.13.0dev plugins/connection_manager/lib/connection_manager.rb
redcar-0.12 plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.27dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.26dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.25dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.24dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.23dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.22dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.21dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.20dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.19dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.18dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.17dev plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.16dev-java plugins/connection_manager/lib/connection_manager.rb