safe_random 0.0.3 → 0.0.4

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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1269d2c5eaa98d9316d8d672f00becc03ff154940f94d2d49a237b93a949aac
4
- data.tar.gz: b2eb2950119231f63894e9d22f4f79dde2d8dfe96ac69ae6ecd22eef1f2596a1
3
+ metadata.gz: 9c3e19d8f944b47364e485578bef15bd1acabf548f19a0d3821a92730be51783
4
+ data.tar.gz: 666d8ba6ed02922dff7e796bfc502c289aaadf41c7f2863b33233f86f1c3f9d0
5
5
  SHA512:
6
- metadata.gz: d3a150a2f58527cc6dc593604e63f22c8287a372b9a157c5abe6537b16ea0febaa2c34fc3ef9b4bfe60d0ca5d14f1c7af6aa742e4ce2c90d3b607bf03266e3a6
7
- data.tar.gz: 76b7686b625557be1621739d7e6fd12d580c382698267324c415b43eee820b5e0bea27d0a052907d45de57a61a341222d8fb0bc38d32166af6cac24562351677
6
+ metadata.gz: b449d056be0b468ee2221517e9b39952c38751238776eb23d67e4e6ae16de8d7db3b3653dea68fedc50297861f46ba6d627f6435b9b582c4eccb004753a7c97d
7
+ data.tar.gz: 2f77a3fe3986021f19901ecb0892d757969028f8f8e072a5a4a56b9900fc5bdaf5edb8b611cf12f07d0b0ba39ad3a9051c14a9fbcffd22cb15299e8af3a4e2f5
@@ -2,4 +2,30 @@ module Constants
2
2
  SET_NUMBER = ['0'..'9'].freeze
3
3
  SET_STRING = ['A'..'Z', 'a'..'z'].freeze
4
4
  SET_ALPHANUMBERIC = ['A'..'Z', 'a'..'z', '0'..'9'].freeze
5
+
6
+ SET_PARAGRAPH = [
7
+ 'Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua',
8
+ 'Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat',
9
+ 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur',
10
+ 'Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum',
11
+ "There's a voice that keeps on calling me",
12
+ "Down the road that's where I'll always be",
13
+ "Every stop I make I make a new friend; Can't stay for long just turn around and I'm gone again",
14
+ "Maybe tomorrow I'll want to settle down - until tomorrow I'll just keep moving on",
15
+ 'Hong Kong Phooey number one super guy, Hong Kong Phooey quicker than the human eye',
16
+ "He's got style, a groovy style, and a car that just won't stop",
17
+ "Hey there where ya goin, not exactly knowin'",
18
+ 'Who says you have to call just one place home?',
19
+ "He's going everywhere, B.J. McKay and his best friend Bear",
20
+ "He just keeps on movin' and ladies keep improvin'",
21
+ "Every day is better than the last, with new dreams and better scenes and best of all I don't pay property tax",
22
+ "Rolling down to Dallas - who is providin' my palace?",
23
+ 'Off to New Orleans or who knows where',
24
+ 'Soaring through all the galaxies in search of Earth flying in to the night',
25
+ 'Ulysses, fighting evil and tyranny with all his power and with all of his might',
26
+ 'No-one else can do the things you do, like a bolt of thunder from the blue',
27
+ 'Always fighting all the evil forces bringing peace and justice to all',
28
+ "I've gotten burned over Cheryl Tiegs and blown up for Raquel Welch, but when I end up in the hay it's only hay, hey hey",
29
+ "I might jump an open drawbridge or Tarzan from a vine, beause I'm the unknown stuntman that makes Eastwood look so fine"
30
+ ].freeze
5
31
  end
@@ -0,0 +1,27 @@
1
+ module SafeRandom
2
+ # => Returns a given number of paragraphs delimited by two newlines (defaults to two paragraphs),
3
+ # => using a small pool of generic sentences.
4
+ # => SafeRandom.paragraphs
5
+ #
6
+ # "I might jump an open drawbridge or Tarzan from a vine, beause I'm the unknown stuntman that makes Eastwood look so fine.\n\n \Always fighting all the evil forces bringing peace and justice to all. \n\n"
7
+
8
+ def self.sentences(num = 1)
9
+ sentences = ''
10
+ num.times do
11
+ sentences += Constants::SET_PARAGRAPH.sample + '. '
12
+ end
13
+ sentences.strip
14
+ end
15
+
16
+ def self.paragraphs(num = 2)
17
+ text = ''
18
+
19
+ num.times do
20
+ (rand(5) + 1).times do
21
+ text += Constants::SET_PARAGRAPH.sample + '. '
22
+ end
23
+ text += "\n\n"
24
+ end
25
+ text
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module SafeRandom
2
- VERSION = '0.0.3'.freeze
2
+ VERSION = '0.0.4'.freeze
3
3
  end
data/lib/safe_random.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require_relative './safe_random/constants.rb'
2
2
  require_relative './safe_random/base.rb'
3
+ require_relative './safe_random/text.rb'
3
4
  require_relative './safe_random/version.rb'
4
5
  require 'time'
5
6
  require 'digest'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safe_random
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rahul Patil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-02 00:00:00.000000000 Z
11
+ date: 2018-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,7 +38,8 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: ''
41
+ description: SafeRandom gem will help to generate random string, paragraphs, number
42
+ and alphanumeric very easily.
42
43
  email:
43
44
  - rahupatil_scs@yahoo.co.in
44
45
  executables: []
@@ -51,6 +52,7 @@ files:
51
52
  - lib/safe_random.rb
52
53
  - lib/safe_random/base.rb
53
54
  - lib/safe_random/constants.rb
55
+ - lib/safe_random/text.rb
54
56
  - lib/safe_random/version.rb
55
57
  homepage: ''
56
58
  licenses: