rubocop-greppable_rails 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 8dcdbd2384385602ec76c55bbc2d3930a5a941c840a1fe9f953ea56da7841c76
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: ec03c27bf9b70f9c4f2306875148b32c87bda4668c7deb16fff5f5df08095033
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2276743cc6dc3bdc68bc76b42e9490cf80488947706a7d925b9e82db3561f456ed9fcc4fe53006d4cddd54336db200f7ede2dbb6729abab5802b5264b92b2c3c
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 6369f9d1abb1d2b216aca508eddc2ef47ba8ce321fb0fdc87edd91e3049af53d59e9d938c1c2871bb92e2e23982584deed65554bbbc9c5b1e6b5c21502e087e9
         
     | 
    
        data/config/default.yml
    CHANGED
    
    
| 
         @@ -17,8 +17,17 @@ module RuboCop 
     | 
|
| 
       17 
17 
     | 
    
         
             
                      (send nil? {:helper} (sym _))
         
     | 
| 
       18 
18 
     | 
    
         
             
                    PATTERN
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
                    def  
     | 
| 
      
 20 
     | 
    
         
            +
                    def find_parent(node)
         
     | 
| 
       21 
21 
     | 
    
         
             
                      parent_node = node.parent
         
     | 
| 
      
 22 
     | 
    
         
            +
                      if parent_node.type == :begin
         
     | 
| 
      
 23 
     | 
    
         
            +
                        parent_node.parent
         
     | 
| 
      
 24 
     | 
    
         
            +
                      else
         
     | 
| 
      
 25 
     | 
    
         
            +
                        parent_node
         
     | 
| 
      
 26 
     | 
    
         
            +
                      end
         
     | 
| 
      
 27 
     | 
    
         
            +
                    end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
                    def on_send(node)
         
     | 
| 
      
 30 
     | 
    
         
            +
                      parent_node = find_parent(node)
         
     | 
| 
       22 
31 
     | 
    
         
             
                      return unless parent_node.type == :class
         
     | 
| 
       23 
32 
     | 
    
         | 
| 
       24 
33 
     | 
    
         
             
                      class_name = parent_node.children.first.children.last.to_s
         
     | 
| 
         @@ -51,8 +51,17 @@ module RuboCop 
     | 
|
| 
       51 
51 
     | 
    
         
             
                      (send _ :include (const _ _))
         
     | 
| 
       52 
52 
     | 
    
         
             
                    PATTERN
         
     | 
| 
       53 
53 
     | 
    
         | 
| 
       54 
     | 
    
         
            -
                    def  
     | 
| 
      
 54 
     | 
    
         
            +
                    def find_parent(node)
         
     | 
| 
       55 
55 
     | 
    
         
             
                      parent_node = node.parent
         
     | 
| 
      
 56 
     | 
    
         
            +
                      if parent_node.type == :begin
         
     | 
| 
      
 57 
     | 
    
         
            +
                        parent_node.parent
         
     | 
| 
      
 58 
     | 
    
         
            +
                      else
         
     | 
| 
      
 59 
     | 
    
         
            +
                        parent_node
         
     | 
| 
      
 60 
     | 
    
         
            +
                      end
         
     | 
| 
      
 61 
     | 
    
         
            +
                    end
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
                    def on_send(node)
         
     | 
| 
      
 64 
     | 
    
         
            +
                      parent_node = find_parent(node)
         
     | 
| 
       56 
65 
     | 
    
         
             
                      return unless parent_node.type == :module
         
     | 
| 
       57 
66 
     | 
    
         | 
| 
       58 
67 
     | 
    
         
             
                      module_name = parent_node.children.first.children.last.to_s
         
     |