Sha256: 11452a885f2d107e7a796c9d896be0af494884c4df279097a1b53b7d35a5328a

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

# encoding: utf-8
require 'rails_best_practices/reviews/review'

module RailsBestPractices
  module Reviews
    # Prepare Gemfile and review Capfile file to make sure using turbo-sprocket-rails3
    #
    # See the best practice details here http://rails-bestpractices.com/posts/704-speed-up-assets-precompile-with-turbo-sprockets-rails3
    #
    # Implementation:
    #
    # Review process:
    #   only check if turbo-sprockets-rails3 gem is not used and load 'deploy/assets' in Capfile.
    class UseTurboSprocketsRails3Review < Review
      interesting_nodes :command
      interesting_files CAPFILE
      url "http://rails-bestpractices.com/posts/704-speed-up-assets-precompile-with-turbo-sprockets-rails3"

      # check command node to see if load 'deploy/assets'
      add_callback :start_command do |node|
        if !Prepares.gems.include?("turbo-sprockets-rails3") && "load" == node.message.to_s && "deploy/assets" == node.arguments.to_s
          add_error "speed up assets precompile with turbo-sprockets-rails3"
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_best_practices-1.13.5 lib/rails_best_practices/reviews/use_turbo_sprockets_rails3_review.rb
rails_best_practices-1.13.4 lib/rails_best_practices/reviews/use_turbo_sprockets_rails3_review.rb
rails_best_practices-1.13.3 lib/rails_best_practices/reviews/use_turbo_sprockets_rails3_review.rb
rails_best_practices-1.13.2 lib/rails_best_practices/reviews/use_turbo_sprockets_rails3_review.rb
rails_best_practices-1.13.1 lib/rails_best_practices/reviews/use_turbo_sprockets_rails3_review.rb
rails_best_practices-1.13.0 lib/rails_best_practices/reviews/use_turbo_sprockets_rails3_review.rb