tri 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tri.rb +144 -9
  3. metadata +6 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f351f1eba218bfde9492aad5b21b7f864686f2c
4
- data.tar.gz: db736b67a48c35b98bef786840e30f6c4e376536
3
+ metadata.gz: 7d04994fb66a61a6f0a57c20a92b440feda03197
4
+ data.tar.gz: f0173dea2c3032dd0e6dad5d0df1adbbd48aa8c6
5
5
  SHA512:
6
- metadata.gz: dffec334756f4146b862b01146e1e84d8e6665e71610deed06caaa76b7426b6dc70cd7b5604e443cc398e96327ca6d26d74681eee70b9ae08c28e27e9b03b8af
7
- data.tar.gz: 14b0d000818a2b519e999fe76327c75f1ac751db92899604a41f9664b4bb49b98d33d1f225a2fbe0a790d86059cfc8bc081d1c157d346fc167419cd2cbf147ce
6
+ metadata.gz: 8f34694faf84b13c5f88f2bb44a1dcc6f12ab4994d39509d5cf3d5f2e8c5116696100cfec00c8c0d11f714d54bb34a2f8c1a5356c69196970b9ec0ae40ecf2eb
7
+ data.tar.gz: e0de89613df8a51f11fa1d076baa31fd7bc2b589aa8f53a873eeee92852fb02bdcb6d642357f5d16aa62d4bb19f0436778bdb1e77e24c4b6871b02e0b35b4af5
data/lib/tri.rb CHANGED
@@ -126,7 +126,7 @@ module Tri
126
126
  "blob", "eel", "naddock", "turbot", "grey mullet", "sea horse", "clown", "snakehead", "beluga", "trumpet", "jellow",
127
127
  "moa trunk", "dolphin"]
128
128
 
129
- S_HOPPY = ["reading books", "Watching TVs", "spednig time with family", "Watching movies", "fishing", "playing computer games",
129
+ S_HOPPY = ["reading books", "Watching TVs", "speding time with family", "Watching movies", "fishing", "playing computer games",
130
130
  "gardening", "walking", "listening to music", "window shopping", "sleeping and relaxing", "cooking", "playing golf",
131
131
  "socializing", "sewing", "hiking", "eating out", "camping", "working on cars", "writing", "motorcycling", "dancing",
132
132
  "painting", "horseback riding", "working volunteer", "chatting"]
@@ -136,7 +136,7 @@ module Tri
136
136
  "truck driver", "crane operator", "machine operator", "machinist", "accountant", "consultant", "layer", "judge",
137
137
  "politcian", "policeman", "president", "spy", "scecret agent", "astronount", "businessman", "teacher", "veteran",
138
138
  "comedian", "doctor", "thief", "robber", "baker", "priminister", "sport professor player", "librarian", "fire fighter",
139
- "realtor", "bocker", "flight attendent", "pilot", "ship captain", "singer", "musician", "detective"]
139
+ "realtor", "bocker", "flight-attendent", "pilot", "ship captain", "singer", "musician", "detective"]
140
140
 
141
141
  S_EMOTION_GOOD = ["Holycow!", "Holy $#@%@!", "Unbelivable!", "Awesome!", "So lovely!", "Fanstatic", "WoW!", "Cool!", "Yay!",
142
142
  "Hurray!", "Wonderful!", "Excellent!", "Luckily!", "Yippi!", "Good job!", "Ingredible!"]
@@ -146,9 +146,9 @@ module Tri
146
146
  S_TIME = ["minutes", "hours", "days", "weeks", "months", "years", "decades"]
147
147
 
148
148
  S_COMPANY = ["Walmart", "Exxon Mobil", "Chevron", "Berkshire Hathaway", "Apple Inc", "General Motors", "General Electric",
149
- "AT&T", "Verizon", "Fannie Mae", "Costco", "Hewlet Packer", "JP Morgan Chase", "Bank of America Corp",
149
+ "ATT", "Verizon", "Fannie Mae", "Costco", "Hewlet Packer", "JP Morgan Chase", "Bank of America Corp",
150
150
  "Marathon Petroleum", "Boeing", "Citigroup", "Amazon", "Microsoft", "Facebook", "Google", "Home Depot",
151
- "Target", "Johnson & Johnson", "Freddie Mac", "Comcast", "Netflix", "Fedex", "UPS", "Lowe's", "Intel",
151
+ "Target", "Johnson n Johnson", "Freddie Mac", "Comcast", "Netflix", "Fedex", "UPS", "Lowes", "Intel",
152
152
  "Walt Disney", "Cisco Systems", "Coca-Cola", "Best Buy", "Goldman Sachs Group", "Oracle", "Safeway",
153
153
  "American Express", "Time Warner", "Macy's", "Tech Data", "McDonald's", "eBay"]
154
154
 
@@ -156,6 +156,29 @@ module Tri
156
156
 
157
157
  S_ADJECTIVE= ["lovely", "good", "important", "adorable", "beautiful", "elegant", "fancy", "glamorous", "nice"]
158
158
 
159
+ S_EMAIL_SUFFIX= [".biz", ".info", ".work", ".club", ".mobi", ".net", ".co", ".party", ".solutions", ".com", ".org",
160
+ ".guru", ".directory", ".voyage", ".photopraphy", ".photos", ".com.pl", ".expert", ".technology", ".clothing",
161
+ ".training", ".football", ".services", ".media", ".systems", ".education", ".maison", ".rentals", ".fitness",
162
+ ".international", ".parts", ".hockey", ".estate", ".support", ".toys", ".deals", ".properties", ".cards",
163
+ ".direct", ".design", ".futbol", ".xyz"]
164
+
165
+ S_EMAIL_DOMAIN= ["gmail", "hotmail", "hushmail", "zohomail", "mail", "outlook", "gmxmail", "inbox", "yandex", "shortmail",
166
+ "yahoomail", "rocketmail", "aimmail", "aussimail", "bigstring", "bluebottle", "boarderemail", "canoe",
167
+ "care2", "dcemail", "dbzmail", "didamail", "emailaccount", "faster", "fast", "gawab", "graffiti", "hotpop",
168
+ "icqmail", "inbox", "indiatimes", "inmail24", "jubii", "linuxmail", "lycosmail", "mail2world", "mailsnare",
169
+ "merseymail", "msnhotmail", "muchomail", "myway", "operamail", "outgun", "postmaster", "prontomail",
170
+ "rediff", "runbox", "sacmail", "safe-mail", "ureach", "vfemail", "ziladog", "fuser", "grabmail", "mail2web",
171
+ "myemail", "tamadaa", "techemail", "earthclassmail", "futureme", "hoaxmail", "postful", "shinyletter",
172
+ "dodgeit", "emailias", "gishpyppy", "spam", "spambox", "zoemail", "notaspam", "spamme", "nospam", "spamming"]
173
+
174
+ S_EMAIL_PREFIX= ["admin", "noreply", "me", "inbox", "mail", "finance", "administrator", "boss", "staff", "service", "helpdesk",
175
+ "it", "itdepart", "pr", "server", "client", "secrectary", "office", "headquater", "hr", "humanresource", "security",
176
+ "important", "about", "aboutus", "contact", "shouldreply", "spam", "subcrible", "unsubcrible", "infor", "warning",
177
+ "danger", "vip", "members", "notice", "fail-delivery", "delivery"]
178
+
179
+ S_ALPHABET = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",
180
+ "t", "u", "v", "w", "x", "y", "z"]
181
+
159
182
  def Tri::name
160
183
  S_NAME[rand(S_NAME.length)]
161
184
  end
@@ -292,11 +315,123 @@ module Tri
292
315
  end
293
316
  end
294
317
 
295
- def Tri::email_with_gravatar(id)
296
- if (id >= 1)
297
- "user" + id.to_s + "@hdtri.ca"
318
+ def self.email_with_gravatar(id = 0)
319
+ max = 1 + rand(130);
320
+ if (id == 0)
321
+ "user" + max.to_s + "@hdtri.ca"
322
+ elsif (id > 0)
323
+ "user" + id.to_s + "@hdtri.ca"
298
324
  else
299
- "The input parametter must is an integer >= 1"
325
+ "Please input a number that greater than zero."
300
326
  end
301
- end
327
+ end
328
+
329
+ def self.email(name = nil)
330
+ if (name == nil)
331
+ generate_email_prefix + "@" + generate_email_domain + generate_email_suffix
332
+ else
333
+ name.to_s + "@" + generate_email_domain + generate_email_suffix
334
+ end
335
+ end
336
+
337
+ private
338
+
339
+ def self.generate_email_suffix
340
+ suffix_code = ""
341
+ case rand(3)
342
+ when 0
343
+ # generate contry code: .ca, .uk, us
344
+ suffix_code += "." + S_ALPHABET.shuffle[0] + S_ALPHABET.shuffle[0]
345
+ when 1
346
+ # generate original code: .com, .net, .org
347
+ suffix_code += S_EMAIL_SUFFIX[rand(S_EMAIL_SUFFIX.length)]
348
+ else
349
+ suffix_code += S_EMAIL_SUFFIX[rand(S_EMAIL_SUFFIX.length)] + "." + S_ALPHABET.shuffle[0] + S_ALPHABET.shuffle[0]
350
+ end
351
+ end
352
+
353
+ def self.generate_email_prefix
354
+ prefix_name = ""
355
+ case rand(6)
356
+ when 0
357
+ prefix_name += S_NAME[rand(S_NAME.length)]
358
+ when 1
359
+ prefix_name += S_NAME[rand(S_NAME.length)][0] + "." + S_NAME[rand(S_NAME.length)]
360
+ when 2
361
+ prefix_name += S_NAME[rand(S_NAME.length)][0] + "-" + S_NAME[rand(S_NAME.length)]
362
+ when 3
363
+ prefix_name += S_NAME[rand(S_NAME.length)] + "." + S_NAME[rand(S_NAME.length)]
364
+ when 4
365
+ prefix_name += S_NAME[rand(S_NAME.length)] + "-" + S_NAME[rand(S_NAME.length)]
366
+ else
367
+ prefix_name += S_EMAIL_PREFIX[rand(S_EMAIL_PREFIX.length)]
368
+ end
369
+ prefix_name.downcase
370
+ end
371
+
372
+ def self.generate_email_domain
373
+ domain_name = ""
374
+ case rand(25)
375
+ when 0
376
+ domain_name += S_EMAIL_DOMAIN[rand(S_EMAIL_DOMAIN.length)].downcase
377
+ when 1
378
+ domain_name += S_ADJECTIVE[rand(S_ADJECTIVE.length)].downcase
379
+ when 2
380
+ domain_name += S_NEWS[rand(S_NEWS.length)].downcase
381
+ when 3
382
+ domain_name += S_COMPANY[rand(S_COMPANY.length)].downcase.gsub(" ", "-")
383
+ when 4
384
+ domain_name += S_TIME[rand(S_TIME.length)]
385
+ when 5
386
+ domain_name += S_NUMBER[rand(S_NUMBER.length)]
387
+ when 6
388
+ domain_name += S_JOB[rand(S_JOB.length)].downcase.gsub(" ", "-")
389
+ when 7
390
+ domain_name += S_HOPPY[rand(S_HOPPY.length)].downcase.gsub(" ", "-")
391
+ when 8
392
+ domain_name += S_FISH[rand(S_FISH.length)].downcase.gsub(" ", "-")
393
+ when 9
394
+ domain_name += S_JOB[rand(S_JOB.length)].downcase.gsub(" ", "-")
395
+ when 10
396
+ domain_name += S_BIRD[rand(S_BIRD.length)].downcase.gsub(" ", "-")
397
+ when 11
398
+ domain_name += S_ANIMAL[rand(S_ANIMAL.length)].downcase.gsub(" ", "-")
399
+ when 12
400
+ domain_name += S_LANDMARK[rand(S_LANDMARK.length)].downcase.gsub(" ", "-")
401
+ when 13
402
+ domain_name += S_COUNTRY[rand(S_COUNTRY.length)].downcase.gsub(" ", "-")
403
+ when 14
404
+ domain_name += S_CITY[rand(S_CITY.length)].downcase.gsub(" ", "-")
405
+ when 15
406
+ domain_name += S_COLOR[rand(S_COLOR.length)].downcase.gsub(" ", "-")
407
+ when 16
408
+ domain_name += S_TRANSPORT[rand(S_TRANSPORT.length)].downcase.gsub(" ", "-")
409
+ when 17
410
+ domain_name += S_FOOD[rand(S_FOOD.length)].downcase.gsub(" ", "-")
411
+ when 18
412
+ domain_name += S_SPORT[rand(S_SPORT.length)].downcase.gsub(" ", "-")
413
+ when 19
414
+ domain_name += S_TVSHOW[rand(S_TVSHOW.length)].downcase.gsub(" ", "-")
415
+ when 20
416
+ domain_name += S_MOVIE[rand(S_MOVIE.length)].downcase.gsub(" ", "-")
417
+ when 21
418
+ domain_name += S_PRONOUN[rand(S_PRONOUN.length)].downcase.gsub(" ", "-")
419
+ when 22
420
+ domain_name += S_CELEBRITY[rand(S_CELEBRITY.length)].downcase.gsub(" ", "-")
421
+ else
422
+ domain_name += S_NAME[rand(S_NAME.length)].downcase.gsub(" ", "-")
423
+ end
424
+
425
+ case rand(8)
426
+ when 0
427
+ domain_name += "mail"
428
+ when 1
429
+ domain_name += "-mail"
430
+ when 2
431
+ domain_name += (rand(99) + 1).to_s
432
+ else
433
+ domain_name
434
+ end
435
+
436
+ end
302
437
  end
metadata CHANGED
@@ -1,17 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tri
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
  - Tri Huynh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-17 00:00:00.000000000 Z
11
+ date: 2016-01-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: 'This game will generate some usefull infor mation for your user such
14
- as: name, full name, sentence: [Tri::name], [Tri::fullname], [Tri::sentence] [Tri::email_with_gravatar(#number>=1)]'
13
+ description: "This game will generate some usefull infor mation for your user such
14
+ as: name, full name, sentence: \n # To generate first or
15
+ last name\n [Tri::name], [Tri::fullname], [Tri::sentence]
16
+ [Tri::email_with_gravatar()]"
15
17
  email: hdtri.expert@gmail.com
16
18
  executables: []
17
19
  extensions: []