Class: Servel::CLI
- Inherits:
-
Object
- Object
- Servel::CLI
- Defined in:
- lib/servel/cli.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ CLI
constructor
A new instance of CLI.
- #path_map ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(argv) ⇒ CLI
Returns a new instance of CLI.
2 3 4 |
# File 'lib/servel/cli.rb', line 2 def initialize(argv) @argv = argv end |
Instance Method Details
#path_map ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/servel/cli.rb', line 10 def path_map @argv.map do |arg| root, url_root = arg.split(":" , 2) root = Pathname.new(root).realpath [root, url_root || "/"] end.to_h end |
#start ⇒ Object
6 7 8 |
# File 'lib/servel/cli.rb', line 6 def start Rack::Handler::Puma.run(Servel.build_app(path_map)) end |