Class: Redirectly::Command

Inherits:
MisterBin::Command
  • Object
show all
Includes:
Colsole
Defined in:
lib/redirectly/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#config_pathObject (readonly)

Returns the value of attribute config_path.



23
24
25
# File 'lib/redirectly/command.rb', line 23

def config_path
  @config_path
end

#portObject (readonly)

Returns the value of attribute port.



23
24
25
# File 'lib/redirectly/command.rb', line 23

def port
  @port
end

Instance Method Details

#runObject



25
26
27
28
29
# File 'lib/redirectly/command.rb', line 25

def run
  @port = args['--port'].to_i
  @config_path = args['CONFIG'] || 'redirects.ini'
  args['--init'] ? init_file : start_server
end