Sha256: 66aa6836b25bf58b8f5759e5ce25879d438edb3464dfe90c55b140aee7238798

Contents?: true

Size: 655 Bytes

Versions: 3

Compression:

Stored size: 655 Bytes

Contents

module Scide

  def self.list options = {}

    dir = projects_dir options

    projects = []

    config_file = '.screenrc'
    projects << '.' if Dir.pwd != File.expand_path('~') and File.file?(config_file)

    if File.directory? dir

      Dir.entries(dir).each do |project|

        next if project.match /\A\.+\Z/
        project_dir = File.join dir, project

        next unless File.directory? project_dir
        config_file = File.join project_dir, '.screenrc'

        next unless File.file? config_file
        projects << project
      end

    elsif projects.empty?
      error %/No such directory "#{dir}"/
    end

    projects
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
scide-1.0.0 lib/scide/list.rb
scide-0.1.1 lib/scide/list.rb
scide-0.1.0 lib/scide/list.rb