After creating a content library, you can publish its content to other libraries.

This example uses the steps that are described in the Publish an Existing Content Library procedure.

Note: For related code samples, see the vSphere Automation SDK Ruby samples at GitHub.
...

# Create a new LibraryModel to specify changes.
library_spec =
   Com::Vmware::Content::LibraryModel.new

# Specify how the local library is published, using BASIC authentication.
publish_info =
   Com::Vmware::Content::Library::PublishInfo.new
# Can omit this value; if specified, it must be 'vcsp':
publish_info.user_name = 'vcsp'
publish_info.password = 'password'
publish_info.authentication_method =
   Com::Vmware::Content::Library::PublishInfo::AuthenticationMethod::BASIC
publish_info.published = true

# Update the LibraryModel object to contain the PublishInfo configuration.
library_spec.publish_info = publish_info

# Use the LibraryModel object to update the library instance.
# Only the fields with values result in updates.
local_library_stub =
   Com::Vmware::Content::LocalLibrary.new $my_stub_config
local_library_stub.update(library_id=$my_library_id,
                          update_spec=library_spec)