Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: avishekjana/rscratch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: netbrick/rscratch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 5 commits
  • 19 files changed
  • 2 contributors

Commits on Oct 26, 2016

  1. Make request optional.

    Tomas Volka committed Oct 26, 2016
    Copy the full SHA
    a702c2b View commit details

Commits on Oct 27, 2016

  1. Backtrace newlines.

    Tomas Volka committed Oct 27, 2016
    Copy the full SHA
    f7ffb34 View commit details
  2. Handle app root correctly.

    Tomas Volka committed Oct 27, 2016
    Copy the full SHA
    06ad3f0 View commit details
  3. Fix url for ignore/resolve.

    Tomas Volka committed Oct 27, 2016
    Copy the full SHA
    a39f6c0 View commit details

Commits on Jan 6, 2017

  1. Added remote assets inside gem.

    Tomas Fiala committed Jan 6, 2017
    Copy the full SHA
    f176214 View commit details
Binary file not shown.
2,373 changes: 2,373 additions & 0 deletions app/assets/fonts/rscratch/iconfont/MaterialIcons-Regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/assets/fonts/rscratch/roboto/Roboto-Bold.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/assets/fonts/rscratch/roboto/Roboto-Thin.ttf
Binary file not shown.
Binary file added app/assets/images/rscratch/rscratch_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/assets/javascripts/rscratch/dashboard.js
Original file line number Diff line number Diff line change
@@ -8,15 +8,15 @@ function load_dashboard_UI_components() {

// AJAX Request
var request = $.ajax({
url: "/rscratch/dashboard/index.json",
url: location.pathname + "/dashboard/index.json",
method: "GET",
dataType: "json",
});
request.done(function( data, textStatus, jqXHR ) {
load_exception_line_chart(data);
});
request.fail(function( jqXHR, textStatus ) {
alert("Sorry Something Went Wrong");
alert("Sorry something went wrong!");
// Materialize.toast('Sorry somethnig went wrong while crunching data, please try after sometime!', 5000);
});
}
10 changes: 6 additions & 4 deletions app/assets/javascripts/rscratch/exceptions.js
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ $(document).ready(function() {
var request;
request = $.ajax({
type: 'POST',
url: "/rscratch/exceptions/" + exception_id + "/resolve.json",
url: location.pathname + "/" + exception_id + "/resolve.json",
dataType: "json"
});
request.done(function(rData, textStatus, jqXHR) {
@@ -69,7 +69,7 @@ $(document).ready(function() {
var request;
request = $.ajax({
type: 'POST',
url: "/rscratch/exceptions/" + exception_id + "/toggle_ignore.json",
url: location.pathname + "/" + exception_id + "/toggle_ignore.json",
dataType: "json"
});
request.done(function(rData, textStatus, jqXHR) {
@@ -103,7 +103,7 @@ $(document).ready(function() {
var request;
request = $.ajax({
type: 'GET',
url: "/rscratch/exceptions/" + exception_id + ".json?page=" + page,
url: location.pathname + "/" + exception_id + ".json?page=" + page,
dataType: "json"
});
request.done(function(rData, textStatus, jqXHR) {
@@ -133,7 +133,9 @@ $(document).ready(function() {
$(".current-log").html(page);

// Setting log data
$(".ex-backtrace").html(rData.data.log.backtrace);
btr = rData.data.log.backtrace;
btr = btr.replace(/\\n/g,"<br>");
$(".ex-backtrace").html(btr);
$(".ex-params").html(rData.data.log.parameters);
rData.response = rData.data;
over_data = JST['rscratch/templates/exception_overview'](rData);
10 changes: 10 additions & 0 deletions app/assets/javascripts/rscratch/materialize.min.js

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions app/assets/stylesheets/rscratch/materialize.min.css

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions app/models/rscratch/exception.rb
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ class Exception < ActiveRecord::Base
### => Model Validations
validates :exception , presence: true
validates :message , presence: true
validates :controller , presence: true
validates :action , presence: true
validates :controller , presence: false
validates :action , presence: false
validates :app_environment , presence: true
validates :status , presence: true, :inclusion => {:in => STATUS}

@@ -38,6 +38,10 @@ class Exception < ActiveRecord::Base

# Log an exception
def self.log(_exception,_request)
if _request.nil?
_request = OpenStruct.new
_request.filtered_parameters = { "controller" => "", "action" => "" }
end
_exc = self.find_or_create(_exception,_request.filtered_parameters["controller"].camelize,_request.filtered_parameters["action"],Rails.env.camelize)
unless _exc.ignored?
_log = ExceptionLog.new
21 changes: 5 additions & 16 deletions app/views/layouts/rscratch/application.html.haml
Original file line number Diff line number Diff line change
@@ -2,34 +2,23 @@
%html
%head
%title Rscratch | Track Exceptions and Bugs of your Rails application
/ Import Google Icon Font
%link{:href => "http://fonts.googleapis.com/icon?family=Material+Icons", :rel => "stylesheet"}
/ Import materialize.css
%link{:href => "https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/css/materialize.min.css", :rel => "stylesheet"}
/ Compiled and minified JavaScript
= stylesheet_link_tag "rscratch/application", :media => "all"
= javascript_include_tag "rscratch/application"
%script{:src => "https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/js/materialize.min.js"}
= csrf_meta_tags
%body
.navbar-fixed
%nav.white
.nav-wrapper
%ul.left
%li
%h1.logo-wrapper{:style => ""}
%h1.logo-wrapper
%a{:href => "/rscratch"}
%img{:alt => "Rscratch", :height => "55", :src => "http://rscratch.github.io/rscratch_logo.png"}
=image_tag 'rscratch/rscratch_logo.png', :alt => "Rscratch", :height => "55"
%span.logo-text RScratch
%ul#nav-mobile.left.hide-on-med-and-down.grey-text
%li{:class => "#{'active' if current_page?(root_path)}"}
%a.grey-text.text-darken-2{:href => root_path} DASHBOARD
%a.grey-text.text-darken-2{:href => root_path} DASHBOARD
%li{:class => "#{'active' if current_page?(exceptions_path)}"}
%a.grey-text.text-darken-2{:href => exceptions_path} EXCEPTIONS
/ %li
/ %a.grey-text.text-darken-2{:href => "#"} CONFIGURATIONS
%ul.right.hide-on-med-and-down
%li
%a.waves-effect.waves-light.btn.green.darken-1{:href => "https://github.com/avishekjana/rscratch", :target => "_blank"}
Fork on Github
= yield

= yield
2 changes: 1 addition & 1 deletion lib/rscratch.rb
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ def self.configuration
@configuration ||= Configuration.new
end

def self.log_exception(exception, request)
def self.log_exception(exception, request=nil)
log = Rscratch::Exception.log(exception, request)
end
end
3 changes: 3 additions & 0 deletions lib/rscratch/engine.rb
Original file line number Diff line number Diff line change
@@ -6,5 +6,8 @@
module Rscratch
class Engine < ::Rails::Engine
isolate_namespace Rscratch
config.assets.precompile += %w( rscratch/rscratch_logo.png )
config.assets.precompile += %w( rscratch/roboto/*.ttf )
config.assets.precompile += %w( rscratch/iconfont/* )
end
end