module Batsir
Constants
- VERSION
Public Class Methods
config()
click to toggle source
# File lib/batsir.rb, line 38 def self.config Batsir::Config end
create(&block)
click to toggle source
# File lib/batsir.rb, line 42 def self.create(&block) puts logo new_block = ::Proc.new do aggregator_chain(&block) end @chain = ::Blockenspiel.invoke(new_block, Batsir::DSL::ChainMapping.new) end
create_and_start(&block)
click to toggle source
# File lib/batsir.rb, line 76 def self.create_and_start(&block) create(&block) start end
initialize_sidekiq()
click to toggle source
# File lib/batsir.rb, line 66 def self.initialize_sidekiq Sidekiq.logger = Batsir::Logger.log Sidekiq.configure_server do |config| config.redis = {:url => redis_url, :namespace => redis_namespace} end Sidekiq.configure_client do |config| config.redis = {:url => redis_url, :namespace => redis_namespace} end end
logo()
click to toggle source
# File lib/batsir/logo.rb, line 2 def self.logo <<EOF E ,. ,,,agB8@f ,8v ,8L J88&gg,,, .,a88888888@^ |8&,,,,,,88k ,88888888&g,, ,+88888888888$t 8888888f''9@. ,888888888888g, ,,88888888888888$; ,888888&` 8c ,888888888888888w, ,a88888888888888888&,......|8888888&gg&|8k......,d88888888888888888&, ,888888888888888888888888888888888qp8888|@8888888888888888888888888888y ,888888888888888888888888888888`8` '' `8`|888888888888888888888888888888E ,88888888888888888888888888888888 && 8|8888888888888888888888888888888c |88888888888888888888888888888888888888888|8888888888888888888888888888888k |88888888888888888888888888888888888888888|8888888888888888888888888888888k ,888888888888888888888888888888888888888888888888888888888888888888888888! j8888888888888888888888888888888888888888888888888888888888888888888888f j8888888888888888@@88888888888888888888888888888888@@888888888888888@f ,9888888888888@: `988M^ `?88888888888@f: |988M' .8888888888888M' ,98888888888F jf J8888888@f jf ,888888888@f' |98888888&. ,98888@' d888888@9" `?9@888&, j88f ,d88$@9l' `|?9t |f `9T"` ______ _______ _______ _______ _____ ______ |_____] |_____| | |______ | |_____/ |_____] | | | ______| __|__ | \\_ EOF end
redis_namespace()
click to toggle source
# File lib/batsir.rb, line 88 def self.redis_namespace Batsir::Config.redis_namespace end
redis_url()
click to toggle source
# File lib/batsir.rb, line 81 def self.redis_url host = Batsir::Config.redis_host port = Batsir::Config.redis_port dbase = Batsir::Config.redis_database "redis://#{host}:#{port}/#{dbase}" end
start()
click to toggle source
# File lib/batsir.rb, line 50 def self.start return unless @chain sidekiq_cli = Sidekiq::CLI.instance Sidekiq.options[:queues] << Batsir::Config.sidekiq_queue initialize_sidekiq generated_code = @chain.compile eval(generated_code) @chain.start sidekiq_cli.run end