blacklisted_password 0.1.0 → 1.0.0

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTc4MjQ4ZDgzNGIzOWQ2M2VhZGNkMjRkNTI1Yzk1ZDAxZjQ3NDQyYw==
4
+ ZmI5NTllMDk4ZDU3ZDI3YTA5NWQ1OTI0M2JhOGUxMzlhYjYwZDFjZQ==
5
5
  data.tar.gz: !binary |-
6
- YzVjZTQ4MWM1MjIwYTFiNDNlN2U4MmZiZDE4NWFiMjg0ODM5NWRmZQ==
6
+ NDNhNWQxMWI0Y2YyMGEzYjlmY2M3OTEyM2QxYWJhMzc1NGNhYWFkNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTY4MTUxY2Q3YmIwYTFlNjQwZTQ2OWIxOTg2MDE1MjMzMmIwMThlNzBkMGQ3
10
- YWFjNjVmYWJjYzczZGViNjgyOGJmNWE2NGRiNDZiYmJkYzJjNTY1ODQ3ZDRl
11
- ODA3ZjE4NDYxMmQxNjdiODZiMmQ1MDE5NWZjYmYzNDU3OWRlZjY=
9
+ YWY5MjhjMDg3NjNmMWVjNWU1MzVkMTMyMTIzOGZiYWJlNTM4MzA1ZmVmZjk4
10
+ MTkxNDI0ZGFkZTNmMWFmZTkzOGVlYzc0MTNjZjgwYjg5MDRmZDg0OWZkMDYy
11
+ ODg2YWIzZDkzMmE2ZDUzZGU5ZTY5ZGYwYTZjMzhiMjdhZjhhZTY=
12
12
  data.tar.gz: !binary |-
13
- MWM0YTcxODA1MDQ0Yjg4YmZlNGM3YjAxZmQ3MDc2ZTJjNzc1MDk4MmI4OGRm
14
- MjU2MWRjYmEwNWQ4OTRhYzc3YWNhZTRjZjIwM2NjN2FkNWIyY2RkMmExMjc5
15
- MjZiY2NkMmI2MmFhYWVmNDA3NjA2ZmRkNTgwNzRkYTU5ZTU4NjU=
13
+ ZTgzMTlmOWJhOGFiMGNhYTU2NWNlZjQzZjJiMDczZTViYjRlYzNjOTFkZjg5
14
+ MTZmNGY1MzViMjBiNDQ4YTcxMTY4M2QxYjU2ZGQ0NzJhNTg1NTE2MWU5MTk0
15
+ YTc1NTI1NzcxNGY0YzRkYTc4NDcyNTE1YWIzNzM2NjRmZjQ2NDY=
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # BlacklistedPassword
2
2
 
3
- TODO: Write a gem description
3
+ This is a Password black listing gem where you can add Blacklisted words in YAML file.
4
4
 
5
5
  ## Installation
6
6
 
@@ -16,42 +16,21 @@ Or install it yourself as:
16
16
 
17
17
  $ gem install blacklisted_password
18
18
 
19
- I am still working on that Gem:-
19
+ Then generate required files as follow:-
20
20
 
21
- So Till the Generator file I create, please follow the following steps:-
21
+ $ rails g blacklisted:install
22
22
 
23
- From your Root of your application:-
24
-
25
- $ touch config/blacklist_password.yml
26
-
27
- In the blacklist_password.yml file you have to write few blacklisted words
28
-
29
- $ ---
30
- $ demo
31
- $ abc
32
- $ black
33
-
34
- $ touch config/initializer/blacklisted_password.rb
35
-
36
- Into initializer file
37
-
38
- $ BLACKLISTED_PASSWORD = Rails.root.join("config/blacklist_password.yml")
39
-
40
-
41
-
42
- Then in you Model where you want to validate password :-
23
+ ## Usage
43
24
 
44
- $ require "blacklisted_password"
45
- $ BLACKLISTED_PASSWORD = Rails.root.join("config/blacklist_password.yml")
46
- $ validate :blacklist_password
25
+ In your Model just add :--
47
26
 
48
- ## Usage
27
+ require 'blacklisted_password'
49
28
 
50
- TODO: Write usage instructions here
29
+ validates :password, blacklist: true
51
30
 
52
31
  ## Contributing
53
32
 
54
- 1. Fork it
33
+ 1. git clone `https://github.com/tbagchi85/blacklisted_password.git`
55
34
  2. Create your feature branch (`git checkout -b my-new-feature`)
56
35
  3. Commit your changes (`git commit -am 'Add some feature'`)
57
36
  4. Push to the branch (`git push origin my-new-feature`)
@@ -27,10 +27,14 @@ class BlacklistValidator < ActiveModel::EachValidator
27
27
  end
28
28
 
29
29
  def email_spliting(email) #This is for possible email splitting
30
- character_to_split = ['_','+','@','.']
31
- character_to_split.each do |char|
32
- email = email.split(char).join("^")
30
+ if email
31
+ character_to_split = ['_','+','@','.']
32
+ character_to_split.each do |char|
33
+ email = email.split(char).join("^")
34
+ end
35
+ email.split('^')
36
+ else
37
+ []
33
38
  end
34
- email.split('^')
35
39
  end
36
40
  end
@@ -1,3 +1,3 @@
1
1
  module BlacklistedPassword
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklisted_password
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanmay Bagchi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-25 00:00:00.000000000 Z
11
+ date: 2014-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby