Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host address for yard server #608

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/yard/cli/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ def optparse(*args)
opts.on('-d', '--daemon', 'Daemonizes the server process') do
server_options[:daemonize] = true
end
opts.on('-B HOST_NAME', '--bind', 'The host address to bind to') do |host|
server_options[:Host] = host.to_s
end
opts.on('-p PORT', '--port', 'Serves documentation on PORT') do |port|
server_options[:Port] = port.to_i
end
Expand Down
6 changes: 6 additions & 0 deletions spec/cli/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ def mock_file(filename, content = nil)
run '--daemon'
end

it "should accept -B, --bind" do
@server_options[:Host] = 'example.com'
run '-B', 'example.com'
run '--bind', 'example.com'
end

it "should accept -p, --port" do
@server_options[:Port] = 10
run '-p', '10'
Expand Down