Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

2.0.0

Compare
Choose a tag to compare
@jimmycuadra jimmycuadra released this 06 Jul 08:19
· 612 commits to main since this release
  • New help system
    • self.help method is no longer supported
    • Handler routes now take a :help option
  • HTTP server and routing
    • New Lita.config.http configuration options
    • Handler.http method for defining HTTP server routes
    • Handler HTTP callback methods take a Rack::Request and Rack::Response
  • Handler#http for outgoing HTTP requests, backed by Faraday
  • Built-in web handler for basic info about Lita (GET /lita/info)
  • New testing system
    • Enable RSpec extra with lita_handler: true instead of lita: true
    • Use lita: true for non-handler-specific tests that need the logger stubbed, interact with Redis, or use Lita.config
    • New routing helper method:
      • routes_command
    • New HTTP routing helper methods
      • routes_http
      • doesnt_route_http (alias: does_not_route_http)
    • Integration helper methods changes
      • expect_reply and expect_no_reply (and aliases) removed
      • Replaced with an array of all sent messages called replies
      • Use normal RSpec expectations on replies
      • send_test_message replaced with send_message and send_command
      • Send a message or command as a specific user with the :as option
    • Logger is stubbed during testing
    • Lita.config is cleared before each example
  • Handlers
    • route now takes the method name as a second argument instead of using the :to option.
    • Default configuration hook via Handler.default_config
    • Lita::Response, a new object for handlers to interact with
      • Many top-level methods moved from Handler to the response object
        • reply
        • args
        • user
        • matches
        • command? (now on the message object only)
        • scan (now on the message object only)
  • Shell adapter
    • Lita.config.adapter.private_chat = true treats all messages as directed to Lita
    • "Shell User" is created in Redis so handlers can look it up
  • Lita.clear_config method added to reset all configuration
  • Robot mention name is now case insensitive