Sha256: a4fe948ef44aae1206d10c3d6879c821403033c572cc83d43cc011324cee9895

Contents?: true

Size: 828 Bytes

Versions: 1

Compression:

Stored size: 828 Bytes

Contents

require "spring/watcher"

module Spring
  @commands = {}

  class << self
    attr_reader :commands
  end

  def self.register_command(name, klass)
    commands[name] = klass
  end

  def self.command?(name)
    commands.include? name
  end

  def self.command(name)
    commands.fetch name
  end

  require "spring/commands/rails"
  require "spring/commands/rake"
  require "spring/commands/testunit"

  # If the config/spring.rb contains requires for commands from other gems,
  # then we need to be under bundler.
  require "bundler/setup"

  # Load custom commands, if any.
  # needs to be at the end to allow modification of existing commands.
  config = File.expand_path("~/.spring.rb")
  require config if File.exist?(config)

  config = File.expand_path("./config/spring.rb")
  require config if File.exist?(config)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spring-0.9.0 lib/spring/commands.rb