bug_hunter 0.0.5 → 0.0.6
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/VERSION +1 -1
- data/bug_hunter.gemspec +2 -2
- data/lib/bug_hunter/app.rb +6 -0
- data/lib/bug_hunter/models.rb +20 -7
- data/lib/bug_hunter/views/errors/show.haml +5 -0
- metadata +4 -4
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0.0. | 
| 1 | 
            +
            0.0.6
         | 
    
        data/bug_hunter.gemspec
    CHANGED
    
    | @@ -5,11 +5,11 @@ | |
| 5 5 |  | 
| 6 6 | 
             
            Gem::Specification.new do |s|
         | 
| 7 7 | 
             
              s.name = %q{bug_hunter}
         | 
| 8 | 
            -
              s.version = "0.0. | 
| 8 | 
            +
              s.version = "0.0.6"
         | 
| 9 9 |  | 
| 10 10 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 11 11 | 
             
              s.authors = ["David A. Cuadrado"]
         | 
| 12 | 
            -
              s.date = %q{2011-05- | 
| 12 | 
            +
              s.date = %q{2011-05-29}
         | 
| 13 13 | 
             
              s.default_executable = %q{bug_hunter}
         | 
| 14 14 | 
             
              s.description = %q{sinatra app to manage web app exceptions}
         | 
| 15 15 | 
             
              s.email = %q{krawek@gmail.com}
         | 
    
        data/lib/bug_hunter/app.rb
    CHANGED
    
    
    
        data/lib/bug_hunter/models.rb
    CHANGED
    
    | @@ -49,7 +49,7 @@ module BugHunter | |
| 49 49 | 
             
                end
         | 
| 50 50 |  | 
| 51 51 | 
             
                def similar_errors
         | 
| 52 | 
            -
                  self.class.where(:message =>  | 
| 52 | 
            +
                  self.class.where(:message => partial_message, :_id.ne => self.id)
         | 
| 53 53 | 
             
                end
         | 
| 54 54 |  | 
| 55 55 | 
             
                def add_comment(from, message, ip)
         | 
| @@ -81,20 +81,33 @@ module BugHunter | |
| 81 81 | 
             
                end
         | 
| 82 82 |  | 
| 83 83 | 
             
                def unique_error_selector
         | 
| 84 | 
            -
                  msg = self[:message]
         | 
| 85 | 
            -
                  if msg.match(/#<.+>/)
         | 
| 86 | 
            -
                    msg = /^#{Regexp.escape($`)}/
         | 
| 87 | 
            -
                  end
         | 
| 88 | 
            -
             | 
| 89 84 | 
             
                  {
         | 
| 90 85 | 
             
                    :resolved => false,
         | 
| 91 | 
            -
                    :message =>  | 
| 86 | 
            +
                    :message => partial_message,
         | 
| 92 87 | 
             
                    :file => self.file,
         | 
| 93 88 | 
             
                    :line => self.line,
         | 
| 94 89 | 
             
                    :method => self.method
         | 
| 95 90 | 
             
                  }
         | 
| 96 91 | 
             
                end
         | 
| 97 92 |  | 
| 93 | 
            +
                def partial_message(regex = true)
         | 
| 94 | 
            +
                  msg = self[:message]
         | 
| 95 | 
            +
                  if msg.match(/#<.+>/) && $`.length > 10
         | 
| 96 | 
            +
                    if regex
         | 
| 97 | 
            +
                      msg = /^#{Regexp.escape($`)}/
         | 
| 98 | 
            +
                    else
         | 
| 99 | 
            +
                      msg = $`
         | 
| 100 | 
            +
                    end
         | 
| 101 | 
            +
                  elsif msg.match(/\{.+\}/) && $`.length > 10
         | 
| 102 | 
            +
                    if regex
         | 
| 103 | 
            +
                      msg = /^#{Regexp.escape($`)}/
         | 
| 104 | 
            +
                    else
         | 
| 105 | 
            +
                      msg = $`
         | 
| 106 | 
            +
                    end
         | 
| 107 | 
            +
                  end
         | 
| 108 | 
            +
             | 
| 109 | 
            +
                  msg
         | 
| 110 | 
            +
                end
         | 
| 98 111 |  | 
| 99 112 | 
             
                def self.build_from(env, exception)
         | 
| 100 113 | 
             
                  doc = self.new
         | 
| @@ -80,3 +80,8 @@ | |
| 80 80 | 
             
              -else
         | 
| 81 81 | 
             
                %a(href="#{error_path(@error)}/resolve" data-icon="check" data-theme="e")
         | 
| 82 82 | 
             
                  Resolve this error
         | 
| 83 | 
            +
              %a(href="#{error_path(@error)}/resolve?include_similar=1" data-icon="alert" data-theme="d")
         | 
| 84 | 
            +
                Resolve all similar errors
         | 
| 85 | 
            +
             | 
| 86 | 
            +
              %a(href="http://google.com/search?q=#{@error.partial_message(false).gsub(" ", "+")}" data-icon="search" data-theme="c" rel="external" target="_blank")
         | 
| 87 | 
            +
                Google This Error
         | 
    
        metadata
    CHANGED
    
    | @@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version | |
| 5 5 | 
             
              segments: 
         | 
| 6 6 | 
             
              - 0
         | 
| 7 7 | 
             
              - 0
         | 
| 8 | 
            -
              -  | 
| 9 | 
            -
              version: 0.0. | 
| 8 | 
            +
              - 6
         | 
| 9 | 
            +
              version: 0.0.6
         | 
| 10 10 | 
             
            platform: ruby
         | 
| 11 11 | 
             
            authors: 
         | 
| 12 12 | 
             
            - David A. Cuadrado
         | 
| @@ -14,7 +14,7 @@ autorequire: | |
| 14 14 | 
             
            bindir: bin
         | 
| 15 15 | 
             
            cert_chain: []
         | 
| 16 16 |  | 
| 17 | 
            -
            date: 2011-05- | 
| 17 | 
            +
            date: 2011-05-29 00:00:00 -05:00
         | 
| 18 18 | 
             
            default_executable: bug_hunter
         | 
| 19 19 | 
             
            dependencies: 
         | 
| 20 20 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -231,7 +231,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 231 231 | 
             
              requirements: 
         | 
| 232 232 | 
             
              - - ">="
         | 
| 233 233 | 
             
                - !ruby/object:Gem::Version 
         | 
| 234 | 
            -
                  hash:  | 
| 234 | 
            +
                  hash: -1435399183817290328
         | 
| 235 235 | 
             
                  segments: 
         | 
| 236 236 | 
             
                  - 0
         | 
| 237 237 | 
             
                  version: "0"
         |