Sha256: 8396fa06ded24deaf4da475d4d4f123048e4e9d7af899205653877fafa8df834

Contents?: true

Size: 1.39 KB

Versions: 23

Compression:

Stored size: 1.39 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

23 entries across 23 versions & 1 rubygems

Version Path
redcar-0.9.2 plugins/connection_manager/lib/connection_manager.rb
redcar-0.9.1 plugins/connection_manager/lib/connection_manager.rb
redcar-0.9.0 plugins/connection_manager/lib/connection_manager.rb
redcar-0.8.1 plugins/connection_manager/lib/connection_manager.rb
redcar-0.8 plugins/connection_manager/lib/connection_manager.rb
redcar-0.7 plugins/connection_manager/lib/connection_manager.rb
redcar-0.6.1 plugins/connection_manager/lib/connection_manager.rb
redcar-0.6 plugins/connection_manager/lib/connection_manager.rb
redcar-0.6.1dev plugins/connection_manager/lib/connection_manager.rb
redcar-0.5.1 plugins/connection_manager/lib/connection_manager.rb
redcar-0.5 plugins/connection_manager/lib/connection_manager.rb
redcar-0.5.6dev plugins/connection_manager/lib/connection_manager.rb
redcar-0.5.5dev plugins/connection_manager/lib/connection_manager.rb
redcar-0.5.4dev plugins/connection_manager/lib/connection_manager.rb
redcar-0.5.3dev plugins/connection_manager/lib/connection_manager.rb
redcar-0.5.2dev plugins/connection_manager/lib/connection_manager.rb
redcar-0.5.1dev plugins/connection_manager/lib/connection_manager.rb
redcar-0.4.1 plugins/connection_manager/lib/connection_manager.rb
redcar-0.4 plugins/connection_manager/lib/connection_manager.rb
redcar-0.3.10.1dev plugins/connection_manager/lib/connection_manager.rb