Sha256: 68098391400554a5f3d6b1c93891ab7d08c65249afe0cdbd663b7ba326a2406b

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

require 'downlow'
require 'logger'
require 'yajl'
require 'version_sorter'
require 'digest/md5'

module Jim
  VERSION = '0.2.2'

  class Error < RuntimeError; end
  class InstallError < Error; end
  class FileExists < Error; end

  def self.logger=(logger)
    @logger = logger
  end

  def self.logger
    @logger ||= LOGGER if defined?(LOGGER)
    if !@logger
      @logger           = Logger.new(STDOUT)
      @logger.level     = Logger::INFO
      @logger.formatter = Proc.new {|s, t, n, msg| "#{msg}\n"}
      @logger
    end
    @logger
  end

  def self.each_path_in_directories(directories, ext, ignore_directories = [], &block)
    ignore_regexp = ignore_directories.empty? ? false : /(\/|^)(#{ignore_directories.join('|')})\//
    directories.each do |dir|
      dir = Pathname.new(dir).expand_path
      Dir.glob(Pathname.new(dir) + '**' + "*#{ext}") do |filename|
        next if File.directory?(filename)
        if ignore_regexp
          basepath = filename.to_s.gsub(dir.to_s, '/')
          next if basepath =~ ignore_regexp
        end
        yield Pathname.new(filename)
      end
    end
  end

  autoload :Installer, 'jim/installer'
  autoload :Index, 'jim/index'
  autoload :Bundler, 'jim/bundler'
  autoload :VersionParser, 'jim/version_parser'
  autoload :CLI, 'jim/cli'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jim-0.2.2 lib/jim.rb