webget_ruby_password_text 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -25,15 +25,20 @@ The default character array is chosen for the best usability,
25
25
  to help people who use mobile phones and who have disabilities:
26
26
  all lowercase and omitting "i", "l", "o" which look like numbers.
27
27
 
28
- If SecureRandom is not defined, e.g. if you are using Ruby 1.8.6,
29
- then we require our webget_ruby_secure_random gem which provides it.
28
+ ==SecureRandom
29
+
30
+ Ruby 1.8.6 and older does not have a secure random number method,
31
+ so this gem checks to see if the SecureRandom class is defined;
32
+ if it is not, then we require our webget_ruby_secure_random gem.
30
33
 
31
34
  =end
32
35
 
33
36
 
37
+ if !defined?(SecureRandom) then require 'webget_ruby_secure_random' end
38
+
39
+
34
40
  class PasswordText < String
35
41
 
36
- if !defined?(SecureRandom) then require 'webget_ruby_secure_random' end
37
42
 
38
43
  # Default characters
39
44
  @@chars=['a','b','c','d','e','f','g','h','j','k','m','n','p','q','r','s','t','u','v','w','x','y','z']
@@ -55,7 +60,7 @@ class PasswordText < String
55
60
  # PasswordText.new => "avzwbnxremcd"
56
61
  # PasswordText.new(4) => "avzw"
57
62
  # PasswordText.new(4,['x','y','z']) => "yzyx"
58
-
63
+
59
64
  def initialize(length=@@length,chars=@@chars)
60
65
  super(Array.new(length){chars[SecureRandom.random_number(chars.size)]}.join)
61
66
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webget_ruby_password_text
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - WebGet
@@ -32,7 +32,7 @@ cert_chain:
32
32
  DXnLFY0cVuBnNDMOOFl8vk1qIcZjcTovhzgcixpG6Uk5qmUsKHRLQf4oQJx7TfLK
33
33
  -----END CERTIFICATE-----
34
34
 
35
- date: 2010-02-17 00:00:00 -08:00
35
+ date: 2010-02-18 00:00:00 -08:00
36
36
  default_executable:
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
@@ -45,16 +45,6 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: 2.0.5
47
47
  version:
48
- - !ruby/object:Gem::Dependency
49
- name: webget_ruby_secure_random
50
- type: :runtime
51
- version_requirement:
52
- version_requirements: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: 1.2.0
57
- version:
58
48
  description:
59
49
  email: webget@webget.com
60
50
  executables: []
metadata.gz.sig CHANGED
Binary file