Sha256: b2ed80dd0f928268adf3cd2d1f8c87aa9f8f811d06b0061e0c524f508e271fe6

Contents?: true

Size: 658 Bytes

Versions: 34

Compression:

Stored size: 658 Bytes

Contents

require "spring/watcher/abstract"
require "spring/configuration"

module Spring
  class << self
    attr_accessor :watch_interval
    attr_writer :watcher
    attr_reader :watch_method
  end

  def self.watch_method=(method)
    if method.is_a?(Class)
      @watch_method = method
    else
      require "spring/watcher/#{method}"
      @watch_method = Watcher.const_get(method.to_s.gsub(/(^.|_.)/) { $1[-1].upcase })
    end
  end

  self.watch_interval = 0.2
  self.watch_method = :polling

  def self.watcher
    @watcher ||= watch_method.new(Spring.application_root_path, watch_interval)
  end

  def self.watch(*items)
    watcher.add(*items)
  end
end

Version data entries

34 entries across 34 versions & 3 rubygems

Version Path
spring-4.2.1 lib/spring/watcher.rb
spring-4.2.0 lib/spring/watcher.rb
spring-4.1.3 lib/spring/watcher.rb
spring-4.1.2 lib/spring/watcher.rb
spring-4.1.1 lib/spring/watcher.rb
spring-4.1.0 lib/spring/watcher.rb
spring-4.0.0 lib/spring/watcher.rb
spring-3.1.1 lib/spring/watcher.rb
spring-3.1.0 lib/spring/watcher.rb
spring-3.0.0 lib/spring/watcher.rb
nrispring-2.1.3 lib/spring/watcher.rb
nrispring-2.1.2 lib/spring/watcher.rb
nrispring-2.1.1 lib/spring/watcher.rb
spring-2.1.1 lib/spring/watcher.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/spring-2.1.0/lib/spring/watcher.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/spring-2.1.0/lib/spring/watcher.rb
spring-2.1.0 lib/spring/watcher.rb
spring-2.0.2 lib/spring/watcher.rb
spring-2.0.1 lib/spring/watcher.rb
spring-2.0.0 lib/spring/watcher.rb