Class: Sinatra::Base
- Inherits:
-
Object
- Object
- Sinatra::Base
- Defined in:
- lib/htm/sinatra.rb
Class Method Summary collapse
-
.register_htm ⇒ Object
Register HTM with Sinatra application.
Class Method Details
.register_htm ⇒ Object
Register HTM with Sinatra application
Automatically configures HTM for Sinatra apps:
-
Adds helpers
-
Adds middleware
-
Configures logger
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/htm/sinatra.rb', line 137 def self.register_htm helpers HTM::Sinatra::Helpers use HTM::Sinatra::Middleware # Configure HTM with Sinatra logger HTM.configure do |config| config.logger = logger if respond_to?(:logger) # Use Sidekiq if available, otherwise thread-based if defined?(::Sidekiq) config.job_backend = :sidekiq else config.job_backend = :thread end end HTM.logger.info "HTM registered with Sinatra application" HTM.logger.debug "HTM job backend: #{HTM.configuration.job_backend}" end |