| 
									
										
										
										
											2014-10-21 09:23:37 +02:00
										 |  |  | require 'twik' | 
					
						
							|  |  |  | require 'twik/cli/config' | 
					
						
							|  |  |  | require 'twik/cli/options' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Twik | 
					
						
							|  |  |  |   class Cli | 
					
						
							|  |  |  |     attr_reader :config | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def initialize(args) | 
					
						
							|  |  |  |       @config = Config.new(args) | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def twik | 
					
						
							|  |  |  |       @twik ||= Twik.new(config.privatekey, length: config.length, type: config.type.to_sym) | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def run | 
					
						
							| 
									
										
										
										
											2014-10-22 10:41:15 +02:00
										 |  |  |       puts twik.generate(config.tag, config.masterkey) | 
					
						
							| 
									
										
										
										
											2014-10-21 09:23:37 +02:00
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |