specstar-support-random 0.1.2 → 0.1.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: 46491dd7050646a71c15a1986c18b4f8dba7d9f4
4
- data.tar.gz: 522978fad1d5684af0bd231fe78565dd0318c3d7
3
+ metadata.gz: ed2cdb9cd2dab2713b63e71a084789159b4a1181
4
+ data.tar.gz: fb2a6cdb25dceddb8dca0d946a548d268c4836e6
5
5
  SHA512:
6
- metadata.gz: 1de3a4d64aae3904e474de085f8938db84ed48610f10aaca7291ae23fa3b29aecbfd6df2435d19c5f97dab82f39f148e522cd1fc0dcc477e9891160bf71ce18e
7
- data.tar.gz: f971707c62332f5fafc38c209708a89fc99ddbd08b9e815f86927ee95f8d75043c5e4463c68cc526d46db6aaec83c88aa78627e7abd90942650fbfe83ac3e170
6
+ metadata.gz: 6e3e7e085bdbc457cc95bdbf09e8317d5359267782ad83ecb5ca2e46f6c4491be422e951f74f859878883d0606fe4d040b8945c32cea91a851a1d92d5fbe0044
7
+ data.tar.gz: 9625ff405873495fd6571864c4db138f9277fd9b61b4b0b43ac4e84944c33a6191b3b20e61910a52adc9e534047b68ade26d3326de0f63804cfd8a38254070bd
@@ -24,6 +24,22 @@ def random_hash(options={})
24
24
  hash
25
25
  end
26
26
 
27
+
28
+ def random_hexadecimal(options={})
29
+ length = if options[:length]
30
+ options[:length]
31
+ elsif options[:max_length]
32
+ 1 + rand(options[:max_length])
33
+ elsif options[:min_length]
34
+ options[:min_length] + rand(64)
35
+ else
36
+ 1 + rand(64)
37
+ end
38
+
39
+ (1..length).map { '0123456789abcdef'.chars.sample }.join
40
+ end
41
+
42
+
27
43
  def random_number(options={})
28
44
  output = nil
29
45
  while output.nil? || output == options[:except]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specstar-support-random
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sujoy Gupta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-25 00:00:00.000000000 Z
11
+ date: 2016-01-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: sujoyg@gmail.com
@@ -37,7 +37,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
37
37
  version: '0'
38
38
  requirements: []
39
39
  rubyforge_project:
40
- rubygems_version: 2.4.6
40
+ rubygems_version: 2.4.8
41
41
  signing_key:
42
42
  specification_version: 4
43
43
  summary: RSpec helpers for generating random entities.