module Sidekiq::Cron::WebExtension::Helpers
Public Instance Methods
Source
# File lib/sidekiq/cron/web_extension.rb, line 5 def cron_route_params(key) if Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new("8.0.0") route_params(key) else route_params[key] end end
Source
# File lib/sidekiq/cron/web_extension.rb, line 14 def namespace_redirect_path "#{root_path}cron/namespaces/#{cron_route_params(:namespace)}" end
This method constructs the URL for the cron jobs page within the specified namespace.
Source
# File lib/sidekiq/cron/web_extension.rb, line 18 def redirect_to_previous_or_default if Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new("8.0.0") redirect url_params('redirect') || namespace_redirect_path else redirect params["redirect"] || namespace_redirect_path end end
Source
# File lib/sidekiq/cron/web_extension.rb, line 26 def render_erb(view) path = Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new("8.0.0") ? "views" : "views/legacy" views_path = File.join(File.expand_path("..", __FILE__), path) erb(File.read(File.join(views_path, "#{view}.erb"))) end