rollbar 0.10.1 → 0.10.2

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/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  .config
5
5
  .yardoc
6
6
  Gemfile.lock
7
+ gemfiles/*.lock
7
8
  InstalledFiles
8
9
  _yardoc
9
10
  coverage
data/.travis.yml CHANGED
@@ -18,3 +18,51 @@ matrix:
18
18
  - rvm: jruby-head
19
19
  - rvm: rbx-18mode
20
20
  - rvm: rbx-19mode
21
+ - gemfile: gemfiles/rails30.gemfile
22
+ - gemfile: gemfiles/rails40.gemfile
23
+ exclude:
24
+ - rvm: 1.8.7
25
+ gemfile: gemfiles/rails40.gemfile
26
+ - rvm: 1.9.2
27
+ gemfile: gemfiles/rails40.gemfile
28
+ - rvm: ruby-head
29
+ gemfile: gemfiles/rails30.gemfile
30
+ - rvm: ruby-head
31
+ gemfile: gemfiles/rails31.gemfile
32
+ - rvm: ruby-head
33
+ gemfile: gemfiles/rails40.gemfile
34
+ - rvm: jruby-18mode
35
+ gemfile: gemfiles/rails30.gemfile
36
+ - rvm: jruby-18mode
37
+ gemfile: gemfiles/rails31.gemfile
38
+ - rvm: jruby-18mode
39
+ gemfile: gemfiles/rails40.gemfile
40
+ - rvm: jruby-19mode
41
+ gemfile: gemfiles/rails30.gemfile
42
+ - rvm: jruby-19mode
43
+ gemfile: gemfiles/rails31.gemfile
44
+ - rvm: jruby-19mode
45
+ gemfile: gemfiles/rails40.gemfile
46
+ - rvm: jruby-head
47
+ gemfile: gemfiles/rails30.gemfile
48
+ - rvm: jruby-head
49
+ gemfile: gemfiles/rails31.gemfile
50
+ - rvm: jruby-head
51
+ gemfile: gemfiles/rails40.gemfile
52
+ - rvm: rbx-18mode
53
+ gemfile: gemfiles/rails30.gemfile
54
+ - rvm: rbx-18mode
55
+ gemfile: gemfiles/rails31.gemfile
56
+ - rvm: rbx-18mode
57
+ gemfile: gemfiles/rails40.gemfile
58
+ - rvm: rbx-19mode
59
+ gemfile: gemfiles/rails30.gemfile
60
+ - rvm: rbx-19mode
61
+ gemfile: gemfiles/rails31.gemfile
62
+ - rvm: rbx-19mode
63
+ gemfile: gemfiles/rails40.gemfile
64
+ gemfile:
65
+ - gemfiles/rails30.gemfile
66
+ - gemfiles/rails31.gemfile
67
+ - gemfiles/rails32.gemfile
68
+ - gemfiles/rails40.gemfile
data/Appraisals ADDED
@@ -0,0 +1,16 @@
1
+ appraise "rails30" do
2
+ gem "rails", "3.0.20"
3
+ end
4
+
5
+ appraise "rails31" do
6
+ gem "rails", "3.1.12"
7
+ end
8
+
9
+ appraise "rails32" do
10
+ gem "rails", "3.2.12"
11
+ end
12
+
13
+ appraise "rails40" do
14
+ gem "rails", "4.0.0.rc2"
15
+ gem "protected_attributes"
16
+ end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ **0.10.2*
4
+ - Require hooks at configuration time instead of gem load time
5
+
3
6
  **0.10.1**
4
7
  - Fix regression in 0.10.0 reporting exceptions in development environments and rails < 3.2 apps.
5
8
 
data/Gemfile CHANGED
@@ -6,3 +6,4 @@ gem 'sqlite3', :platform => [:ruby, :mswin, :mingw]
6
6
  gem 'jruby-openssl', :platform => :jruby
7
7
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
8
8
  gem 'girl_friday'
9
+ gem 'appraisal'
data/Rakefile CHANGED
@@ -1,14 +1,19 @@
1
1
  #!/usr/bin/env rake
2
+ require 'rubygems'
3
+ require 'bundler/setup'
2
4
  require 'bundler/gem_tasks'
3
5
  require 'rspec/core/rake_task'
6
+ require 'appraisal'
4
7
 
5
8
  RSpec::Core::RakeTask.new(:spec)
6
9
 
7
- namespace :dummy do
8
- load 'spec/dummyapp/Rakefile'
9
- end
10
-
11
10
  desc 'Run specs'
12
- task :default => ['dummy:db:setup'] do
11
+ task :default do
12
+ ENV['LOCAL'] = '1'
13
+ Rake::Task[:spec].invoke
14
+
15
+ Rake::Task[:spec].reenable
16
+
17
+ ENV['LOCAL'] = '0'
13
18
  Rake::Task[:spec].invoke
14
- end
19
+ end
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
6
+ gem "jruby-openssl", :platform=>:jruby
7
+ gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
8
+ gem "girl_friday"
9
+ gem "appraisal"
10
+ gem "rails", "3.0.20"
11
+
12
+ gemspec :path=>"../"
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
6
+ gem "jruby-openssl", :platform=>:jruby
7
+ gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
8
+ gem "girl_friday"
9
+ gem "appraisal"
10
+ gem "rails", "3.1.12"
11
+
12
+ gemspec :path=>"../"
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
6
+ gem "jruby-openssl", :platform=>:jruby
7
+ gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
8
+ gem "girl_friday"
9
+ gem "appraisal"
10
+ gem "rails", "3.2.12"
11
+
12
+ gemspec :path=>"../"
@@ -0,0 +1,13 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
6
+ gem "jruby-openssl", :platform=>:jruby
7
+ gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
8
+ gem "girl_friday"
9
+ gem "appraisal"
10
+ gem "rails", "4.0.0.rc2"
11
+ gem "protected_attributes"
12
+
13
+ gemspec :path=>"../"
data/lib/rollbar.rb CHANGED
@@ -12,14 +12,6 @@ require 'rollbar/configuration'
12
12
  require 'rollbar/request_data_extractor'
13
13
  require 'rollbar/exception_reporter'
14
14
 
15
- require 'rollbar/delayed_job' if defined?(Delayed) && defined?(Delayed::Plugins)
16
- require 'rollbar/sidekiq' if defined?(Sidekiq)
17
- require 'rollbar/goalie' if defined?(Goalie)
18
- require 'rollbar/rack' if defined?(Rack)
19
- require 'rollbar/rake' if defined?(Rake)
20
- require 'rollbar/railtie' if defined?(Rails)
21
- require 'rollbar/better_errors' if defined?(BetterErrors)
22
-
23
15
  module Rollbar
24
16
  class << self
25
17
  attr_writer :configuration
@@ -36,6 +28,8 @@ module Rollbar
36
28
  # config.access_token = 'abcdefg'
37
29
  # end
38
30
  def configure
31
+ require_hooks
32
+
39
33
  # if configuration.enabled has not been set yet (is still 'nil'), set to true.
40
34
  if configuration.enabled.nil?
41
35
  configuration.enabled = true
@@ -145,6 +139,16 @@ module Rollbar
145
139
  end
146
140
 
147
141
  private
142
+
143
+ def require_hooks()
144
+ require 'rollbar/delayed_job' if defined?(Delayed) && defined?(Delayed::Plugins)
145
+ require 'rollbar/sidekiq' if defined?(Sidekiq)
146
+ require 'rollbar/goalie' if defined?(Goalie)
147
+ require 'rollbar/rack' if defined?(Rack)
148
+ require 'rollbar/rake' if defined?(Rake)
149
+ require 'rollbar/railtie' if defined?(Rails)
150
+ require 'rollbar/better_errors' if defined?(BetterErrors)
151
+ end
148
152
 
149
153
  def log_instance_link(data)
150
154
  logger.info "[Rollbar] Details: #{configuration.web_base}/instance/uuid?uuid=#{data[:uuid]} (only available if report was successful)"
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "0.10.1"
2
+ VERSION = "0.10.2"
3
3
  end
data/rollbar.gemspec CHANGED
@@ -16,8 +16,7 @@ Gem::Specification.new do |gem|
16
16
 
17
17
  gem.add_runtime_dependency 'multi_json', '~> 1.5'
18
18
 
19
- gem.add_development_dependency 'rails', '~> 3.2.12'
20
- gem.add_development_dependency 'devise', '>= 2.1.2'
19
+ gem.add_development_dependency 'rails', '>= 3.0.0'
21
20
  gem.add_development_dependency 'rspec-rails', '~> 2.12.0'
22
21
  gem.add_development_dependency 'database_cleaner', '>= 0.9.1'
23
22
  gem.add_development_dependency 'girl_friday', '>= 0.11.1'
@@ -28,7 +28,7 @@ describe HomeController do
28
28
  end
29
29
  end
30
30
 
31
- context "rollbar controller methods" do
31
+ context "rollbar controller methods with %s requests" % (local? ? 'local' : 'non-local') do
32
32
  # TODO run these for a a more-real request
33
33
  it "should build valid request data" do
34
34
  data = @controller.rollbar_request_data
@@ -170,8 +170,8 @@ describe HomeController do
170
170
  end
171
171
 
172
172
  describe "GET 'index'" do
173
- it "should be successful and report a message" do
174
- logger_mock.should_receive(:info).with('[Rollbar] Success')
173
+ it "should be successful and report two messages" do
174
+ logger_mock.should_receive(:info).with('[Rollbar] Success').twice
175
175
  get 'index'
176
176
  response.should be_success
177
177
  end
@@ -179,7 +179,7 @@ describe HomeController do
179
179
 
180
180
  describe "'report_exception'", :type => "request" do
181
181
  it "should raise a NameError and report an exception after a GET" do
182
- logger_mock.should_receive(:info).with('[Rollbar] Success')
182
+ logger_mock.should_receive(:info).with('[Rollbar] Success').once
183
183
 
184
184
  get 'report_exception'
185
185
  response.should be_success
@@ -204,6 +204,30 @@ describe HomeController do
204
204
  Rollbar.last_report[:request][:params]['jsonparam'].should == 'jsonval'
205
205
  end
206
206
  end
207
+
208
+ describe "'cause_exception'", :type => "request" do
209
+ it "should raise an uncaught exception and report a message" do
210
+ logger_mock.should_receive(:info).with('[Rollbar] Success').once
211
+
212
+ expect { get 'cause_exception' }.to raise_exception
213
+ end
214
+
215
+ context 'show_exceptions' do
216
+ before(:each) do
217
+ Dummy::Application.env_config['action_dispatch.show_exceptions'] = true
218
+ end
219
+
220
+ after(:each) do
221
+ Dummy::Application.env_config['action_dispatch.show_exceptions'] = false
222
+ end
223
+
224
+ it "middleware should catch the exception and only report to rollbar once" do
225
+ logger_mock.should_receive(:info).with('[Rollbar] Success').once
226
+
227
+ get 'cause_exception'
228
+ end
229
+ end
230
+ end
207
231
 
208
232
  after(:each) do
209
233
  Rollbar.configure do |config|
@@ -1,10 +1,4 @@
1
1
  class User < ActiveRecord::Base
2
- # Include default devise modules. Others available are:
3
- # :token_authenticatable, :confirmable,
4
- # :lockable, :timeoutable and :omniauthable
5
- devise :database_authenticatable, :registerable,
6
- :recoverable, :rememberable, :trackable, :validatable
7
-
8
2
  # Setup accessible (or protected) attributes for your model
9
3
  attr_accessible :name, :email, :password, :password_confirmation, :remember_me
10
4
  end
@@ -4,7 +4,6 @@ require "rails/all"
4
4
 
5
5
  Bundler.require
6
6
  require "rollbar"
7
- require "devise"
8
7
 
9
8
  module Dummy
10
9
  class Application < Rails::Application
@@ -48,13 +47,13 @@ module Dummy
48
47
  # This will create an empty whitelist of attributes available for mass-assignment for all models
49
48
  # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
50
49
  # parameters by using an attr_accessible or attr_protected declaration.
51
- config.active_record.whitelist_attributes = true
50
+ #config.active_record.whitelist_attributes = true
52
51
 
53
52
  # Enable the asset pipeline
54
- config.assets.enabled = true
53
+ #config.assets.enabled = true
55
54
 
56
55
  # Version of your assets, change this if you want to expire all your assets
57
- config.assets.version = '1.0'
56
+ #config.assets.version = '1.0'
58
57
  end
59
58
  end
60
59
 
@@ -23,15 +23,15 @@ Dummy::Application.configure do
23
23
  config.action_dispatch.best_standards_support = :builtin
24
24
 
25
25
  # Raise exception on mass assignment protection for Active Record models
26
- config.active_record.mass_assignment_sanitizer = :strict
26
+ #config.active_record.mass_assignment_sanitizer = :strict
27
27
 
28
28
  # Log the query plan for queries taking more than this (works
29
29
  # with SQLite, MySQL, and PostgreSQL)
30
- config.active_record.auto_explain_threshold_in_seconds = 0.5
30
+ #config.active_record.auto_explain_threshold_in_seconds = 0.5
31
31
 
32
32
  # Do not compress assets
33
- config.assets.compress = false
33
+ #config.assets.compress = false
34
34
 
35
35
  # Expands the lines which load the assets
36
- config.assets.debug = true
36
+ #config.assets.debug = true
37
37
  end
@@ -15,7 +15,7 @@ Dummy::Application.configure do
15
15
  config.whiny_nils = true
16
16
 
17
17
  # Show full error reports and disable caching
18
- config.consider_all_requests_local = true
18
+ config.consider_all_requests_local = ENV['LOCAL'] == '1'
19
19
  config.action_controller.perform_caching = false
20
20
 
21
21
  # Raise exceptions instead of rendering exception templates
@@ -30,7 +30,7 @@ Dummy::Application.configure do
30
30
  config.action_mailer.delivery_method = :test
31
31
 
32
32
  # Raise exception on mass assignment protection for Active Record models
33
- config.active_record.mass_assignment_sanitizer = :strict
33
+ #config.active_record.mass_assignment_sanitizer = :strict
34
34
 
35
35
  # Print deprecation notices to the stderr
36
36
  config.active_support.deprecation = :stderr
@@ -5,7 +5,9 @@
5
5
 
6
6
  # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
7
  ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters :format => [:json]
8
+ if defined?(wrap_parameters)
9
+ wrap_parameters :format => [:json]
10
+ end
9
11
  end
10
12
 
11
13
  # Disable root element in JSON by default.
@@ -1,14 +1,10 @@
1
1
  Dummy::Application.routes.draw do
2
- authenticated :user do
3
- root :to => 'home#index'
4
- end
5
2
  root :to => "home#index"
6
- devise_for :users
7
3
  resources :users do
8
4
  member { post :start_session }
9
5
  end
10
6
 
11
- match "/cause_exception" => "home#cause_exception"
12
- match "/report_exception" => "home#report_exception"
13
- match "/current_user" => "home#current_user"
7
+ get "/cause_exception" => "home#cause_exception"
8
+ match "/report_exception" => "home#report_exception", :via=> [:get, :put, :post]
9
+ get "/current_user" => "home#current_user"
14
10
  end
@@ -6,7 +6,7 @@
6
6
  # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
7
  # Mayor.create(name: 'Emanuel', city: cities.first)
8
8
  puts 'SETTING UP DEFAULT USER LOGIN'
9
- user = User.create! :name => 'First User', :email => 'user@example.com', :password => 'please', :password_confirmation => 'please'
9
+ user = User.create! :name => 'First User', :email => 'user@example.com'
10
10
  puts 'New user created: ' << user.name
11
- user2 = User.create! :name => 'Second User', :email => 'user2@example.com', :password => 'please', :password_confirmation => 'please'
11
+ user2 = User.create! :name => 'Second User', :email => 'user2@example.com'
12
12
  puts 'New user created: ' << user2.name
data/spec/rollbar_spec.rb CHANGED
@@ -207,15 +207,15 @@ describe Rollbar do
207
207
 
208
208
  it 'should send the payload over the network by default' do
209
209
  logger_mock.should_not_receive(:info).with('[Rollbar] Writing payload to file')
210
- logger_mock.should_receive(:info).with('[Rollbar] Sending payload')
211
- logger_mock.should_receive(:info).with('[Rollbar] Success')
210
+ logger_mock.should_receive(:info).with('[Rollbar] Sending payload').once
211
+ logger_mock.should_receive(:info).with('[Rollbar] Success').once
212
212
  Rollbar.report_exception(@exception)
213
213
  end
214
214
 
215
215
  it 'should save the payload to a file if set' do
216
216
  logger_mock.should_not_receive(:info).with('[Rollbar] Sending payload')
217
- logger_mock.should_receive(:info).with('[Rollbar] Writing payload to file')
218
- logger_mock.should_receive(:info).with('[Rollbar] Success')
217
+ logger_mock.should_receive(:info).with('[Rollbar] Writing payload to file').once
218
+ logger_mock.should_receive(:info).with('[Rollbar] Success').once
219
219
 
220
220
  filepath = ''
221
221
 
data/spec/spec_helper.rb CHANGED
@@ -6,6 +6,12 @@ require 'rspec/rails'
6
6
  require 'database_cleaner'
7
7
  require 'genspec'
8
8
 
9
+ namespace :dummy do
10
+ load 'spec/dummyapp/Rakefile'
11
+ end
12
+
13
+ Rake::Task['dummy:db:setup'].invoke
14
+
9
15
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
10
16
 
11
17
  RSpec.configure do |config|
@@ -27,10 +33,13 @@ RSpec.configure do |config|
27
33
  config.after(:each) do
28
34
  DatabaseCleaner.clean
29
35
  end
30
-
31
36
  end
32
37
 
33
38
  def reset_configuration
34
39
  Rollbar.reconfigure do |config|
35
40
  end
36
41
  end
42
+
43
+ def local?
44
+ ENV['LOCAL'] == '1'
45
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-19 00:00:00.000000000 Z
12
+ date: 2013-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -29,28 +29,12 @@ dependencies:
29
29
  version: '1.5'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rails
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: 3.2.12
38
- type: :development
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: 3.2.12
46
- - !ruby/object:Gem::Dependency
47
- name: devise
48
32
  requirement: !ruby/object:Gem::Requirement
49
33
  none: false
50
34
  requirements:
51
35
  - - ! '>='
52
36
  - !ruby/object:Gem::Version
53
- version: 2.1.2
37
+ version: 3.0.0
54
38
  type: :development
55
39
  prerelease: false
56
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +42,7 @@ dependencies:
58
42
  requirements:
59
43
  - - ! '>='
60
44
  - !ruby/object:Gem::Version
61
- version: 2.1.2
45
+ version: 3.0.0
62
46
  - !ruby/object:Gem::Dependency
63
47
  name: rspec-rails
64
48
  requirement: !ruby/object:Gem::Requirement
@@ -132,6 +116,7 @@ extra_rdoc_files: []
132
116
  files:
133
117
  - .gitignore
134
118
  - .travis.yml
119
+ - Appraisals
135
120
  - CHANGELOG.md
136
121
  - Gemfile
137
122
  - LICENSE
@@ -139,6 +124,10 @@ files:
139
124
  - Rakefile
140
125
  - THANKS.md
141
126
  - UPGRADE_FROM_RATCHET.md
127
+ - gemfiles/rails30.gemfile
128
+ - gemfiles/rails31.gemfile
129
+ - gemfiles/rails32.gemfile
130
+ - gemfiles/rails40.gemfile
142
131
  - lib/generators/rollbar/rollbar_generator.rb
143
132
  - lib/generators/rollbar/templates/initializer.rb
144
133
  - lib/rollbar.rb
@@ -193,7 +182,6 @@ files:
193
182
  - spec/dummyapp/config/environments/production.rb
194
183
  - spec/dummyapp/config/environments/test.rb
195
184
  - spec/dummyapp/config/initializers/backtrace_silencers.rb
196
- - spec/dummyapp/config/initializers/devise.rb
197
185
  - spec/dummyapp/config/initializers/inflections.rb
198
186
  - spec/dummyapp/config/initializers/mime_types.rb
199
187
  - spec/dummyapp/config/initializers/rollbar.rb
@@ -217,7 +205,6 @@ files:
217
205
  - spec/requests/home_spec.rb
218
206
  - spec/rollbar_spec.rb
219
207
  - spec/spec_helper.rb
220
- - spec/support/devise.rb
221
208
  homepage: https://github.com/rollbar/rollbar-gem
222
209
  licenses: []
223
210
  post_install_message:
@@ -275,7 +262,6 @@ test_files:
275
262
  - spec/dummyapp/config/environments/production.rb
276
263
  - spec/dummyapp/config/environments/test.rb
277
264
  - spec/dummyapp/config/initializers/backtrace_silencers.rb
278
- - spec/dummyapp/config/initializers/devise.rb
279
265
  - spec/dummyapp/config/initializers/inflections.rb
280
266
  - spec/dummyapp/config/initializers/mime_types.rb
281
267
  - spec/dummyapp/config/initializers/rollbar.rb
@@ -299,5 +285,4 @@ test_files:
299
285
  - spec/requests/home_spec.rb
300
286
  - spec/rollbar_spec.rb
301
287
  - spec/spec_helper.rb
302
- - spec/support/devise.rb
303
288
  has_rdoc:
@@ -1,233 +0,0 @@
1
- require 'devise'
2
- # Use this hook to configure devise mailer, warden hooks and so forth.
3
- # Many of these configuration options can be set straight in your model.
4
- Devise.setup do |config|
5
- # ==> Mailer Configuration
6
- # Configure the e-mail address which will be shown in Devise::Mailer,
7
- # note that it will be overwritten if you use your own mailer class with default "from" parameter.
8
- config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
9
-
10
- # Configure the class responsible to send e-mails.
11
- # config.mailer = "Devise::Mailer"
12
-
13
- # ==> ORM configuration
14
- # Load and configure the ORM. Supports :active_record (default) and
15
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
16
- # available as additional gems.
17
- require 'devise/orm/active_record'
18
-
19
- # ==> Configuration for any authentication mechanism
20
- # Configure which keys are used when authenticating a user. The default is
21
- # just :email. You can configure it to use [:username, :subdomain], so for
22
- # authenticating a user, both parameters are required. Remember that those
23
- # parameters are used only when authenticating and not when retrieving from
24
- # session. If you need permissions, you should implement that in a before filter.
25
- # You can also supply a hash where the value is a boolean determining whether
26
- # or not authentication should be aborted when the value is not present.
27
- # config.authentication_keys = [ :email ]
28
-
29
- # Configure parameters from the request object used for authentication. Each entry
30
- # given should be a request method and it will automatically be passed to the
31
- # find_for_authentication method and considered in your model lookup. For instance,
32
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
33
- # The same considerations mentioned for authentication_keys also apply to request_keys.
34
- # config.request_keys = []
35
-
36
- # Configure which authentication keys should be case-insensitive.
37
- # These keys will be downcased upon creating or modifying a user and when used
38
- # to authenticate or find a user. Default is :email.
39
- config.case_insensitive_keys = [ :email ]
40
-
41
- # Configure which authentication keys should have whitespace stripped.
42
- # These keys will have whitespace before and after removed upon creating or
43
- # modifying a user and when used to authenticate or find a user. Default is :email.
44
- config.strip_whitespace_keys = [ :email ]
45
-
46
- # Tell if authentication through request.params is enabled. True by default.
47
- # It can be set to an array that will enable params authentication only for the
48
- # given strategies, for example, `config.params_authenticatable = [:database]` will
49
- # enable it only for database (email + password) authentication.
50
- # config.params_authenticatable = true
51
-
52
- # Tell if authentication through HTTP Basic Auth is enabled. False by default.
53
- # It can be set to an array that will enable http authentication only for the
54
- # given strategies, for example, `config.http_authenticatable = [:token]` will
55
- # enable it only for token authentication.
56
- # config.http_authenticatable = false
57
-
58
- # If http headers should be returned for AJAX requests. True by default.
59
- # config.http_authenticatable_on_xhr = true
60
-
61
- # The realm used in Http Basic Authentication. "Application" by default.
62
- # config.http_authentication_realm = "Application"
63
-
64
- # It will change confirmation, password recovery and other workflows
65
- # to behave the same regardless if the e-mail provided was right or wrong.
66
- # Does not affect registerable.
67
- # config.paranoid = true
68
-
69
- # By default Devise will store the user in session. You can skip storage for
70
- # :http_auth and :token_auth by adding those symbols to the array below.
71
- # Notice that if you are skipping storage for all authentication paths, you
72
- # may want to disable generating routes to Devise's sessions controller by
73
- # passing :skip => :sessions to `devise_for` in your config/routes.rb
74
- config.skip_session_storage = [:http_auth]
75
-
76
- # ==> Configuration for :database_authenticatable
77
- # For bcrypt, this is the cost for hashing the password and defaults to 10. If
78
- # using other encryptors, it sets how many times you want the password re-encrypted.
79
- #
80
- # Limiting the stretches to just one in testing will increase the performance of
81
- # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
82
- # a value less than 10 in other environments.
83
- config.stretches = Rails.env.test? ? 1 : 10
84
-
85
- # Setup a pepper to generate the encrypted password.
86
- # config.pepper = "59ac5dfd254187301c43390ebd59150ab9e28a26bfe528ac69fcecd7ae176495d2193ff797d41228f3f95dceb439ea5e972ae8e017109f7c8dd9a262787d95ff"
87
-
88
- # ==> Configuration for :confirmable
89
- # A period that the user is allowed to access the website even without
90
- # confirming his account. For instance, if set to 2.days, the user will be
91
- # able to access the website for two days without confirming his account,
92
- # access will be blocked just in the third day. Default is 0.days, meaning
93
- # the user cannot access the website without confirming his account.
94
- # config.allow_unconfirmed_access_for = 2.days
95
-
96
- # If true, requires any email changes to be confirmed (exactly the same way as
97
- # initial account confirmation) to be applied. Requires additional unconfirmed_email
98
- # db field (see migrations). Until confirmed new email is stored in
99
- # unconfirmed email column, and copied to email column on successful confirmation.
100
- config.reconfirmable = true
101
-
102
- # Defines which key will be used when confirming an account
103
- # config.confirmation_keys = [ :email ]
104
-
105
- # ==> Configuration for :rememberable
106
- # The time the user will be remembered without asking for credentials again.
107
- # config.remember_for = 2.weeks
108
-
109
- # If true, extends the user's remember period when remembered via cookie.
110
- # config.extend_remember_period = false
111
-
112
- # Options to be passed to the created cookie. For instance, you can set
113
- # :secure => true in order to force SSL only cookies.
114
- # config.rememberable_options = {}
115
-
116
- # ==> Configuration for :validatable
117
- # Range for password length. Default is 6..128.
118
- # config.password_length = 6..128
119
-
120
- # Email regex used to validate email formats. It simply asserts that
121
- # an one (and only one) @ exists in the given string. This is mainly
122
- # to give user feedback and not to assert the e-mail validity.
123
- # config.email_regexp = /\A[^@]+@[^@]+\z/
124
-
125
- # ==> Configuration for :timeoutable
126
- # The time you want to timeout the user session without activity. After this
127
- # time the user will be asked for credentials again. Default is 30 minutes.
128
- # config.timeout_in = 30.minutes
129
-
130
- # If true, expires auth token on session timeout.
131
- # config.expire_auth_token_on_timeout = false
132
-
133
- # ==> Configuration for :lockable
134
- # Defines which strategy will be used to lock an account.
135
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
136
- # :none = No lock strategy. You should handle locking by yourself.
137
- # config.lock_strategy = :failed_attempts
138
-
139
- # Defines which key will be used when locking and unlocking an account
140
- # config.unlock_keys = [ :email ]
141
-
142
- # Defines which strategy will be used to unlock an account.
143
- # :email = Sends an unlock link to the user email
144
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
145
- # :both = Enables both strategies
146
- # :none = No unlock strategy. You should handle unlocking by yourself.
147
- # config.unlock_strategy = :both
148
-
149
- # Number of authentication tries before locking an account if lock_strategy
150
- # is failed attempts.
151
- # config.maximum_attempts = 20
152
-
153
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
154
- # config.unlock_in = 1.hour
155
-
156
- # ==> Configuration for :recoverable
157
- #
158
- # Defines which key will be used when recovering the password for an account
159
- # config.reset_password_keys = [ :email ]
160
-
161
- # Time interval you can reset your password with a reset password key.
162
- # Don't put a too small interval or your users won't have the time to
163
- # change their passwords.
164
- config.reset_password_within = 6.hours
165
-
166
- # ==> Configuration for :encryptable
167
- # Allow you to use another encryption algorithm besides bcrypt (default). You can use
168
- # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
169
- # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
170
- # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
171
- # REST_AUTH_SITE_KEY to pepper)
172
- # config.encryptor = :sha512
173
-
174
- # ==> Configuration for :token_authenticatable
175
- # Defines name of the authentication token params key
176
- # config.token_authentication_key = :auth_token
177
-
178
- # ==> Scopes configuration
179
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
180
- # "users/sessions/new". It's turned off by default because it's slower if you
181
- # are using only default views.
182
- # config.scoped_views = false
183
-
184
- # Configure the default scope given to Warden. By default it's the first
185
- # devise role declared in your routes (usually :user).
186
- # config.default_scope = :user
187
-
188
- # Set this configuration to false if you want /users/sign_out to sign out
189
- # only the current scope. By default, Devise signs out all scopes.
190
- # config.sign_out_all_scopes = true
191
-
192
- # ==> Navigation configuration
193
- # Lists the formats that should be treated as navigational. Formats like
194
- # :html, should redirect to the sign in page when the user does not have
195
- # access, but formats like :xml or :json, should return 401.
196
- #
197
- # If you have any extra navigational formats, like :iphone or :mobile, you
198
- # should add them to the navigational formats lists.
199
- #
200
- # The "*/*" below is required to match Internet Explorer requests.
201
- # config.navigational_formats = ["*/*", :html]
202
-
203
- # The default HTTP method used to sign out a resource. Default is :delete.
204
- config.sign_out_via = Rails.env.test? ? :get : :delete
205
-
206
- # ==> OmniAuth
207
- # Add a new OmniAuth provider. Check the wiki for more information on setting
208
- # up on your models and hooks.
209
- # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
210
-
211
- # ==> Warden configuration
212
- # If you want to use other strategies, that are not supported by Devise, or
213
- # change the failure app, you can configure them inside the config.warden block.
214
- #
215
- # config.warden do |manager|
216
- # manager.intercept_401 = false
217
- # manager.default_strategies(:scope => :user).unshift :some_external_strategy
218
- # end
219
-
220
- # ==> Mountable engine configurations
221
- # When using Devise inside an engine, let's call it `MyEngine`, and this engine
222
- # is mountable, there are some extra configurations to be taken into account.
223
- # The following options are available, assuming the engine is mounted as:
224
- #
225
- # mount MyEngine, at: "/my_engine"
226
- #
227
- # The router that invoked `devise_for`, in the example above, would be:
228
- # config.router_name = :my_engine
229
- #
230
- # When using omniauth, Devise cannot automatically set Omniauth path,
231
- # so you need to do it manually. For the users scope, it would be:
232
- # config.omniauth_path_prefix = "/my_engine/users/auth"
233
- end
@@ -1,3 +0,0 @@
1
- RSpec.configure do |config|
2
- config.include Devise::TestHelpers, :type => :controller
3
- end