-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatagen.rb
More file actions
35 lines (32 loc) · 761 Bytes
/
datagen.rb
File metadata and controls
35 lines (32 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require 'rubygems'
require_relative 'lib/data_generator'
dg = DataGenerator.new
def paste_command
if RUBY_PLATFORM =~ /mswin/
'clip'
else
'pbcopy'
end
end
if ARGV[0] != nil
case ARGV[0]
when "email"
output = dg.random_email(ARGV[1])
`echo #{output} | #{paste_command}`
puts output
when "words"
output = dg.random_words(ARGV[1])
`echo #{output} | #{paste_command}`
puts output
when "special_chars"
output = dg.special_characters
`echo #{output} | #{paste_command}`
puts "Special characters copied to clipboard."
else
#TODO: Make this a better error message
puts"Invalid parameters."
end
else
#TODO: Make this a better error message
puts "Please specify a function."
end