Sha256: 1840863b3040af061ad27ecbfd8afc30626c10f67821187ad222a4368a52a3f4

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

module BowerRails
  require 'bower-rails/railtie' if defined?(Rails)
  require 'bower-rails/dsl'

  extend self

  class << self
    # An array of tasks to enhance `rake assets:precompile`
    attr_reader :tasks
    
    # If set to true then rake bower:install && rake bower:resolve tasks
    # are invoked before assets precompilation
    attr_accessor :resolve_before_precompile

    # If set to true then rake bower:install && rake bower:clean && rake bower:resolve tasks
    # are invoked before assets precompilation
    attr_accessor :clean_before_precompile

    def configure &block
      yield self if block_given?
      collect_tasks
    end

    private

      def collect_tasks
        @tasks << ['bower:install', 'bower:resolve'] if @resolve_before_precompile
        @tasks << ['bower:install', 'bower:clean']   if @clean_before_precompile
        @tasks.flatten!
        @tasks.uniq!
      end
  end

  # By default tasks are empty
  @tasks = []

  # Set default values for options
  @resolve_before_precompile = false
  @clean_before_precompile = false
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bower-rails-0.7.2 lib/bower-rails.rb