Sha256: c8be15c6e8b69c36797bed1ba3c4000baac5e9fc31ce885decbe9c67909c508d

Contents?: true

Size: 964 Bytes

Versions: 8

Compression:

Stored size: 964 Bytes

Contents

require "spring/watcher"
require "spring/command_wrapper"

module Spring
  @commands = {}

  class << self
    attr_reader :commands
  end

  def self.register_command(name, command = nil)
    commands[name] = CommandWrapper.new(name, command)
  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"

  # 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)

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

  Gem::Specification.map(&:name).grep(/^spring-commands-/).each do |command|
    require command
  end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
spring-1.1.3 lib/spring/commands.rb
spring-1.1.2 lib/spring/commands.rb
spring-1.1.1 lib/spring/commands.rb
spring-1.1.0 lib/spring/commands.rb
spring-1.1.0.beta4 lib/spring/commands.rb
spring-1.1.0.beta3 lib/spring/commands.rb
spring-1.1.0.beta2 lib/spring/commands.rb
spring-1.1.0.beta1 lib/spring/commands.rb