devise_inactivatable 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb189bdcd26a52b06756bfe2ded95c185897900c
4
- data.tar.gz: f038a4014d358e8d5bbe0e6a3c6e83f78d2584bc
3
+ metadata.gz: 4f152c9908add89e483b81b3886f8b5eb4fd91f0
4
+ data.tar.gz: 977318b024838c71d14cde51bb3fd250bd138646
5
5
  SHA512:
6
- metadata.gz: a682aad5f2e416e9cfcd7466afbdf4387c1d661ae2ffa1ac202bb268f48f36555cae4b05c95d6e37c7804625cbaf04aa016e5876125472a90b3ac84520f717a4
7
- data.tar.gz: 8ec8c6cde703f3a3b74eda874c42a73393d304f86051749994491b08f6faa3dafaf931a62d986c5f0c1c38717f0d2e6de88c59fb86cccc592a75fb6ae716e28a
6
+ metadata.gz: fe800078fc34ac6c0f0f9df8d159cd0a0a1fc8b1cacae91a42ad53e9c84365eca56a3f712ffdafcfb82b67911948e055f04a29354683519994d827a72fc76028
7
+ data.tar.gz: 13f2a77e2e8a45e4948e9791b7021e3a0eb0d24954064d06d3b8d48b1f0bb4dbf098596d0deb1398be352303d78a887315f53ba440dded4e04fd2e7fcaf44231
data/Gemfile CHANGED
@@ -1,4 +1,25 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in devise_inactivatable.gemspec
4
3
  gemspec
4
+
5
+ gem "rails", "~> 4.1.0"
6
+ gem "rdoc"
7
+
8
+ group :test do
9
+ gem "webrat", "0.7.3", require: false
10
+ gem "mocha", "~> 1.1", require: false
11
+ end
12
+
13
+ platforms :jruby do
14
+ gem "activerecord-jdbc-adapter"
15
+ gem "activerecord-jdbcsqlite3-adapter"
16
+ gem "jruby-openssl"
17
+ end
18
+
19
+ platforms :ruby do
20
+ gem "sqlite3"
21
+ end
22
+
23
+ group :mongoid do
24
+ gem "mongoid", "~> 4.0.0"
25
+ end
data/README.md CHANGED
@@ -50,13 +50,18 @@ Include in your model:
50
50
  devise :database_authentication, :inactivatable
51
51
  end
52
52
 
53
- Adding four wonderful new methods, and modifications to two other methods:
53
+ Adding four wonderful new methods:
54
54
 
55
55
  - activate! : active the account if it is inactive
56
56
  - inactivate! : inactive the account if it is active
57
57
  - active? : checks whether the account is active
58
58
  - inactive? : checks whether the account is inactive
59
59
 
60
+ And modifications to two other methods:
61
+
62
+ - active_for_authentication? : If inactive returns false, else it preforms the super method
63
+ - inactive_message : If inactive returns :inactivated, else it performs the super method
64
+
60
65
  ## License
61
66
 
62
67
  The devise_inactivatable is hosted on Github: https://github.com/jonathanccalixto/devise_inactivable, where your contributions, forkings, comments and feedback are greatly welcomed.
data/Rakefile CHANGED
@@ -1 +1,35 @@
1
+ # encoding: UTF-8
1
2
  require "bundler/gem_tasks"
3
+ require 'rake/testtask'
4
+ require 'rdoc/task'
5
+
6
+ desc 'Default: run tests for all ORMs.'
7
+ task default: :test
8
+
9
+ desc 'Run Devise tests for all ORMs.'
10
+ task :pre_commit do
11
+ Dir[File.join(File.dirname(__FILE__), 'test', 'orm', '*.rb')].each do |file|
12
+ orm = File.basename(file).split(".").first
13
+ # "Some day, my son, rake's inner wisdom will reveal itself. Until then,
14
+ # take this `system` -- may its brute force protect you well."
15
+ exit 1 unless system "rake test DEVISE_ORM=#{orm}"
16
+ end
17
+ end
18
+
19
+ desc 'Run Devise unit tests.'
20
+ Rake::TestTask.new(:test) do |t|
21
+ t.libs << 'lib'
22
+ t.libs << 'test'
23
+ t.pattern = 'test/**/*_test.rb'
24
+ t.verbose = true
25
+ t.warning = false
26
+ end
27
+
28
+ desc 'Generate documentation for Devise.'
29
+ Rake::RDocTask.new(:rdoc) do |rdoc|
30
+ rdoc.rdoc_dir = 'rdoc'
31
+ rdoc.title = 'Devise'
32
+ rdoc.options << '--line-numbers' << '--inline-source'
33
+ rdoc.rdoc_files.include('README.md')
34
+ rdoc.rdoc_files.include('lib/**/*.rb')
35
+ end
@@ -3,7 +3,6 @@ require 'devise/strategies/database_authenticatable'
3
3
  module Devise
4
4
  module Models
5
5
  module Inactivatable
6
-
7
6
  def active_for_authentication?
8
7
  active? && super
9
8
  end
@@ -27,7 +26,6 @@ module Devise
27
26
  def inactive_message
28
27
  inactive? ? :inactivated : super
29
28
  end
30
-
31
29
  end
32
30
  end
33
31
  end
@@ -1,3 +1,3 @@
1
1
  module DeviseInactivatable
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -3,11 +3,6 @@ require "test_helper"
3
3
  class InactivatableTest < ActiveSupport::TestCase
4
4
  include Support::Assertions
5
5
  include Support::Factories
6
- include Support::Swappers
7
-
8
- def encrypt_password(admin, pepper=Admin.pepper, stretches=Admin.stretches, encryptor=Admin.encryptor_class)
9
- encryptor.digest('123456', stretches, admin.password_salt, pepper)
10
- end
11
6
 
12
7
  test '#inactivated_at should be nil when admin created' do
13
8
  assert_nil create_admin.inactivated_at
@@ -21,14 +16,14 @@ class InactivatableTest < ActiveSupport::TestCase
21
16
  end
22
17
 
23
18
  test '#activate! should set #inactivated_at with nil' do
24
- admin = create_admin(:inactivated_at, Time.now)
19
+ admin = create_admin(:inactivated_at => Time.now)
25
20
  assert admin.inactivated_at.present?
26
- admin.inactivate!
21
+ admin.activate!
27
22
  assert_not admin.inactivated_at.present?
28
23
  end
29
24
 
30
25
  test '#active? should be true when actived' do
31
- admin = create_admin(:inactivated_at, Time.now)
26
+ admin = create_admin(:inactivated_at => Time.now)
32
27
  assert_not admin.active?
33
28
  admin.activate!
34
29
  assert admin.active?
@@ -8,6 +8,9 @@ class CreateTables < ActiveRecord::Migration
8
8
  t.string :email, :null => false, :default => ""
9
9
  t.string :encrypted_password, :null => false, :default => ""
10
10
 
11
+ ## Inactivatable
12
+ t.datetime :inactivated_at
13
+
11
14
  ## Recoverable
12
15
  t.string :reset_password_token
13
16
  t.datetime :reset_password_sent_at
@@ -47,6 +50,9 @@ class CreateTables < ActiveRecord::Migration
47
50
  t.string :email, :null => true
48
51
  t.string :encrypted_password, :null => true
49
52
 
53
+ ## Inactivatable
54
+ t.datetime :inactivated_at
55
+
50
56
  ## Recoverable
51
57
  t.string :reset_password_token
52
58
  t.datetime :reset_password_sent_at
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_inactivatable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan C. Calixto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-27 00:00:00.000000000 Z
11
+ date: 2014-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: devise
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.0'
55
55
  description: This is a simple, however wonderful devise extension to activate and
@@ -60,7 +60,7 @@ executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - .gitignore
63
+ - ".gitignore"
64
64
  - Gemfile
65
65
  - LICENSE.txt
66
66
  - README.md
@@ -101,17 +101,17 @@ require_paths:
101
101
  - lib
102
102
  required_ruby_version: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - '>='
104
+ - - ">="
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - '>='
109
+ - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.2.1
114
+ rubygems_version: 2.2.2
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Activate and inactivate a devise account