-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move all plugins stuff to lib/rollbar/plugins
The middlewares are still in lib/rollbar/middlewares, but everything is now loaded from the plugins directory
- Loading branch information
Jon de Andres
committed
Apr 20, 2016
1 parent
46b66d1
commit 33e62ca
Showing
43 changed files
with
411 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,5 @@ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0') | |
end | ||
|
||
gemspec :path => "../" | ||
|
||
gem 'byebug' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,4 @@ | ||
require "rollbar/js/version" | ||
|
||
module Rollbar | ||
module Js | ||
extend self | ||
|
||
attr_reader :framework | ||
attr_reader :framework_loader | ||
|
||
def prepare | ||
@framework ||= detect_framework | ||
@framework_loader ||= load_framework_class.new | ||
|
||
@framework_loader.prepare | ||
end | ||
|
||
private | ||
|
||
def detect_framework | ||
case | ||
when defined?(::Rails::VERSION) | ||
:rails | ||
end | ||
end | ||
|
||
def load_framework_class | ||
require "rollbar/js/frameworks/#{framework}" | ||
|
||
Rollbar::Js::Frameworks.const_get(framework.to_s.capitalize) | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Rollbar.plugins.define('ActiveRecord') do | ||
dependency { !configuration.disable_monkey_patch } | ||
dependency { defined?(ActiveRecord) } | ||
dependency do | ||
require 'active_record/version' | ||
|
||
ActiveRecord::VERSION::MAJOR >= 3 | ||
end | ||
|
||
execute do | ||
module Rollbar | ||
module ActiveRecordExtension | ||
extend ActiveSupport::Concern | ||
|
||
def report_validation_errors_to_rollbar | ||
errors.full_messages.each do |error| | ||
Rollbar.log_info "[Rollbar] Reporting form validation error: #{error} for #{self}" | ||
Rollbar.warning("Form Validation Error: #{error} for #{self}") | ||
end | ||
end | ||
end | ||
end | ||
|
||
ActiveRecord::Base.class_eval do | ||
include Rollbar::ActiveRecordExtension | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Rollbar.plugins.define('BasicSocket') do | ||
dependency { !configuration.disable_core_monkey_patch } | ||
|
||
# Needed to avoid active_support (< 4.1.0) bug serializing JSONs | ||
dependency { defined?(ActiveSupport::VERSION::STRING) } | ||
|
||
execute do | ||
require 'socket' | ||
|
||
class BasicSocket | ||
def as_json | ||
to_s | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Rollbar.plugins.define('DelayedJob') do | ||
dependency { !configuration.disable_monkey_patch } | ||
dependency do | ||
defined?(Delayed) && defined?(Delayed::Worker) && configuration.delayed_job_enabled | ||
end | ||
|
||
execute do | ||
require 'rollbar/plugins/delayed_job/plugin' | ||
|
||
Rollbar::Delayed.wrap_worker | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class JobData | ||
attr_reader :job | ||
|
||
def initialize(job) | ||
@job = job | ||
end | ||
|
||
def to_hash | ||
job_data = job.as_json | ||
# Here job_data['handler'] is a YAML object comming | ||
# from the storage backend | ||
job_data['handler'] = job.payload_object.as_json | ||
|
||
job_data | ||
end | ||
end |
Oops, something went wrong.