rollbar 2.18.2 → 2.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +15 -0
- data/.travis.yml +155 -93
- data/Gemfile +19 -13
- data/README.md +12 -0
- data/gemfiles/rails30.gemfile +17 -10
- data/gemfiles/rails31.gemfile +20 -12
- data/gemfiles/rails32.gemfile +16 -7
- data/gemfiles/rails40.gemfile +16 -5
- data/gemfiles/rails41.gemfile +15 -5
- data/gemfiles/rails42.gemfile +25 -14
- data/gemfiles/rails50.gemfile +15 -8
- data/gemfiles/rails51.gemfile +15 -8
- data/gemfiles/rails52.gemfile +62 -0
- data/gemfiles/ruby_1_8_and_1_9_2.gemfile +2 -2
- data/lib/rails/rollbar_runner.rb +16 -1
- data/lib/rollbar/capistrano.rb +71 -39
- data/lib/rollbar/capistrano3.rb +53 -1
- data/lib/rollbar/capistrano_tasks.rb +131 -0
- data/lib/rollbar/configuration.rb +13 -4
- data/lib/rollbar/delay/active_job.rb +17 -0
- data/lib/rollbar/delay/sidekiq.rb +3 -1
- data/lib/rollbar/delay/thread.rb +1 -1
- data/lib/rollbar/deploy.rb +69 -0
- data/lib/rollbar/item.rb +17 -6
- data/lib/rollbar/middleware/js.rb +25 -3
- data/lib/rollbar/middleware/js/json_value.rb +26 -0
- data/lib/rollbar/notifier.rb +32 -13
- data/lib/rollbar/plugins/active_job.rb +3 -0
- data/lib/rollbar/plugins/rails/controller_methods.rb +2 -1
- data/lib/rollbar/plugins/rails/railtie_mixin.rb +7 -1
- data/lib/rollbar/rake_tasks.rb +126 -67
- data/lib/rollbar/scrubbers/params.rb +6 -0
- data/lib/rollbar/util.rb +75 -45
- data/lib/rollbar/util/hash.rb +15 -6
- data/lib/rollbar/version.rb +1 -1
- data/rollbar.gemspec +2 -3
- metadata +9 -261
- data/lib/rollbar/tasks/rollbar.cap +0 -47
- data/spec/cacert.pem +0 -3988
- data/spec/controllers/home_controller_spec.rb +0 -480
- data/spec/delay/sidekiq_spec.rb +0 -61
- data/spec/delay/sucker_punch_spec.rb +0 -25
- data/spec/delayed/backend/test.rb +0 -140
- data/spec/delayed/serialization/test.rb +0 -0
- data/spec/dummyapp/.gitignore +0 -73
- data/spec/dummyapp/Rakefile +0 -7
- data/spec/dummyapp/app/assets/javascripts/application.js +0 -3
- data/spec/dummyapp/app/assets/stylesheets/application.css.scss +0 -37
- data/spec/dummyapp/app/controllers/application_controller.rb +0 -3
- data/spec/dummyapp/app/controllers/home_controller.rb +0 -60
- data/spec/dummyapp/app/controllers/users_controller.rb +0 -17
- data/spec/dummyapp/app/helpers/.gitkeep +0 -0
- data/spec/dummyapp/app/mailers/.gitkeep +0 -0
- data/spec/dummyapp/app/models/.gitkeep +0 -0
- data/spec/dummyapp/app/models/book.rb +0 -5
- data/spec/dummyapp/app/models/post.rb +0 -9
- data/spec/dummyapp/app/models/user.rb +0 -9
- data/spec/dummyapp/app/views/devise/registrations/edit.html.erb +0 -27
- data/spec/dummyapp/app/views/devise/registrations/new.html.erb +0 -20
- data/spec/dummyapp/app/views/devise/shared/_links.html.erb +0 -25
- data/spec/dummyapp/app/views/home/cause_exception.html.erb +0 -1
- data/spec/dummyapp/app/views/home/index.html.erb +0 -4
- data/spec/dummyapp/app/views/home/report_exception.html.erb +0 -1
- data/spec/dummyapp/app/views/js/test.html.erb +0 -1
- data/spec/dummyapp/app/views/layouts/_messages.html.erb +0 -5
- data/spec/dummyapp/app/views/layouts/_navigation.html.erb +0 -21
- data/spec/dummyapp/app/views/layouts/application.html.erb +0 -25
- data/spec/dummyapp/app/views/layouts/simple.html.erb +0 -18
- data/spec/dummyapp/app/views/users/index.html.erb +0 -8
- data/spec/dummyapp/app/views/users/show.html.erb +0 -3
- data/spec/dummyapp/config.ru +0 -4
- data/spec/dummyapp/config/application.rb +0 -59
- data/spec/dummyapp/config/boot.rb +0 -10
- data/spec/dummyapp/config/database.yml +0 -25
- data/spec/dummyapp/config/environment.rb +0 -5
- data/spec/dummyapp/config/environments/development.rb +0 -37
- data/spec/dummyapp/config/environments/production.rb +0 -67
- data/spec/dummyapp/config/environments/test.rb +0 -37
- data/spec/dummyapp/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummyapp/config/initializers/inflections.rb +0 -15
- data/spec/dummyapp/config/initializers/mime_types.rb +0 -5
- data/spec/dummyapp/config/initializers/rollbar.rb +0 -26
- data/spec/dummyapp/config/initializers/secret_token.rb +0 -7
- data/spec/dummyapp/config/initializers/session_store.rb +0 -8
- data/spec/dummyapp/config/initializers/wrap_parameters.rb +0 -16
- data/spec/dummyapp/config/locales/devise.en.yml +0 -58
- data/spec/dummyapp/config/locales/en.yml +0 -5
- data/spec/dummyapp/config/routes.rb +0 -17
- data/spec/dummyapp/config/secrets.yml +0 -2
- data/spec/dummyapp/db/migrate/20121121184652_devise_create_users.rb +0 -46
- data/spec/dummyapp/db/migrate/20121121184654_add_name_to_users.rb +0 -5
- data/spec/dummyapp/db/migrate/20161219184410_create_books.rb +0 -10
- data/spec/dummyapp/db/migrate/20161219185529_add_username_to_users.rb +0 -5
- data/spec/dummyapp/db/schema.rb +0 -41
- data/spec/dummyapp/db/seeds.rb +0 -12
- data/spec/dummyapp/lib/assets/.gitkeep +0 -0
- data/spec/dummyapp/public/404.html +0 -26
- data/spec/dummyapp/public/422.html +0 -26
- data/spec/dummyapp/public/500.html +0 -25
- data/spec/dummyapp/public/favicon.ico +0 -0
- data/spec/dummyapp/script/rails +0 -6
- data/spec/fixtures/file1 +0 -1
- data/spec/fixtures/file2 +0 -1
- data/spec/fixtures/payloads/message.json +0 -25
- data/spec/fixtures/payloads/sample.trace.json +0 -275
- data/spec/fixtures/payloads/sample.trace_chain.json +0 -530
- data/spec/fixtures/plugins/dummy1.rb +0 -5
- data/spec/fixtures/plugins/dummy2.rb +0 -5
- data/spec/generators/rollbar/rollbar_generator_rails30_spec.rb +0 -31
- data/spec/generators/rollbar/rollbar_generator_spec.rb +0 -51
- data/spec/requests/home_spec.rb +0 -49
- data/spec/rollbar/configuration_spec.rb +0 -74
- data/spec/rollbar/delay/delayed_job_spec.rb +0 -22
- data/spec/rollbar/delay/girl_friday_spec.rb +0 -41
- data/spec/rollbar/delay/resque_spec.rb +0 -37
- data/spec/rollbar/delay/shoryuken_spec.rb +0 -44
- data/spec/rollbar/delay/thread_spec.rb +0 -27
- data/spec/rollbar/encoding/encoder_spec.rb +0 -63
- data/spec/rollbar/item/backtrace_spec.rb +0 -26
- data/spec/rollbar/item/frame_spec.rb +0 -267
- data/spec/rollbar/item_spec.rb +0 -736
- data/spec/rollbar/json/oj_spec.rb +0 -18
- data/spec/rollbar/json_spec.rb +0 -110
- data/spec/rollbar/lazy_store_spec.rb +0 -99
- data/spec/rollbar/logger_proxy_spec.rb +0 -69
- data/spec/rollbar/logger_spec.rb +0 -124
- data/spec/rollbar/middleware/js_spec.rb +0 -428
- data/spec/rollbar/middleware/sinatra_spec.rb +0 -197
- data/spec/rollbar/notifier_spec.rb +0 -67
- data/spec/rollbar/plugin_spec.rb +0 -209
- data/spec/rollbar/plugins/active_job_spec.rb +0 -45
- data/spec/rollbar/plugins/delayed_job/job_data_spec.rb +0 -48
- data/spec/rollbar/plugins/delayed_job_spec.rb +0 -129
- data/spec/rollbar/plugins/rack_spec.rb +0 -152
- data/spec/rollbar/plugins/rails_js_spec.rb +0 -19
- data/spec/rollbar/plugins/rake_spec.rb +0 -34
- data/spec/rollbar/plugins/resque/failure_spec.rb +0 -36
- data/spec/rollbar/plugins/sidekiq_spec.rb +0 -169
- data/spec/rollbar/plugins/validations_spec.rb +0 -56
- data/spec/rollbar/plugins_spec.rb +0 -68
- data/spec/rollbar/request_data_extractor_spec.rb +0 -321
- data/spec/rollbar/scrubbers/params_spec.rb +0 -598
- data/spec/rollbar/scrubbers/url_spec.rb +0 -240
- data/spec/rollbar/scrubbers_spec.rb +0 -31
- data/spec/rollbar/sidekig/clear_scope_spec.rb +0 -19
- data/spec/rollbar/truncation/frames_strategy_spec.rb +0 -70
- data/spec/rollbar/truncation/min_body_strategy_spec.rb +0 -57
- data/spec/rollbar/truncation/strings_strategy_spec.rb +0 -89
- data/spec/rollbar/truncation_spec.rb +0 -27
- data/spec/rollbar/util/hash_spec.rb +0 -22
- data/spec/rollbar/util/ip_anonymizer_spec.rb +0 -30
- data/spec/rollbar/util_spec.rb +0 -80
- data/spec/rollbar_bc_spec.rb +0 -380
- data/spec/rollbar_spec.rb +0 -1737
- data/spec/spec_helper.rb +0 -84
- data/spec/support/cause_exception.rb +0 -1
- data/spec/support/encoding_helpers.rb +0 -8
- data/spec/support/encodings/iso_8859_9 +0 -1
- data/spec/support/fixture_helpers.rb +0 -10
- data/spec/support/get_ip_raising.rb +0 -7
- data/spec/support/helpers.rb +0 -5
- data/spec/support/matchers.rb +0 -23
- data/spec/support/notifier_helpers.rb +0 -57
- data/spec/support/rollbar_api.rb +0 -57
- data/spec/support/secure_headers_mocks.rb +0 -83
- data/spec/support/shared_contexts.rb +0 -12
data/spec/delay/sidekiq_spec.rb
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'rollbar/delay/sidekiq'
|
5
|
-
require 'sidekiq/testing'
|
6
|
-
rescue LoadError
|
7
|
-
module Rollbar
|
8
|
-
module Delay
|
9
|
-
class Sidekiq
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe Rollbar::Delay::Sidekiq, :if => RUBY_VERSION != '1.8.7' do
|
16
|
-
let(:payload) { anything }
|
17
|
-
|
18
|
-
describe "#perform" do
|
19
|
-
it "performs payload" do
|
20
|
-
Rollbar.should_receive(:process_from_async_handler).with(payload)
|
21
|
-
subject.perform payload
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "#call" do
|
26
|
-
shared_examples "a Rollbar processor" do
|
27
|
-
|
28
|
-
it "processes payload" do
|
29
|
-
Rollbar.should_receive(:process_from_async_handler).with(payload)
|
30
|
-
|
31
|
-
subject.call payload
|
32
|
-
described_class.drain
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
context "with default options" do
|
37
|
-
it "enqueues to default queue" do
|
38
|
-
options = Rollbar::Delay::Sidekiq::OPTIONS.merge('args' => payload)
|
39
|
-
::Sidekiq::Client.should_receive(:push).with options
|
40
|
-
|
41
|
-
subject.call payload
|
42
|
-
end
|
43
|
-
|
44
|
-
it_behaves_like "a Rollbar processor"
|
45
|
-
end
|
46
|
-
|
47
|
-
context "with custom options" do
|
48
|
-
let(:custom_config) { { 'queue' => 'custom_queue' } }
|
49
|
-
subject { Rollbar::Delay::Sidekiq.new custom_config }
|
50
|
-
|
51
|
-
it "enqueues to custom queue" do
|
52
|
-
options = Rollbar::Delay::Sidekiq::OPTIONS.merge(custom_config.merge('args' => payload))
|
53
|
-
::Sidekiq::Client.should_receive(:push).with options
|
54
|
-
|
55
|
-
subject.call payload
|
56
|
-
end
|
57
|
-
|
58
|
-
it_behaves_like "a Rollbar processor"
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'rollbar/delay/sucker_punch'
|
5
|
-
require 'sucker_punch/testing/inline'
|
6
|
-
rescue LoadError
|
7
|
-
module Rollbar
|
8
|
-
module Delay
|
9
|
-
class SuckerPunch
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe Rollbar::Delay::SuckerPunch, :if => RUBY_VERSION != '1.8.7' do
|
16
|
-
describe '.call' do
|
17
|
-
let(:payload) { 'anything' }
|
18
|
-
|
19
|
-
it 'performs the task asynchronously' do
|
20
|
-
Rollbar.should_receive(:process_from_async_handler)
|
21
|
-
|
22
|
-
Rollbar::Delay::SuckerPunch.call(payload)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,140 +0,0 @@
|
|
1
|
-
require 'ostruct'
|
2
|
-
require 'delayed_job'
|
3
|
-
require 'delayed/backend/base'
|
4
|
-
|
5
|
-
# This code is taken from delayed_job/spec/delayed/backend/test.rb.
|
6
|
-
#
|
7
|
-
# It just works as a in memory job backend. Job#save is modified to create
|
8
|
-
# a new Delayed::Worker and call #work_off(1) so the job is processed inline.
|
9
|
-
|
10
|
-
module Delayed
|
11
|
-
module Backend
|
12
|
-
module Test
|
13
|
-
def self.run
|
14
|
-
worker.work_off(1)
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.worker
|
18
|
-
prepare_worker unless @worker
|
19
|
-
|
20
|
-
@worker
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.prepare_worker
|
24
|
-
@worker = ::Delayed::Worker.new
|
25
|
-
end
|
26
|
-
|
27
|
-
class Job
|
28
|
-
attr_accessor :id
|
29
|
-
attr_accessor :priority
|
30
|
-
attr_accessor :attempts
|
31
|
-
attr_accessor :handler
|
32
|
-
attr_accessor :last_error
|
33
|
-
attr_accessor :run_at
|
34
|
-
attr_accessor :locked_at
|
35
|
-
attr_accessor :locked_by
|
36
|
-
attr_accessor :failed_at
|
37
|
-
attr_accessor :queue
|
38
|
-
|
39
|
-
include Delayed::Backend::Base
|
40
|
-
|
41
|
-
cattr_accessor :id
|
42
|
-
self.id = 0
|
43
|
-
|
44
|
-
def initialize(hash = {})
|
45
|
-
self.attempts = 0
|
46
|
-
self.priority = 0
|
47
|
-
self.id = (self.class.id += 1)
|
48
|
-
hash.each { |k, v| send("#{k}=", v) }
|
49
|
-
end
|
50
|
-
|
51
|
-
def self.all
|
52
|
-
@jobs ||= []
|
53
|
-
end
|
54
|
-
|
55
|
-
def self.count
|
56
|
-
all.size
|
57
|
-
end
|
58
|
-
|
59
|
-
def self.delete_all
|
60
|
-
all.clear
|
61
|
-
end
|
62
|
-
|
63
|
-
def self.create(attrs = {})
|
64
|
-
new(attrs).tap do |o|
|
65
|
-
o.save
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
def self.create!(*args)
|
70
|
-
create(*args)
|
71
|
-
end
|
72
|
-
|
73
|
-
def self.clear_locks!(worker_name)
|
74
|
-
all.select { |j| j.locked_by == worker_name }.each do |j|
|
75
|
-
j.locked_by = nil
|
76
|
-
j.locked_at = nil
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
# Find a few candidate jobs to run (in case some immediately get locked by others).
|
81
|
-
def self.find_available(worker_name, limit = 5, max_run_time = Worker.max_run_time) # rubocop:disable CyclomaticComplexity, PerceivedComplexity
|
82
|
-
jobs = all.select do |j|
|
83
|
-
j.run_at <= db_time_now &&
|
84
|
-
(j.locked_at.nil? || j.locked_at < db_time_now - max_run_time || j.locked_by == worker_name) &&
|
85
|
-
!j.failed?
|
86
|
-
end
|
87
|
-
jobs.select! { |j| j.priority <= Worker.max_priority } if Worker.max_priority
|
88
|
-
jobs.select! { |j| j.priority >= Worker.min_priority } if Worker.min_priority
|
89
|
-
jobs.select! { |j| Worker.queues.include?(j.queue) } if Worker.queues.any?
|
90
|
-
jobs.sort_by! { |j| [j.priority, j.run_at] }[0..limit - 1]
|
91
|
-
end
|
92
|
-
|
93
|
-
# Lock this job for this worker.
|
94
|
-
# Returns true if we have the lock, false otherwise.
|
95
|
-
def lock_exclusively!(_max_run_time, worker)
|
96
|
-
now = self.class.db_time_now
|
97
|
-
if locked_by != worker
|
98
|
-
# We don't own this job so we will update the locked_by name and the locked_at
|
99
|
-
self.locked_at = now
|
100
|
-
self.locked_by = worker
|
101
|
-
end
|
102
|
-
|
103
|
-
true
|
104
|
-
end
|
105
|
-
|
106
|
-
def self.db_time_now
|
107
|
-
Time.current
|
108
|
-
end
|
109
|
-
|
110
|
-
def update_attributes(attrs = {})
|
111
|
-
attrs.each { |k, v| send(:"#{k}=", v) }
|
112
|
-
save
|
113
|
-
end
|
114
|
-
|
115
|
-
def destroy
|
116
|
-
self.class.all.delete(self)
|
117
|
-
end
|
118
|
-
|
119
|
-
def save
|
120
|
-
self.run_at ||= Time.current
|
121
|
-
|
122
|
-
self.class.all << self unless self.class.all.include?(self)
|
123
|
-
|
124
|
-
::Delayed::Backend::Test.run
|
125
|
-
|
126
|
-
true
|
127
|
-
end
|
128
|
-
|
129
|
-
def save!
|
130
|
-
save
|
131
|
-
end
|
132
|
-
|
133
|
-
def reload
|
134
|
-
reset
|
135
|
-
self
|
136
|
-
end
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|
140
|
-
end
|
File without changes
|
data/spec/dummyapp/.gitignore
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
#----------------------------------------------------------------------------
|
2
|
-
# Ignore these files when commiting to a git repository.
|
3
|
-
#
|
4
|
-
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
5
|
-
#
|
6
|
-
# The original version of this file is found here:
|
7
|
-
# https://github.com/RailsApps/rails-composer/blob/master/files/gitignore.txt
|
8
|
-
#
|
9
|
-
# Corrections? Improvements? Create a GitHub issue:
|
10
|
-
# http://github.com/RailsApps/rails-composer/issues
|
11
|
-
#----------------------------------------------------------------------------
|
12
|
-
|
13
|
-
# bundler state
|
14
|
-
/.bundle
|
15
|
-
/vendor/bundle/
|
16
|
-
/vendor/ruby/
|
17
|
-
|
18
|
-
# minimal Rails specific artifacts
|
19
|
-
db/*.sqlite3
|
20
|
-
/log/*
|
21
|
-
/tmp/*
|
22
|
-
|
23
|
-
# various artifacts
|
24
|
-
**.war
|
25
|
-
*.rbc
|
26
|
-
*.sassc
|
27
|
-
.rspec
|
28
|
-
.redcar/
|
29
|
-
.sass-cache
|
30
|
-
/config/config.yml
|
31
|
-
/coverage.data
|
32
|
-
/coverage/
|
33
|
-
/db/*.javadb/
|
34
|
-
/db/*.sqlite3
|
35
|
-
/doc/api/
|
36
|
-
/doc/app/
|
37
|
-
/doc/features.html
|
38
|
-
/doc/specs.html
|
39
|
-
/public/cache
|
40
|
-
/public/stylesheets/compiled
|
41
|
-
/public/system/*
|
42
|
-
/spec/tmp/*
|
43
|
-
/cache
|
44
|
-
/capybara*
|
45
|
-
/capybara-*.html
|
46
|
-
/gems
|
47
|
-
/specifications
|
48
|
-
rerun.txt
|
49
|
-
pickle-email-*.html
|
50
|
-
|
51
|
-
# If you find yourself ignoring temporary files generated by your text editor
|
52
|
-
# or operating system, you probably want to add a global ignore instead:
|
53
|
-
# git config --global core.excludesfile ~/.gitignore_global
|
54
|
-
#
|
55
|
-
# Here are some files you may want to ignore globally:
|
56
|
-
|
57
|
-
# scm revert files
|
58
|
-
**.orig
|
59
|
-
|
60
|
-
# Mac finder artifacts
|
61
|
-
.DS_Store
|
62
|
-
|
63
|
-
# Netbeans project directory
|
64
|
-
/nbproject/
|
65
|
-
|
66
|
-
# RubyMine project files
|
67
|
-
.idea
|
68
|
-
|
69
|
-
# Textmate project files
|
70
|
-
/*.tmproj
|
71
|
-
|
72
|
-
# vim artifacts
|
73
|
-
**.swp
|
data/spec/dummyapp/Rakefile
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
|
-
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
-
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
-
|
5
|
-
require File.expand_path('../config/application', __FILE__)
|
6
|
-
|
7
|
-
Dummy::Application.load_tasks
|
@@ -1,37 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
-
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
-
*
|
11
|
-
*= require_self
|
12
|
-
*= require_tree .
|
13
|
-
*/
|
14
|
-
.brand {
|
15
|
-
float: left;
|
16
|
-
padding-right: 8px;
|
17
|
-
}
|
18
|
-
ul.nav {
|
19
|
-
list-style: none;
|
20
|
-
margin: 0 0 2em;
|
21
|
-
padding: 0;
|
22
|
-
}
|
23
|
-
ul.nav li {
|
24
|
-
display: inline;
|
25
|
-
}
|
26
|
-
#flash_notice, #flash_alert {
|
27
|
-
padding: 5px 8px;
|
28
|
-
margin: 10px 0;
|
29
|
-
}
|
30
|
-
#flash_notice {
|
31
|
-
background-color: #CFC;
|
32
|
-
border: solid 1px #6C6;
|
33
|
-
}
|
34
|
-
#flash_alert {
|
35
|
-
background-color: #FCC;
|
36
|
-
border: solid 1px #C66;
|
37
|
-
}
|
@@ -1,60 +0,0 @@
|
|
1
|
-
class HomeController < ApplicationController
|
2
|
-
def index
|
3
|
-
@users = User.all
|
4
|
-
|
5
|
-
Rollbar.debug("Test message from controller with no data")
|
6
|
-
Rollbar.debug("Test message from controller with extra data",
|
7
|
-
:foo => "bar", :num_users => @users.length)
|
8
|
-
end
|
9
|
-
|
10
|
-
def report_exception
|
11
|
-
begin
|
12
|
-
foo = bar
|
13
|
-
rescue => e
|
14
|
-
Rollbar.error(e)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def deprecated_report_exception
|
19
|
-
begin
|
20
|
-
foo = bar
|
21
|
-
rescue => e
|
22
|
-
Rollbar.error(e)
|
23
|
-
end
|
24
|
-
render :json => {}
|
25
|
-
end
|
26
|
-
|
27
|
-
def cause_exception
|
28
|
-
foo = bar
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_rollbar_js
|
32
|
-
render 'js/test', :layout => 'simple'
|
33
|
-
end
|
34
|
-
|
35
|
-
def file_upload
|
36
|
-
this = will_crash
|
37
|
-
end
|
38
|
-
|
39
|
-
def set_session_data
|
40
|
-
session[:some_value] = 'this-is-a-cool-value'
|
41
|
-
|
42
|
-
render :json => {}
|
43
|
-
end
|
44
|
-
|
45
|
-
def use_session_data
|
46
|
-
oh = this_is_crashing!
|
47
|
-
end
|
48
|
-
|
49
|
-
def current_user
|
50
|
-
@current_user ||= User.find_by_id(cookies[:session_id])
|
51
|
-
end
|
52
|
-
|
53
|
-
def custom_current_user
|
54
|
-
user = User.new
|
55
|
-
user.id = 123
|
56
|
-
user.username = 'test'
|
57
|
-
user.email = 'email@test.com'
|
58
|
-
user
|
59
|
-
end
|
60
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class UsersController < ApplicationController
|
2
|
-
respond_to?(:before_action) ? (before_action :authenticate_user!) : (before_filter :authenticate_user!)
|
3
|
-
|
4
|
-
def index
|
5
|
-
@users = User.all
|
6
|
-
end
|
7
|
-
|
8
|
-
def show
|
9
|
-
@user = User.find(params[:id])
|
10
|
-
end
|
11
|
-
|
12
|
-
def start_session
|
13
|
-
@user = User.find(params[:id])
|
14
|
-
cookies[:session_id] = @user.encrypted_password
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
File without changes
|
File without changes
|
File without changes
|