Sha256: 25f3e8e969b6c1ebc8702bcee2d8ee6af666b0ce9705d28cbf084f17320a6408

Contents?: true

Size: 980 Bytes

Versions: 2

Compression:

Stored size: 980 Bytes

Contents

module Capucine
  class Watchr
    require 'compass-sass.rb'
    require 'coffeescript.rb'
    require "templates.rb"

    def initialize config_file
      Capucine.settings.get_config config_file
      @config = Capucine.settings.config
      
      Capucine::CompassSass.run_once if @config['compass_enable']
      Capucine::Coffee.run_once if @config['coffeescript_enable']
      Capucine::Templates.run_once if @config['templates_enable']

      self.watch
    end

    def watch
      
      compass_proc = Capucine::CompassSass.proc_watch if @config['compass_enable']
      coffeescript_proc = Capucine::Coffee.proc_watch if @config['coffeescript_enable']
      templates_proc = Capucine::Templates.proc_watch if @config['templates_enable']
      
      main_thread = Thread.new {

        compass_proc.join if compass_proc
        coffeescript_proc.join if coffeescript_proc
        templates_proc.join if templates_proc
      }

      main_thread.join

    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capucine-0.0.2 lib/watch.rb
capucine-0.0.1 lib/watch.rb