Module: GitBro::ServeCommand

Defined in:
lib/git-bro/commands/serve.rb

Overview

Provides functions for implementing serve command

Instance Method Summary collapse

Instance Method Details

#do_serveObject



12
13
14
15
16
17
18
19
# File 'lib/git-bro/commands/serve.rb', line 12

def do_serve
  case GitBro::TARGET_OS
  when 'mswin32'
    system "ruby #{@options.gem_path}/sinatra/app.rb #{@options.repo_path}"
  when 'linux'
    system "/usr/bin/env ruby #{@options.gem_path}/sinatra/app.rb #{@options.repo_path}"
  end
end

#serve_arguments_valid?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/git-bro/commands/serve.rb', line 4

def serve_arguments_valid?
  @arguments.size <= 1 ? true : false
end

#serve_process_argumentsObject



8
9
10
# File 'lib/git-bro/commands/serve.rb', line 8

def serve_process_arguments
  @options.repo_path = @arguments.size == 1 ? @arguments.first : Dir.pwd
end