lib/is_it_working/handler.rb
def check (name, *options_or_check, &block)
      raise ArgumentError("Too many arguments to #{self.class.name}#check") if options_or_check.size > 2
      check = nil
      options = {:async => true}
      
      unless options_or_check.empty?
        if options_or_check[0].is_a?(Hash)
          options = options.merge(options_or_check[0])
        else
          check = options_or_check[0]
        end
        if options_or_check[1].is_a?(Hash)
          options = options.merge(options_or_check[1])
        end
      end
      
      unless check
        if block
          check = block
        else
          check = lookup_check(name, options)
        end
      end
      
      @filters << Filter.new(name, check, options[:async])
    end
def check (name, *options_or_check, &block)
      raise ArgumentError("Too many arguments to #{self.class.name}#check") if options_or_check.size > 2
      check = nil
      options = {:async => true}
      
      unless options_or_check.empty?
        if options_or_check[0].is_a?(Hash)
          options = options.merge(options_or_check[0])
        else
          check = options_or_check[0]
        end
        if options_or_check[1].is_a?(Hash)
          options = options.merge(options_or_check[1])
        end
      end
      
      unless check
        if block
          check = block
        else
          check = lookup_check(name, options)
        end
      end
      
      @filters << Filter.new(name, check, options[:async])
    end
def check ( name , * options_or_check , & block ) raise ArgumentError ( "Too many arguments to #{self.class.name}#check" ) if options_or_check . size > 2 check = nil options = { :async => true } unless options_or_check . empty? if options_or_check [ 0 ] . is_a? ( Hash ) options = options . merge ( options_or_check [ 0 ] ) else check = options_or_check [ 0 ] end if options_or_check [ 1 ] . is_a? ( Hash ) options = options . merge ( options_or_check [ 1 ] ) end end unless check if block check = block else check = lookup_check ( name , options ) end end @filters << Filter . new ( name , check , options [ :async ] ) end
Add a status check to the handler.

 If a block is given, it will be used as the status check and will be yielded to
 with a Status object.

 If the name matches one of the pre-defined status check classes, a new instance will
 be created using the rest of the arguments as the arguments to the initializer. The
 pre-defined classes are:

 * <tt>:action_mailer</tt> - Check if the send mail configuration used by ActionMailer is available
 * <tt>:active_record</tt> - Check if the database connection for an ActiveRecord class is up
 * <tt>:dalli</tt> - DalliCheck checks if all the servers in a MemCache cluster are available using dalli
 * <tt>:directory</tt> - DirectoryCheck checks for the accessibilty of a file system directory
 * <tt>:ping</tt> - Check if a host is reachable and accepting connections on a port
 * <tt>:url</tt> - Check if a getting a URL returns a success response
Add a status check to the handler .