saikoro 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/README.md +18 -14
- data/lib/saikoro.rb +12 -7
- data/lib/saikoro/version.rb +1 -1
- data/saikoro.gemspec +2 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 077f8a22d46491178ed173eef980277f3fb14e0c
|
4
|
+
data.tar.gz: d52c9f88c33fc5a797fffa07bfb341dcce415994
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb36915cae8eb1b99e52d6dd168fc0561145e626ecde3817de7301b2fd78d9a4f60b9c18c6a43a80f54db11215dad22920d5cc431f3cf491abb4f1ca853b813b
|
7
|
+
data.tar.gz: cbef7c5b9122bedb1c13ac36c4c94feb4f0afd4acee1a7cd8159edd8cf1eab84e85e0a90514d783f0f5abe049852b0caebba5e21bdef8a1f8ed405ebd09ece96
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -7,28 +7,32 @@ Random String generator.
|
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
10
|
-
Add this line to your application's Gemfile:
|
11
|
-
|
12
|
-
```ruby
|
13
|
-
gem 'saikoro'
|
14
10
|
```
|
11
|
+
$ gem install saikoro
|
12
|
+
```
|
13
|
+
|
14
|
+
## Usage
|
15
15
|
|
16
|
-
|
16
|
+
```ruby
|
17
|
+
require 'saikoro'
|
17
18
|
|
18
|
-
|
19
|
+
Saikoro.alphanumerics #=> "50UbRceg"
|
20
|
+
Saikoro.alphanumerics(length: 42) #=> "gYCEbZubZ1DZpk6Coda0yhFVFQCracACy6dppbwv8H"
|
19
21
|
|
20
|
-
|
22
|
+
Saikoro.alphabets #=> "HmQosHQn"
|
23
|
+
Saikoro.alphabets(length: 42) #=> "PmbmmJpYUyaTyYqVrNQhzXyDefErYewRhWPNFWIwjV"
|
21
24
|
|
22
|
-
|
25
|
+
Saikoro.numbers #=> "98091246"
|
26
|
+
Saikoro.numbers(length: 42) #=> "709136609569553516669729349123743566633712"
|
23
27
|
|
24
|
-
|
28
|
+
Saikoro.ascii_printables #=> "Hh0)S|_<"
|
29
|
+
Saikoro.ascii_printables(length: 42) #=> "+;U8-_nDV^&1M!'yKOqD)+(Ju:j`76@a:w-aAwe)]."
|
25
30
|
|
26
|
-
|
27
|
-
Saikoro.
|
28
|
-
#=> "YMbx24GE"
|
31
|
+
Saikoro.lowercase_alphabets #=> "lsiveock"
|
32
|
+
Saikoro.lowercase_alphabets(length: 42) #=> "vlwhgsnvyvxhvlstaqtpwfurnpqjpgiitsrweapehl"
|
29
33
|
|
30
|
-
Saikoro.
|
31
|
-
#=> "
|
34
|
+
Saikoro.uppercase_alphabets #=> "SAXYNRLK"
|
35
|
+
Saikoro.uppercase_alphabets(length: 42) #=> "IWQDNRXXARUKDPVMJBIOXQDRUMUPZWRTFRBNIEUYEK"
|
32
36
|
```
|
33
37
|
|
34
38
|
## Development
|
data/lib/saikoro.rb
CHANGED
@@ -2,14 +2,19 @@ require "saikoro/version"
|
|
2
2
|
|
3
3
|
module Saikoro
|
4
4
|
class << self
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
table = {
|
6
|
+
alphanumerics: [*'a'..'z', *'A'..'Z', *'0'..'9'],
|
7
|
+
alphabets: [*'a'..'z', *'A'..'Z'],
|
8
|
+
lowercase_alphabets: [*'a'..'z'],
|
9
|
+
uppercase_alphabets: [*'A'..'Z'],
|
10
|
+
numbers: [*'0'..'9'],
|
11
|
+
ascii_printables: [*'!'..'~']
|
12
|
+
}
|
10
13
|
|
11
|
-
|
12
|
-
|
14
|
+
table.each do |name, candidates|
|
15
|
+
define_method name do |length: 8|
|
16
|
+
length.times.map { candidates.sample }.join
|
17
|
+
end
|
13
18
|
end
|
14
19
|
end
|
15
20
|
end
|
data/lib/saikoro/version.rb
CHANGED
data/saikoro.gemspec
CHANGED
@@ -16,6 +16,8 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
+
spec.required_ruby_version = '>= 2.0.0'
|
20
|
+
|
19
21
|
spec.add_development_dependency "bundler", "~> 1.10"
|
20
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
21
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saikoro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tsukuru Tanimichi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,7 +66,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 2.0.0
|
70
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - ">="
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
requirements: []
|
76
76
|
rubyforge_project:
|
77
|
-
rubygems_version: 2.4.5
|
77
|
+
rubygems_version: 2.4.5.1
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: Random String generator
|