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.12.15dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.14dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.13dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.12dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.11dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.10dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.9dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.8dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.7dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.6dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.4dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.3dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.1dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-dev-0.12.0dev-java plugins/connection_manager/lib/connection_manager.rb
redcar-0.11 plugins/connection_manager/lib/connection_manager.rb
redcar-0.11.0dev plugins/connection_manager/lib/connection_manager.rb
redcar-0.10 plugins/connection_manager/lib/connection_manager.rb