Sha256: a1c12c2c798c558fc45f09f55e21122cbd694094ee908cd2f5443087c8b664ef

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

# encoding: utf-8
module RailsBestPractices
  module Reviews
    # Review config/deploy.rb file to make sure using the bundler's capistrano recipe.
    #
    # See the best practice details here http://rails-bestpractices.com/posts/2010/09/02/dry-bundler-in-capistrano/
    #
    # Implementation:
    #
    # Review process:
    #   only check the command nodes to see if there is bundler namespace in config/deploy.rb file,
    #
    #   if the message of command node is "namespace" and the first argument  is "bundler",
    #   then it should use bundler's capistrano recipe.
    class DryBundlerInCapistranoReview < Review
      interesting_nodes :command
      interesting_files DEPLOY_FILES
      url "http://rails-bestpractices.com/posts/2010/09/02/dry-bundler-in-capistrano/"

      # check call node to see if it is with message "namespace" and argument "bundler".
      add_callback :start_command do |node|
        if "namespace" == node.message.to_s && "bundler" == node.arguments.all[0].to_s
          add_error "dry bundler in capistrano"
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_best_practices-1.18.1 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.18.0 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.17.0 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.16.0 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.15.7 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.15.6 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb