Sha256: 0ee37bbbf2114a286fdd20661ba48bb16efb75890c4e2ce7a98175f8cd06384c

Contents?: true

Size: 859 Bytes

Versions: 2

Compression:

Stored size: 859 Bytes

Contents

require 'plist'

module Steamy
  class SequelPro
    
    attr_reader :connections
    
    def initialize
      @connections = connections
    end
    
    def connections
      connections = {}
      
      Dir.chdir(Steamy.config[:saved_connections])

      # For each vhost replace the DOCUMENT_ROOT and write back out to sites-enabled
      Dir.glob("*.spf") do |file|
         connection = Plist::parse_xml(file)
         unless connection['data']['connection']['ssh_host'].nil?
           connections[connection['data']['connection']['ssh_host']] = connection['data']['connection']
         end
      end
      
      connections
    end
    
    def available_connections
      keys = @connections.keys
      keys.sort!
    end
    
    def list
      available_connections.each do |connection|
        puts connection
      end
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
steamy-0.0.5 lib/steamy/sequel_pro.rb
steamy-0.0.4 lib/steamy/sequel_pro.rb