Sha256: ab52d56e45e0f13b005632ae0ae307ee49b65148b7218b012c97a5f66528720f

Contents?: true

Size: 510 Bytes

Versions: 1

Compression:

Stored size: 510 Bytes

Contents

require 'rails'
module LoopDance

  class Railtie < Rails::Railtie
    
    initializer 'loop_dance.initialize', :after => :after_initialize do

      load_dancers
      # Do not start dancers if rake or other tasks
      LoopDance.auto_start if server_startup?
    end

    def load_dancers
      require 'dancers'
    end

    # FIX: Is there more cute solution?
    def server_startup?
      caller.to_s=~/config\.ru/
    end

    rake_tasks do
      #load "path/to/my_railtie.tasks"
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loop_dance-0.2.0 lib/loop_dance/railtie.rb