Class: Favidenticon::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/favidenticon/cli.rb

Instance Method Summary collapse

Instance Method Details

#generate(identity = SecureRandom.hex) ⇒ Object



17
18
19
20
21
22
# File 'lib/favidenticon/cli.rb', line 17

def generate(identity = SecureRandom.hex)
  size = options[:size] || 16
  grid = options[:grid] || 5
  blob = Generator.generate(identity, size, grid)
  File.open("favicon.ico", "wb") { |f| f.write(blob) }
end

#versionObject



9
10
11
# File 'lib/favidenticon/cli.rb', line 9

def version
  puts Favidenticon::VERSION
end