Sha256: 629ff1e2333e6dc2d2783a3a60a801cb4c18eae7b2d6b0e68513f491f0d47bcf

Contents?: true

Size: 1.1 KB

Versions: 10

Compression:

Stored size: 1.1 KB

Contents

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

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/51-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/51-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

10 entries across 10 versions & 1 rubygems

Version Path
rails_best_practices-1.13.8 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.13.5 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.13.4 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.13.3 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.13.2 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.13.1 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.13.0 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.12.0 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.11.1 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
rails_best_practices-1.11.0 lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb