Class Nitpick::BlockNitpicker
In: lib/nitpick/block_nitpicker.rb
Parent: Nitpicker

Methods

Public Instance methods

[Source]

# File lib/nitpick/block_nitpicker.rb, line 3
    def process_if(exp)
      cond = Sexp.from_array(exp.shift)
      yes_branch = Sexp.from_array(exp.shift)
      no_branch = Sexp.from_array(exp.shift)
      
      scan_for [Warnings::UnprotectedBlock],
           :with => [cond, yes_branch, no_branch]
      
      s(:if, cond, yes_branch, no_branch)
    end

[Source]

# File lib/nitpick/block_nitpicker.rb, line 14
    def process_yield(exp)
      exp.clear
      warn Warnings::UnprotectedBlock.new
      
      s(:yield)
    end

[Validate]