blacklisted_password 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTVhZTFhY2Q2ZTZjYTE4MmNjMTA5Y2Y2MDJkNTc0OWNmYjljMzEyMw==
4
+ NzNhMjY5NjU2YmQxNzllZDRhZmQzMjMwYWMwOWZiY2UwZmMwNWY1OA==
5
5
  data.tar.gz: !binary |-
6
- OTIyODBhYWQxNTUxZTQ5MTc3YWM3MmIxMTczODE4YzQxYzY4ZTU1Zg==
6
+ YTY4MjllM2QxNjM2NGM2ZDBlY2RjMDNmMDRhOTRlZjk4ZjZkMDQ0Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmMxOWYzMTBmZTcxOGZiODVmNzQ3MGZhNWUwZjYyM2I0ZTk4MWJkODExNjZi
10
- ZWUzNGYxOWFkOTY0OTVjMWE3MzgzNGViODBjMGJmNDg5NGRhYjU2OTA5ZWE5
11
- ZDFiY2ZiMjE5MzY3NDU0NzA4ZDFjODk0YzIwOWZmZTJjZTc2ZDM=
9
+ ZGIxMmY5YzZmZTUwZTk2MTZjOTMzMTZmZTIxOGJmYzNlNzQ4NmU1ZWM2NTUz
10
+ ODQxNzllOWNiYWQwYTVkYWZiM2FmZDIzY2UwMzY5YThhNzE4NDU4NTNkOTc5
11
+ NDU0Yjc3YjZlODVkMjE3MzE1YWJiYTRjOWVkZDQyNDIyMGQzNjg=
12
12
  data.tar.gz: !binary |-
13
- YjYxZTZhNTdhZmNlMTI3YjhiMjA4Y2M4MDJkMzhkMmIzMDk3OGU4NjUwYjg2
14
- Y2EwN2IyNGFkNmQ5ZDI3M2QxNDkzMjYxYWM0ZTFkNmZjMzkzZjUyM2Y4N2U2
15
- ZjQwMDUxNTFlMWFjNTViNGVmNTI5OTA4NWVmOWNmNzFmMTJlZGI=
13
+ YTJjZWRkMzlkZGRiNTIzYmYwZWNlMDgwNTgxN2Q5ODNmNDA0NmFkMDZjYWM1
14
+ ODAyNDllM2YyNTA3MmIyZDA2MTRjZTg2Y2Q5NGIxMTkyODAxY2QyYjhmNTk2
15
+ OTVkMzg1NzE2YjY0ODdhOGI5N2ZiOWQ1MjEwNmU1Y2RkNmZkOGU=
data/README.md CHANGED
@@ -16,6 +16,35 @@ Or install it yourself as:
16
16
 
17
17
  $ gem install blacklisted_password
18
18
 
19
+ I am still working on that Gem:-
20
+
21
+ So Till the Generator file I create, please follow the following steps:-
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 :-
43
+
44
+ $ require "blacklisted_password"
45
+ $ BLACKLISTED_PASSWORD = Rails.root.join("config/blacklist_password.yml")
46
+ $ validate :blacklist_password
47
+
19
48
  ## Usage
20
49
 
21
50
  TODO: Write usage instructions here
@@ -1,3 +1,3 @@
1
1
  module BlacklistedPassword
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require "blacklisted_password/version"
2
2
 
3
3
  module BlacklistedPassword
4
- BLACKLISTED_PASSWORD = Rails.root.join("config/blacklist_password.yml")
4
+
5
5
  def blacklist_password #This is for blacklisting password
6
6
  if password.present?
7
7
  array = YAML.load_file(BLACKLISTED_PASSWORD).split(' ')
@@ -0,0 +1,24 @@
1
+ require 'rails/generators/active_record'
2
+ require 'securerandom'
3
+
4
+ module Goldencobra
5
+ module Generators
6
+ class InstallGenerator < ActiveRecord::Generators::Base
7
+ desc "This will create a blacklisted yml file"
8
+
9
+
10
+ def self.source_root
11
+ File.expand_path("../config", __FILE__)
12
+ end
13
+
14
+ def create_migrations
15
+ Dir["#{self.class.source_root}/config/*.rb"].sort.each do |filepath|
16
+ name = File.basename(filepath)
17
+ template "config/#{name}", "config/#{name}"
18
+ sleep 1
19
+ end
20
+ end
21
+
22
+ end
23
+ end
24
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklisted_password
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanmay Bagchi
@@ -54,6 +54,7 @@ files:
54
54
  - config/blacklist_password.yml
55
55
  - lib/blacklisted_password.rb
56
56
  - lib/blacklisted_password/version.rb
57
+ - lib/generators/blacklisted_password/install_generator.rb
57
58
  homepage: ''
58
59
  licenses:
59
60
  - MIT