flog 3.0.0.b3 → 3.0.0
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.
- data/History.txt +10 -0
 - data/Rakefile +2 -2
 - data/lib/flog.rb +12 -2
 - data.tar.gz.sig +0 -0
 - metadata +10 -16
 - metadata.gz.sig +0 -0
 
    
        data/History.txt
    CHANGED
    
    | 
         @@ -1,3 +1,13 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            === 3.0.0 / 2012-11-02
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            * 1 minor enhancement:
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
              * Added a timeout handler to skip when RubyParser times out on a large file
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            * 1 bug fix:
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
              * Fixed handling of plain literals in masgn in args.
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
       1 
11 
     | 
    
         
             
            === 3.0.0.b3 / 2012-10-22
         
     | 
| 
       2 
12 
     | 
    
         | 
| 
       3 
13 
     | 
    
         
             
            * 4 minor enhancements:
         
     | 
    
        data/Rakefile
    CHANGED
    
    | 
         @@ -17,8 +17,8 @@ Hoe.spec 'flog' do 
     | 
|
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
              self.rubyforge_name = 'seattlerb'
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
               
     | 
| 
       21 
     | 
    
         
            -
               
     | 
| 
      
 20 
     | 
    
         
            +
              dependency 'sexp_processor', '~> 4.0'
         
     | 
| 
      
 21 
     | 
    
         
            +
              dependency 'ruby_parser',    '~> 3.0.0'
         
     | 
| 
       22 
22 
     | 
    
         
             
            end
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
            # vim: syntax=ruby
         
     | 
    
        data/lib/flog.rb
    CHANGED
    
    | 
         @@ -2,6 +2,7 @@ require 'rubygems' 
     | 
|
| 
       2 
2 
     | 
    
         
             
            require 'sexp_processor'
         
     | 
| 
       3 
3 
     | 
    
         
             
            require 'ruby_parser'
         
     | 
| 
       4 
4 
     | 
    
         
             
            require 'optparse'
         
     | 
| 
      
 5 
     | 
    
         
            +
            require 'timeout'
         
     | 
| 
       5 
6 
     | 
    
         | 
| 
       6 
7 
     | 
    
         
             
            class File
         
     | 
| 
       7 
8 
     | 
    
         
             
              RUBY19 = "<3".respond_to? :encoding
         
     | 
| 
         @@ -12,7 +13,7 @@ class File 
     | 
|
| 
       12 
13 
     | 
    
         
             
            end
         
     | 
| 
       13 
14 
     | 
    
         | 
| 
       14 
15 
     | 
    
         
             
            class Flog < SexpProcessor
         
     | 
| 
       15 
     | 
    
         
            -
              VERSION = '3.0.0 
     | 
| 
      
 16 
     | 
    
         
            +
              VERSION = '3.0.0'
         
     | 
| 
       16 
17 
     | 
    
         | 
| 
       17 
18 
     | 
    
         
             
              THRESHOLD = 0.60
         
     | 
| 
       18 
19 
     | 
    
         
             
              SCORES = Hash.new 1
         
     | 
| 
         @@ -256,7 +257,13 @@ class Flog < SexpProcessor 
     | 
|
| 
       256 
257 
     | 
    
         
             
                    warn "** flogging #{file}" if option[:verbose]
         
     | 
| 
       257 
258 
     | 
    
         | 
| 
       258 
259 
     | 
    
         
             
                    @parser = option[:parser].new
         
     | 
| 
       259 
     | 
    
         
            -
             
     | 
| 
      
 260 
     | 
    
         
            +
             
     | 
| 
      
 261 
     | 
    
         
            +
                    begin
         
     | 
| 
      
 262 
     | 
    
         
            +
                      ast = @parser.process(ruby, file)
         
     | 
| 
      
 263 
     | 
    
         
            +
                    rescue Timeout::Error
         
     | 
| 
      
 264 
     | 
    
         
            +
                      warn "TIMEOUT parsing #{file}. Skipping."
         
     | 
| 
      
 265 
     | 
    
         
            +
                    end
         
     | 
| 
      
 266 
     | 
    
         
            +
             
     | 
| 
       260 
267 
     | 
    
         
             
                    next unless ast
         
     | 
| 
       261 
268 
     | 
    
         
             
                    mass[file] = ast.mass
         
     | 
| 
       262 
269 
     | 
    
         
             
                    process ast
         
     | 
| 
         @@ -703,6 +710,9 @@ class Flog < SexpProcessor 
     | 
|
| 
       703 
710 
     | 
    
         | 
| 
       704 
711 
     | 
    
         
             
              def process_masgn(exp)
         
     | 
| 
       705 
712 
     | 
    
         
             
                add_to_score :assignment
         
     | 
| 
      
 713 
     | 
    
         
            +
             
     | 
| 
      
 714 
     | 
    
         
            +
                exp.map! { |s| Sexp === s ? s : s(:lasgn, s) }
         
     | 
| 
      
 715 
     | 
    
         
            +
             
     | 
| 
       706 
716 
     | 
    
         
             
                process_until_empty exp
         
     | 
| 
       707 
717 
     | 
    
         
             
                s()
         
     | 
| 
       708 
718 
     | 
    
         
             
              end
         
     | 
    
        data.tar.gz.sig
    CHANGED
    
    | 
         Binary file 
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,15 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: flog
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              hash:  
     | 
| 
       5 
     | 
    
         
            -
              prerelease:  
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 7
         
     | 
| 
      
 5 
     | 
    
         
            +
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
              segments: 
         
     | 
| 
       7 
7 
     | 
    
         
             
              - 3
         
     | 
| 
       8 
8 
     | 
    
         
             
              - 0
         
     | 
| 
       9 
9 
     | 
    
         
             
              - 0
         
     | 
| 
       10 
     | 
    
         
            -
               
     | 
| 
       11 
     | 
    
         
            -
              - 3
         
     | 
| 
       12 
     | 
    
         
            -
              version: 3.0.0.b3
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 3.0.0
         
     | 
| 
       13 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       14 
12 
     | 
    
         
             
            authors: 
         
     | 
| 
       15 
13 
     | 
    
         
             
            - Ryan Davis
         
     | 
| 
         @@ -38,7 +36,7 @@ cert_chain: 
     | 
|
| 
       38 
36 
     | 
    
         
             
              FBHgymkyj/AOSqKRIpXPhjC6
         
     | 
| 
       39 
37 
     | 
    
         
             
              -----END CERTIFICATE-----
         
     | 
| 
       40 
38 
     | 
    
         | 
| 
       41 
     | 
    
         
            -
            date: 2012- 
     | 
| 
      
 39 
     | 
    
         
            +
            date: 2012-11-02 00:00:00 Z
         
     | 
| 
       42 
40 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       43 
41 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       44 
42 
     | 
    
         
             
              name: sexp_processor
         
     | 
| 
         @@ -63,14 +61,12 @@ dependencies: 
     | 
|
| 
       63 
61 
     | 
    
         
             
                requirements: 
         
     | 
| 
       64 
62 
     | 
    
         
             
                - - ~>
         
     | 
| 
       65 
63 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       66 
     | 
    
         
            -
                    hash:  
     | 
| 
      
 64 
     | 
    
         
            +
                    hash: 7
         
     | 
| 
       67 
65 
     | 
    
         
             
                    segments: 
         
     | 
| 
       68 
66 
     | 
    
         
             
                    - 3
         
     | 
| 
       69 
67 
     | 
    
         
             
                    - 0
         
     | 
| 
       70 
68 
     | 
    
         
             
                    - 0
         
     | 
| 
       71 
     | 
    
         
            -
                     
     | 
| 
       72 
     | 
    
         
            -
                    - 4
         
     | 
| 
       73 
     | 
    
         
            -
                    version: 3.0.0.a4
         
     | 
| 
      
 69 
     | 
    
         
            +
                    version: 3.0.0
         
     | 
| 
       74 
70 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       75 
71 
     | 
    
         
             
              version_requirements: *id002
         
     | 
| 
       76 
72 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
         @@ -164,14 +160,12 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       164 
160 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement 
         
     | 
| 
       165 
161 
     | 
    
         
             
              none: false
         
     | 
| 
       166 
162 
     | 
    
         
             
              requirements: 
         
     | 
| 
       167 
     | 
    
         
            -
              - - " 
     | 
| 
      
 163 
     | 
    
         
            +
              - - ">="
         
     | 
| 
       168 
164 
     | 
    
         
             
                - !ruby/object:Gem::Version 
         
     | 
| 
       169 
     | 
    
         
            -
                  hash:  
     | 
| 
      
 165 
     | 
    
         
            +
                  hash: 3
         
     | 
| 
       170 
166 
     | 
    
         
             
                  segments: 
         
     | 
| 
       171 
     | 
    
         
            -
                  -  
     | 
| 
       172 
     | 
    
         
            -
                   
     | 
| 
       173 
     | 
    
         
            -
                  - 1
         
     | 
| 
       174 
     | 
    
         
            -
                  version: 1.3.1
         
     | 
| 
      
 167 
     | 
    
         
            +
                  - 0
         
     | 
| 
      
 168 
     | 
    
         
            +
                  version: "0"
         
     | 
| 
       175 
169 
     | 
    
         
             
            requirements: []
         
     | 
| 
       176 
170 
     | 
    
         | 
| 
       177 
171 
     | 
    
         
             
            rubyforge_project: seattlerb
         
     | 
    
        metadata.gz.sig
    CHANGED
    
    | 
         Binary file 
     |