Class: Webtask::CLI

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/webtask/cli.rb

Constant Summary collapse

DEFAULT_PORT =
4567.freeze
DEFAULT_BIND =
"127.0.0.1".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



13
14
15
16
# File 'lib/webtask/cli.rb', line 13

def initialize
  @port = DEFAULT_PORT
  @bind = DEFAULT_BIND
end

Instance Attribute Details

#bindObject

Returns the value of attribute bind.



11
12
13
# File 'lib/webtask/cli.rb', line 11

def bind
  @bind
end

#portObject

Returns the value of attribute port.



10
11
12
# File 'lib/webtask/cli.rb', line 10

def port
  @port
end

Instance Method Details

#show_helpObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/webtask/cli.rb', line 18

def show_help
  puts "    webtask \u2013 A web GUI for your Rake tasks\n\n    Options:\n\n      -b   bind to a different address (default: \#{DEFAULT_BIND})\n      -p   bind to a different port (default: \#{DEFAULT_PORT})\n  HELP_TEXT\n  exit\nend\n"