clearance 1.4.3 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of clearance might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d79da2d88bfa6ddc89089705872fbf1ece5c42c2
4
- data.tar.gz: f5e422a542e1eaed19c721c15a01ad1920c29938
3
+ metadata.gz: f85367efa274a98517142e37d7f085d3430ac2bb
4
+ data.tar.gz: 40dc373ed481f3bceb2aabd704e333bde139be4c
5
5
  SHA512:
6
- metadata.gz: 6d478f0fc99a8dd5b72243fc0c18ba095fc38ecee3e5fdd58e38e4c7cbe4967a4064475da06c8c53b11ea0e0bd5e3432baf00909a81e4c206d29e89931100bcc
7
- data.tar.gz: 486865b87a276387bfa4bdc5d823a14ada721291d4a79433d5a02e355aabb4b414f45583101696152f7964a8e2c0a69561a162fa49fc1b384c6ffd4617b06670
6
+ metadata.gz: 95e458a45dd3fd6610d951d29ff98e755dc810ed38f680804648852701deaf986639e945a43f5f63d0f080461050063628764ca4c07d65617f539977dcfe1b94
7
+ data.tar.gz: 29d9b4ac5c96112fa1778f1481ee33faa03b4dde6d5fe92bb81c2e67391c613cbaaf690db55d250b223d989f392cd894e8daa7eaf7d55b3a2835f1142d008e68
data/Gemfile CHANGED
@@ -6,11 +6,12 @@ gem 'appraisal', '~> 1.0'
6
6
  gem 'aruba', '~> 0.5'
7
7
  gem 'bourne', '~> 1.4'
8
8
  gem 'bundler', '~> 1.3'
9
- gem 'capybara', '~> 2.0.3'
9
+ gem 'capybara', '~> 2.2.0'
10
10
  gem 'cucumber-rails', '~> 1.3', require: false
11
11
  gem 'database_cleaner', '~> 1.0'
12
12
  gem 'factory_girl_rails', '~> 4.2'
13
- gem 'rspec-rails', '~> 2.13'
13
+ gem 'rspec-rails'
14
14
  gem 'shoulda-matchers', '~> 2.4'
15
15
  gem 'sqlite3', '~> 1.3'
16
16
  gem 'timecop', '~> 0.6'
17
+ gem 'rspec', '~> 2.14'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clearance (1.4.3)
4
+ clearance (1.5.0)
5
5
  bcrypt
6
6
  email_validator (~> 1.4)
7
7
  rails (>= 3.1)
@@ -9,151 +9,155 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionmailer (4.0.2)
13
- actionpack (= 4.0.2)
12
+ actionmailer (4.1.5)
13
+ actionpack (= 4.1.5)
14
+ actionview (= 4.1.5)
14
15
  mail (~> 2.5.4)
15
- actionpack (4.0.2)
16
- activesupport (= 4.0.2)
17
- builder (~> 3.1.0)
18
- erubis (~> 2.7.0)
16
+ actionpack (4.1.5)
17
+ actionview (= 4.1.5)
18
+ activesupport (= 4.1.5)
19
19
  rack (~> 1.5.2)
20
20
  rack-test (~> 0.6.2)
21
- activemodel (4.0.2)
22
- activesupport (= 4.0.2)
23
- builder (~> 3.1.0)
24
- activerecord (4.0.2)
25
- activemodel (= 4.0.2)
26
- activerecord-deprecated_finders (~> 1.0.2)
27
- activesupport (= 4.0.2)
28
- arel (~> 4.0.0)
29
- activerecord-deprecated_finders (1.0.3)
30
- activesupport (4.0.2)
31
- i18n (~> 0.6, >= 0.6.4)
32
- minitest (~> 4.2)
33
- multi_json (~> 1.3)
21
+ actionview (4.1.5)
22
+ activesupport (= 4.1.5)
23
+ builder (~> 3.1)
24
+ erubis (~> 2.7.0)
25
+ activemodel (4.1.5)
26
+ activesupport (= 4.1.5)
27
+ builder (~> 3.1)
28
+ activerecord (4.1.5)
29
+ activemodel (= 4.1.5)
30
+ activesupport (= 4.1.5)
31
+ arel (~> 5.0.0)
32
+ activesupport (4.1.5)
33
+ i18n (~> 0.6, >= 0.6.9)
34
+ json (~> 1.7, >= 1.7.7)
35
+ minitest (~> 5.1)
34
36
  thread_safe (~> 0.1)
35
- tzinfo (~> 0.3.37)
37
+ tzinfo (~> 1.1)
36
38
  appraisal (1.0.0)
37
39
  bundler
38
40
  rake
39
41
  thor (>= 0.14.0)
40
- arel (4.0.1)
41
- aruba (0.5.4)
42
+ arel (5.0.1.20140414130214)
43
+ aruba (0.6.1)
42
44
  childprocess (>= 0.3.6)
43
45
  cucumber (>= 1.1.1)
44
46
  rspec-expectations (>= 2.7.0)
45
- atomic (1.1.14)
46
47
  bcrypt (3.1.7)
47
48
  bourne (1.5.0)
48
49
  mocha (>= 0.13.2, < 0.15)
49
- builder (3.1.4)
50
- capybara (2.0.3)
50
+ builder (3.2.2)
51
+ capybara (2.2.1)
51
52
  mime-types (>= 1.16)
52
53
  nokogiri (>= 1.3.3)
53
54
  rack (>= 1.0.0)
54
55
  rack-test (>= 0.5.4)
55
- selenium-webdriver (~> 2.0)
56
- xpath (~> 1.0.0)
57
- childprocess (0.4.0)
56
+ xpath (~> 2.0)
57
+ childprocess (0.5.3)
58
58
  ffi (~> 1.0, >= 1.0.11)
59
- cucumber (1.3.10)
59
+ cucumber (1.3.16)
60
60
  builder (>= 2.1.2)
61
61
  diff-lcs (>= 1.1.3)
62
62
  gherkin (~> 2.12)
63
63
  multi_json (>= 1.7.5, < 2.0)
64
- multi_test (>= 0.0.2)
65
- cucumber-rails (1.4.0)
66
- capybara (>= 1.1.2)
67
- cucumber (>= 1.2.0)
68
- nokogiri (>= 1.5.0)
69
- rails (>= 3.0.0)
70
- database_cleaner (1.2.0)
64
+ multi_test (>= 0.1.1)
65
+ cucumber-rails (1.4.1)
66
+ capybara (>= 1.1.2, < 3)
67
+ cucumber (>= 1.3.8, < 2)
68
+ mime-types (~> 1.16)
69
+ nokogiri (~> 1.5)
70
+ rails (>= 3, < 5)
71
+ database_cleaner (1.3.0)
71
72
  diff-lcs (1.2.5)
72
73
  email_validator (1.4.0)
73
74
  activemodel
74
75
  erubis (2.7.0)
75
- factory_girl (4.3.0)
76
+ factory_girl (4.4.0)
76
77
  activesupport (>= 3.0.0)
77
- factory_girl_rails (4.3.0)
78
- factory_girl (~> 4.3.0)
78
+ factory_girl_rails (4.4.1)
79
+ factory_girl (~> 4.4.0)
79
80
  railties (>= 3.0.0)
80
81
  ffi (1.9.3)
81
82
  gherkin (2.12.2)
82
83
  multi_json (~> 1.3)
83
84
  hike (1.2.3)
84
- i18n (0.6.9)
85
+ i18n (0.6.11)
86
+ json (1.8.1)
85
87
  mail (2.5.4)
86
88
  mime-types (~> 1.16)
87
89
  treetop (~> 1.4.8)
88
- metaclass (0.0.2)
90
+ metaclass (0.0.4)
89
91
  mime-types (1.25.1)
90
- mini_portile (0.5.2)
91
- minitest (4.7.5)
92
+ mini_portile (0.6.0)
93
+ minitest (5.4.0)
92
94
  mocha (0.14.0)
93
95
  metaclass (~> 0.0.1)
94
- multi_json (1.8.4)
95
- multi_test (0.0.3)
96
- nokogiri (1.6.1)
97
- mini_portile (~> 0.5.0)
98
- polyglot (0.3.4)
96
+ multi_json (1.10.1)
97
+ multi_test (0.1.1)
98
+ nokogiri (1.6.3.1)
99
+ mini_portile (= 0.6.0)
100
+ polyglot (0.3.5)
99
101
  rack (1.5.2)
100
102
  rack-test (0.6.2)
101
103
  rack (>= 1.0)
102
- rails (4.0.2)
103
- actionmailer (= 4.0.2)
104
- actionpack (= 4.0.2)
105
- activerecord (= 4.0.2)
106
- activesupport (= 4.0.2)
104
+ rails (4.1.5)
105
+ actionmailer (= 4.1.5)
106
+ actionpack (= 4.1.5)
107
+ actionview (= 4.1.5)
108
+ activemodel (= 4.1.5)
109
+ activerecord (= 4.1.5)
110
+ activesupport (= 4.1.5)
107
111
  bundler (>= 1.3.0, < 2.0)
108
- railties (= 4.0.2)
109
- sprockets-rails (~> 2.0.0)
110
- railties (4.0.2)
111
- actionpack (= 4.0.2)
112
- activesupport (= 4.0.2)
112
+ railties (= 4.1.5)
113
+ sprockets-rails (~> 2.0)
114
+ railties (4.1.5)
115
+ actionpack (= 4.1.5)
116
+ activesupport (= 4.1.5)
113
117
  rake (>= 0.8.7)
114
118
  thor (>= 0.18.1, < 2.0)
115
- rake (10.2.2)
116
- rspec-core (2.14.7)
117
- rspec-expectations (2.14.4)
119
+ rake (10.3.2)
120
+ rspec (2.99.0)
121
+ rspec-core (~> 2.99.0)
122
+ rspec-expectations (~> 2.99.0)
123
+ rspec-mocks (~> 2.99.0)
124
+ rspec-collection_matchers (1.0.0)
125
+ rspec-expectations (>= 2.99.0.beta1)
126
+ rspec-core (2.99.2)
127
+ rspec-expectations (2.99.2)
118
128
  diff-lcs (>= 1.1.3, < 2.0)
119
- rspec-mocks (2.14.4)
120
- rspec-rails (2.14.1)
129
+ rspec-mocks (2.99.2)
130
+ rspec-rails (2.99.0)
121
131
  actionpack (>= 3.0)
122
132
  activemodel (>= 3.0)
123
133
  activesupport (>= 3.0)
124
134
  railties (>= 3.0)
125
- rspec-core (~> 2.14.0)
126
- rspec-expectations (~> 2.14.0)
127
- rspec-mocks (~> 2.14.0)
128
- rubyzip (1.1.0)
129
- selenium-webdriver (2.39.0)
130
- childprocess (>= 0.2.5)
131
- multi_json (~> 1.0)
132
- rubyzip (~> 1.0)
133
- websocket (~> 1.0.4)
134
- shoulda-matchers (2.5.0)
135
+ rspec-collection_matchers
136
+ rspec-core (~> 2.99.0)
137
+ rspec-expectations (~> 2.99.0)
138
+ rspec-mocks (~> 2.99.0)
139
+ shoulda-matchers (2.6.2)
135
140
  activesupport (>= 3.0.0)
136
- sprockets (2.10.1)
141
+ sprockets (2.12.1)
137
142
  hike (~> 1.2)
138
143
  multi_json (~> 1.0)
139
144
  rack (~> 1.0)
140
145
  tilt (~> 1.1, != 1.3.0)
141
- sprockets-rails (2.0.1)
146
+ sprockets-rails (2.1.3)
142
147
  actionpack (>= 3.0)
143
148
  activesupport (>= 3.0)
144
149
  sprockets (~> 2.8)
145
- sqlite3 (1.3.8)
146
- thor (0.18.1)
147
- thread_safe (0.1.3)
148
- atomic
150
+ sqlite3 (1.3.9)
151
+ thor (0.19.1)
152
+ thread_safe (0.3.4)
149
153
  tilt (1.4.1)
150
154
  timecop (0.7.1)
151
155
  treetop (1.4.15)
152
156
  polyglot
153
157
  polyglot (>= 0.3.1)
154
- tzinfo (0.3.38)
155
- websocket (1.0.7)
156
- xpath (1.0.0)
158
+ tzinfo (1.2.2)
159
+ thread_safe (~> 0.1)
160
+ xpath (2.0.0)
157
161
  nokogiri (~> 1.3)
158
162
 
159
163
  PLATFORMS
@@ -164,12 +168,13 @@ DEPENDENCIES
164
168
  aruba (~> 0.5)
165
169
  bourne (~> 1.4)
166
170
  bundler (~> 1.3)
167
- capybara (~> 2.0.3)
171
+ capybara (~> 2.2.0)
168
172
  clearance!
169
173
  cucumber-rails (~> 1.3)
170
174
  database_cleaner (~> 1.0)
171
175
  factory_girl_rails (~> 4.2)
172
- rspec-rails (~> 2.13)
176
+ rspec (~> 2.14)
177
+ rspec-rails
173
178
  shoulda-matchers (~> 2.4)
174
179
  sqlite3 (~> 1.3)
175
180
  timecop (~> 0.6)
data/NEWS.md CHANGED
@@ -1,5 +1,10 @@
1
1
  Thank you to all the [contributors](https://github.com/thoughtbot/clearance/graphs/contributors)!
2
2
 
3
+ New for 1.5.0 (October 17, 2014)
4
+ * Disable clearance routes by setting `config.routes = false`.
5
+ * Running `rails generate clearance:routes` will dump the default set of
6
+ routes to your application's routes file for modification.
7
+
3
8
  New for 1.4.3 (October 3, 2014)
4
9
  * Routing constraints act appropriately when session data is missing.
5
10
 
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  Clearance
2
2
  =========
3
3
 
4
- [![Build Status](https://secure.travis-ci.org/thoughtbot/clearance.png)](http://travis-ci.org/thoughtbot/clearance?branch=master)
5
- [![Code Climate](https://codeclimate.com/github/thoughtbot/clearance.png)](https://codeclimate.com/github/thoughtbot/clearance)
4
+ [![Build Status](https://secure.travis-ci.org/thoughtbot/clearance.svg)](http://travis-ci.org/thoughtbot/clearance?branch=master)
5
+ [![Code Climate](https://codeclimate.com/github/thoughtbot/clearance.svg)](https://codeclimate.com/github/thoughtbot/clearance)
6
6
 
7
7
  Rails authentication with email & password.
8
8
 
@@ -60,6 +60,7 @@ Clearance.configure do |config|
60
60
  config.cookie_domain = '.example.com'
61
61
  config.cookie_expiration = lambda { |cookies| 1.year.from_now.utc }
62
62
  config.cookie_path = '/'
63
+ config.routes = true
63
64
  config.httponly = false
64
65
  config.mailer_sender = 'reply@example.com'
65
66
  config.password_strategy = Clearance::PasswordStrategies::BCrypt
@@ -151,13 +152,17 @@ end
151
152
  Overriding routes
152
153
  -----------------
153
154
 
154
- See [config/routes.rb](/config/routes.rb) for the default behavior.
155
+ See [config/routes.rb](/config/routes.rb) for the default set of routes.
155
156
 
156
- To override a Clearance route, redefine it:
157
+ Route overrides became more difficult with [changes made in Rails
158
+ 4][rails_routes]. For this reason, Clearance 1.5 introduces an option to disable
159
+ all clearance routes, giving the user full control over routing and URL design.
157
160
 
158
- ```ruby
159
- resource :session, controller: 'sessions'
160
- ```
161
+ To disable the routes, set `config.routes = false`. You can optionally run
162
+ `rails generate clearance:routes` to dump a copy of the default routes into your
163
+ application for modification.
164
+
165
+ [rails_routes]: https://github.com/rails/rails/issues/11895
161
166
 
162
167
  Overriding controllers
163
168
  ----------------------
@@ -173,7 +178,7 @@ class SessionsController < Clearance::SessionsController
173
178
  class UsersController < Clearance::UsersController
174
179
  ```
175
180
 
176
- Don't forget to override routes to your new controllers!
181
+ Don't forget to [override routes](#overriding-routes) to your new controllers!
177
182
 
178
183
  Then, override public methods:
179
184
 
@@ -232,6 +237,19 @@ Override them like any other translation.
232
237
  See [config/locales/clearance.en.yml](/config/locales/clearance.en.yml) for the
233
238
  default behavior.
234
239
 
240
+ Overriding layouts
241
+ ----------------
242
+
243
+ By default, Clearance uses your application's default layout. If you would like
244
+ to change the layout that Clearance uses when rendering its views, simply specify
245
+ the layout in an initializer.
246
+
247
+ ```ruby
248
+ Clearance::PasswordsController.layout 'my_passwords_layout'
249
+ Clearance::SessionsController.layout 'my_sessions_layout'
250
+ Clearance::UsersController.layout 'my_admin_layout'
251
+ ```
252
+
235
253
  Overriding views
236
254
  ----------------
237
255
 
data/config/routes.rb CHANGED
@@ -1,24 +1,26 @@
1
- Rails.application.routes.draw do
2
- resources :passwords,
3
- controller: 'clearance/passwords',
4
- only: [:create, :new]
1
+ if Clearance.configuration.routes_enabled?
2
+ Rails.application.routes.draw do
3
+ resources :passwords,
4
+ controller: 'clearance/passwords',
5
+ only: [:create, :new]
5
6
 
6
- resource :session,
7
- controller: 'clearance/sessions',
8
- only: [:create]
7
+ resource :session,
8
+ controller: 'clearance/sessions',
9
+ only: [:create]
9
10
 
10
- resources :users,
11
- controller: 'clearance/users',
12
- only: Clearance.configuration.user_actions do
13
- resource :password,
14
- controller: 'clearance/passwords',
15
- only: [:create, :edit, :update]
16
- end
11
+ resources :users,
12
+ controller: 'clearance/users',
13
+ only: Clearance.configuration.user_actions do
14
+ resource :password,
15
+ controller: 'clearance/passwords',
16
+ only: [:create, :edit, :update]
17
+ end
17
18
 
18
- get '/sign_in' => 'clearance/sessions#new', as: 'sign_in'
19
- delete '/sign_out' => 'clearance/sessions#destroy', as: 'sign_out'
19
+ get '/sign_in' => 'clearance/sessions#new', as: 'sign_in'
20
+ delete '/sign_out' => 'clearance/sessions#destroy', as: 'sign_out'
20
21
 
21
- if Clearance.configuration.allow_sign_up?
22
- get '/sign_up' => 'clearance/users#new', as: 'sign_up'
22
+ if Clearance.configuration.allow_sign_up?
23
+ get '/sign_up' => 'clearance/users#new', as: 'sign_up'
24
+ end
23
25
  end
24
26
  end
data/db/schema.rb CHANGED
@@ -9,14 +9,14 @@
9
9
  # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
10
  # you'll amass, the slower it'll run and the greater likelihood for issues).
11
11
  #
12
- # It's strongly recommended to check this file into your version control system.
12
+ # It's strongly recommended that you check this file into your version control system.
13
13
 
14
14
  ActiveRecord::Schema.define(version: 20110111224543) do
15
15
 
16
16
  create_table "users", force: true do |t|
17
- t.datetime "created_at", null: false
18
- t.datetime "updated_at", null: false
19
- t.string "email", null: false
17
+ t.datetime "created_at", null: false
18
+ t.datetime "updated_at", null: false
19
+ t.string "email", null: false
20
20
  t.string "encrypted_password", limit: 128, null: false
21
21
  t.string "confirmation_token", limit: 128
22
22
  t.string "remember_token", limit: 128, null: false
@@ -0,0 +1,9 @@
1
+ Feature: copy routes to host application
2
+
3
+ Background:
4
+ Given I have a project with clearance
5
+
6
+ Scenario:
7
+ When I successfully run `bundle exec rails generate clearance:install`
8
+ And I successfully run `bundle exec rails generate clearance:routes`
9
+ Then the file "config/routes.rb" should contain "get '/sign_in' => 'clearance/sessions#new', as: 'sign_in'"