id int32 0 24.9k | repo stringlengths 5 58 | path stringlengths 9 168 | func_name stringlengths 9 130 | original_string stringlengths 66 10.5k | language stringclasses 1
value | code stringlengths 66 10.5k | code_tokens list | docstring stringlengths 8 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 94 266 |
|---|---|---|---|---|---|---|---|---|---|---|---|
14,300 | Azure/azure-sdk-for-ruby | data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb | Azure::GraphRbac::V1_6.Applications.list_owners | def list_owners(application_object_id, custom_headers:nil)
response = list_owners_async(application_object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_owners(application_object_id, custom_headers:nil)
response = list_owners_async(application_object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_owners",
"(",
"application_object_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_owners_async",
"(",
"application_object_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",... | Directory objects that are owners of the application.
The owners are a set of non-admin users who are allowed to modify this
object.
@param application_object_id [String] The object ID of the application for
which to get owners.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will b... | [
"Directory",
"objects",
"that",
"are",
"owners",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb#L478-L481 |
14,301 | Azure/azure-sdk-for-ruby | data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb | Azure::GraphRbac::V1_6.Applications.list_key_credentials | def list_key_credentials(application_object_id, custom_headers:nil)
response = list_key_credentials_async(application_object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_key_credentials(application_object_id, custom_headers:nil)
response = list_key_credentials_async(application_object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_key_credentials",
"(",
"application_object_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_key_credentials_async",
"(",
"application_object_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unle... | Get the keyCredentials associated with an application.
@param application_object_id [String] Application object ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [KeyCredentialListResult] operation results. | [
"Get",
"the",
"keyCredentials",
"associated",
"with",
"an",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb#L671-L674 |
14,302 | Azure/azure-sdk-for-ruby | data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb | Azure::GraphRbac::V1_6.Applications.update_key_credentials | def update_key_credentials(application_object_id, parameters, custom_headers:nil)
response = update_key_credentials_async(application_object_id, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def update_key_credentials(application_object_id, parameters, custom_headers:nil)
response = update_key_credentials_async(application_object_id, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"update_key_credentials",
"(",
"application_object_id",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_key_credentials_async",
"(",
"application_object_id",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Update the keyCredentials associated with an application.
@param application_object_id [String] Application object ID.
@param parameters [KeyCredentialsUpdateParameters] Parameters to update the
keyCredentials of an existing application.
@param custom_headers [Hash{String => String}] A hash of custom headers that
... | [
"Update",
"the",
"keyCredentials",
"associated",
"with",
"an",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb#L760-L763 |
14,303 | Azure/azure-sdk-for-ruby | data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb | Azure::GraphRbac::V1_6.Applications.list_password_credentials | def list_password_credentials(application_object_id, custom_headers:nil)
response = list_password_credentials_async(application_object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_password_credentials(application_object_id, custom_headers:nil)
response = list_password_credentials_async(application_object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_password_credentials",
"(",
"application_object_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_password_credentials_async",
"(",
"application_object_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body... | Get the passwordCredentials associated with an application.
@param application_object_id [String] Application object ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PasswordCredentialListResult] operation results. | [
"Get",
"the",
"passwordCredentials",
"associated",
"with",
"an",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb#L850-L853 |
14,304 | Azure/azure-sdk-for-ruby | data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb | Azure::GraphRbac::V1_6.Applications.update_password_credentials | def update_password_credentials(application_object_id, parameters, custom_headers:nil)
response = update_password_credentials_async(application_object_id, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def update_password_credentials(application_object_id, parameters, custom_headers:nil)
response = update_password_credentials_async(application_object_id, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"update_password_credentials",
"(",
"application_object_id",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_password_credentials_async",
"(",
"application_object_id",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")... | Update passwordCredentials associated with an application.
@param application_object_id [String] Application object ID.
@param parameters [PasswordCredentialsUpdateParameters] Parameters to update
passwordCredentials of an existing application.
@param custom_headers [Hash{String => String}] A hash of custom header... | [
"Update",
"passwordCredentials",
"associated",
"with",
"an",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/applications.rb#L939-L942 |
14,305 | Azure/azure-sdk-for-ruby | management/azure_mgmt_authorization/lib/2018-07-01-preview/generated/azure_mgmt_authorization/deny_assignments.rb | Azure::Authorization::Mgmt::V2018_07_01_preview.DenyAssignments.get_by_id | def get_by_id(deny_assignment_id, custom_headers:nil)
response = get_by_id_async(deny_assignment_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_by_id(deny_assignment_id, custom_headers:nil)
response = get_by_id_async(deny_assignment_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_by_id",
"(",
"deny_assignment_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_by_id_async",
"(",
"deny_assignment_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
".",
... | Gets a deny assignment by ID.
@param deny_assignment_id [String] The fully qualified deny assignment ID.
For example, use the format,
/subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId}
for subscription level deny assignments, or
/providers/Microsoft.Authorization/denyAssign... | [
"Gets",
"a",
"deny",
"assignment",
"by",
"ID",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_authorization/lib/2018-07-01-preview/generated/azure_mgmt_authorization/deny_assignments.rb#L525-L528 |
14,306 | Azure/azure-sdk-for-ruby | management/azure_mgmt_iot_central/lib/2018-09-01/generated/azure_mgmt_iot_central/apps.rb | Azure::IotCentral::Mgmt::V2018_09_01.Apps.check_subdomain_availability | def check_subdomain_availability(operation_inputs, custom_headers:nil)
response = check_subdomain_availability_async(operation_inputs, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def check_subdomain_availability(operation_inputs, custom_headers:nil)
response = check_subdomain_availability_async(operation_inputs, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"check_subdomain_availability",
"(",
"operation_inputs",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"check_subdomain_availability_async",
"(",
"operation_inputs",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
... | Check if an IoT Central application subdomain is available.
@param operation_inputs [OperationInputs] Set the name parameter in the
OperationInputs structure to the subdomain of the IoT Central application to
check.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the ... | [
"Check",
"if",
"an",
"IoT",
"Central",
"application",
"subdomain",
"is",
"available",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_iot_central/lib/2018-09-01/generated/azure_mgmt_iot_central/apps.rb#L552-L555 |
14,307 | Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb | Azure::ApiManagement::Mgmt::V2018_01_01.NotificationRecipientEmail.check_entity_exists_with_http_info | def check_entity_exists_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers:nil)
check_entity_exists_async(resource_group_name, service_name, notification_name, email, custom_headers:custom_headers).value!
end | ruby | def check_entity_exists_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers:nil)
check_entity_exists_async(resource_group_name, service_name, notification_name, email, custom_headers:custom_headers).value!
end | [
"def",
"check_entity_exists_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_name",
",",
"email",
",",
"custom_headers",
":",
"nil",
")",
"check_entity_exists_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_nam... | Determine if Notification Recipient Email subscribed to the notification.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param notification_name [NotificationName] Notification Name Identifier.
Possible values include: 'Requ... | [
"Determine",
"if",
"Notification",
"Recipient",
"Email",
"subscribed",
"to",
"the",
"notification",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb#L175-L177 |
14,308 | Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb | Azure::ApiManagement::Mgmt::V2018_01_01.NotificationRecipientEmail.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers:nil)
create_or_update_async(resource_group_name, service_name, notification_name, email, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers:nil)
create_or_update_async(resource_group_name, service_name, notification_name, email, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_name",
",",
"email",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_name",
... | Adds the Email address to the list of Recipients for the Notification.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param notification_name [NotificationName] Notification Name Identifier.
Possible values include: 'Request... | [
"Adds",
"the",
"Email",
"address",
"to",
"the",
"list",
"of",
"Recipients",
"for",
"the",
"Notification",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb#L281-L283 |
14,309 | Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb | Azure::ApiManagement::Mgmt::V2018_01_01.NotificationRecipientEmail.delete_with_http_info | def delete_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers:nil)
delete_async(resource_group_name, service_name, notification_name, email, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, service_name, notification_name, email, custom_headers:nil)
delete_async(resource_group_name, service_name, notification_name, email, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_name",
",",
"email",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_name",
",",
"email",
",... | Removes the email from the list of Notification.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param notification_name [NotificationName] Notification Name Identifier.
Possible values include: 'RequestPublisherNotificationM... | [
"Removes",
"the",
"email",
"from",
"the",
"list",
"of",
"Notification",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_email.rb#L405-L407 |
14,310 | Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/network_interfaces.rb | Azure::Network::Mgmt::V2018_07_01.NetworkInterfaces.begin_update_tags_with_http_info | def begin_update_tags_with_http_info(resource_group_name, network_interface_name, parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, network_interface_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_tags_with_http_info(resource_group_name, network_interface_name, parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, network_interface_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_tags_with_http_info",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_tags_async",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"parameters",
",",
"cu... | Updates a network interface tags.
@param resource_group_name [String] The name of the resource group.
@param network_interface_name [String] The name of the network interface.
@param parameters [TagsObject] Parameters supplied to update network
interface tags.
@param custom_headers [Hash{String => String}] A hash... | [
"Updates",
"a",
"network",
"interface",
"tags",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/network_interfaces.rb#L731-L733 |
14,311 | Azure/azure-sdk-for-ruby | management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb | Azure::Resources::Mgmt::V2016_02_01.Providers.unregister | def unregister(resource_provider_namespace, custom_headers:nil)
response = unregister_async(resource_provider_namespace, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def unregister(resource_provider_namespace, custom_headers:nil)
response = unregister_async(resource_provider_namespace, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"unregister",
"(",
"resource_provider_namespace",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"unregister_async",
"(",
"resource_provider_namespace",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"... | Unregisters provider from a subscription.
@param resource_provider_namespace [String] Namespace of the resource
provider.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Provider] operation results. | [
"Unregisters",
"provider",
"from",
"a",
"subscription",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb#L34-L37 |
14,312 | Azure/azure-sdk-for-ruby | management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb | Azure::Resources::Mgmt::V2016_02_01.Providers.register | def register(resource_provider_namespace, custom_headers:nil)
response = register_async(resource_provider_namespace, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def register(resource_provider_namespace, custom_headers:nil)
response = register_async(resource_provider_namespace, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"register",
"(",
"resource_provider_namespace",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"register_async",
"(",
"resource_provider_namespace",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"resp... | Registers provider to be used with a subscription.
@param resource_provider_namespace [String] Namespace of the resource
provider.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Provider] operation results. | [
"Registers",
"provider",
"to",
"be",
"used",
"with",
"a",
"subscription",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb#L125-L128 |
14,313 | Azure/azure-sdk-for-ruby | management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb | Azure::Resources::Mgmt::V2016_02_01.Providers.get_with_http_info | def get_with_http_info(resource_provider_namespace, expand:nil, custom_headers:nil)
get_async(resource_provider_namespace, expand:expand, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_provider_namespace, expand:nil, custom_headers:nil)
get_async(resource_provider_namespace, expand:expand, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_provider_namespace",
",",
"expand",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_provider_namespace",
",",
"expand",
":",
"expand",
",",
"custom_headers",
":custom_headers",
")",
".",
"va... | Gets a resource provider.
@param resource_provider_namespace [String] Namespace of the resource
provider.
@param expand [String] The $expand query parameter. e.g. To include property
aliases in response, use $expand=resourceTypes/aliases.
@param custom_headers [Hash{String => String}] A hash of custom headers tha... | [
"Gets",
"a",
"resource",
"provider",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb#L331-L333 |
14,314 | Azure/azure-sdk-for-ruby | management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/certificates.rb | Azure::Logic::Mgmt::V2016_06_01.Certificates.get_with_http_info | def get_with_http_info(resource_group_name, integration_account_name, certificate_name, custom_headers:nil)
get_async(resource_group_name, integration_account_name, certificate_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, integration_account_name, certificate_name, custom_headers:nil)
get_async(resource_group_name, integration_account_name, certificate_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"certificate_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"certificate_name",
",",
"custom_headers... | Gets an integration account certificate.
@param resource_group_name [String] The resource group name.
@param integration_account_name [String] The integration account name.
@param certificate_name [String] The integration account certificate name.
@param custom_headers [Hash{String => String}] A hash of custom hea... | [
"Gets",
"an",
"integration",
"account",
"certificate",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/certificates.rb#L146-L148 |
14,315 | Azure/azure-sdk-for-ruby | management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/certificates.rb | Azure::Logic::Mgmt::V2016_06_01.Certificates.delete_with_http_info | def delete_with_http_info(resource_group_name, integration_account_name, certificate_name, custom_headers:nil)
delete_async(resource_group_name, integration_account_name, certificate_name, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, integration_account_name, certificate_name, custom_headers:nil)
delete_async(resource_group_name, integration_account_name, certificate_name, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"certificate_name",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"certificate_name",
",",
"custom_h... | Deletes an integration account certificate.
@param resource_group_name [String] The resource group name.
@param integration_account_name [String] The integration account name.
@param certificate_name [String] The integration account certificate name.
@param custom_headers [Hash{String => String}] A hash of custom ... | [
"Deletes",
"an",
"integration",
"account",
"certificate",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/certificates.rb#L361-L363 |
14,316 | Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/load_balancer_outbound_rules.rb | Azure::Network::Mgmt::V2019_02_01.LoadBalancerOutboundRules.get_with_http_info | def get_with_http_info(resource_group_name, load_balancer_name, outbound_rule_name, custom_headers:nil)
get_async(resource_group_name, load_balancer_name, outbound_rule_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, load_balancer_name, outbound_rule_name, custom_headers:nil)
get_async(resource_group_name, load_balancer_name, outbound_rule_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"load_balancer_name",
",",
"outbound_rule_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"load_balancer_name",
",",
"outbound_rule_name",
",",
"custom_headers",
":c... | Gets the specified load balancer outbound rule.
@param resource_group_name [String] The name of the resource group.
@param load_balancer_name [String] The name of the load balancer.
@param outbound_rule_name [String] The name of the outbound rule.
@param custom_headers [Hash{String => String}] A hash of custom hea... | [
"Gets",
"the",
"specified",
"load",
"balancer",
"outbound",
"rule",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/load_balancer_outbound_rules.rb#L143-L145 |
14,317 | Azure/azure-sdk-for-ruby | management/azure_mgmt_policy/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb | Azure::Policy::Mgmt::V2015_10_01_preview.PolicyAssignments.create_with_http_info | def create_with_http_info(scope, policy_assignment_name, parameters, custom_headers:nil)
create_async(scope, policy_assignment_name, parameters, custom_headers:custom_headers).value!
end | ruby | def create_with_http_info(scope, policy_assignment_name, parameters, custom_headers:nil)
create_async(scope, policy_assignment_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"create_with_http_info",
"(",
"scope",
",",
"policy_assignment_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"create_async",
"(",
"scope",
",",
"policy_assignment_name",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Creates a policy assignment.
Policy assignments are inherited by child resources. For example, when you
apply a policy to a resource group that policy is assigned to all resources
in the group.
@param scope [String] The scope of the policy assignment.
@param policy_assignment_name [String] The name of the policy... | [
"Creates",
"a",
"policy",
"assignment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb#L155-L157 |
14,318 | Azure/azure-sdk-for-ruby | management/azure_mgmt_policy/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb | Azure::Policy::Mgmt::V2015_10_01_preview.PolicyAssignments.delete_by_id | def delete_by_id(policy_assignment_id, custom_headers:nil)
response = delete_by_id_async(policy_assignment_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def delete_by_id(policy_assignment_id, custom_headers:nil)
response = delete_by_id_async(policy_assignment_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"delete_by_id",
"(",
"policy_assignment_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_by_id_async",
"(",
"policy_assignment_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",... | Deletes a policy assignment by ID.
When providing a scope for the assignment, use
'/subscriptions/{subscription-id}/' for subscriptions,
'/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for
resource groups, and
'/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers... | [
"Deletes",
"a",
"policy",
"assignment",
"by",
"ID",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb#L653-L656 |
14,319 | Azure/azure-sdk-for-ruby | management/azure_mgmt_policy/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb | Azure::Policy::Mgmt::V2015_10_01_preview.PolicyAssignments.get_by_id | def get_by_id(policy_assignment_id, custom_headers:nil)
response = get_by_id_async(policy_assignment_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_by_id(policy_assignment_id, custom_headers:nil)
response = get_by_id_async(policy_assignment_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_by_id",
"(",
"policy_assignment_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_by_id_async",
"(",
"policy_assignment_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
"."... | Gets a policy assignment by ID.
When providing a scope for the assignment, use
'/subscriptions/{subscription-id}/' for subscriptions,
'/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for
resource groups, and
'/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{r... | [
"Gets",
"a",
"policy",
"assignment",
"by",
"ID",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb#L898-L901 |
14,320 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.prepare | def prepare
fail "No value field set up for numeric tracker #{inspect}" unless options[:value]
fail "No categorizer set up for numeric tracker #{inspect}" unless options[:category]
unless options[:multiple]
@categorizer = create_lambda(options[:category])
@valueizer = create_lambda(... | ruby | def prepare
fail "No value field set up for numeric tracker #{inspect}" unless options[:value]
fail "No categorizer set up for numeric tracker #{inspect}" unless options[:category]
unless options[:multiple]
@categorizer = create_lambda(options[:category])
@valueizer = create_lambda(... | [
"def",
"prepare",
"fail",
"\"No value field set up for numeric tracker #{inspect}\"",
"unless",
"options",
"[",
":value",
"]",
"fail",
"\"No categorizer set up for numeric tracker #{inspect}\"",
"unless",
"options",
"[",
":category",
"]",
"unless",
"options",
"[",
":multiple",
... | Sets up the numeric value tracker. It will check whether the value and category
options are set that are used to extract and categorize the values during
parsing. Two lambda procedures are created for these tasks | [
"Sets",
"up",
"the",
"numeric",
"value",
"tracker",
".",
"It",
"will",
"check",
"whether",
"the",
"value",
"and",
"category",
"options",
"are",
"set",
"that",
"are",
"used",
"to",
"extract",
"and",
"categorize",
"the",
"values",
"during",
"parsing",
".",
"... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L8-L25 |
14,321 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.update | def update(request)
if options[:multiple]
found_categories = request.every(options[:category])
found_values = request.every(options[:value])
fail 'Capture mismatch for multiple values in a request' unless found_categories.length == found_values.length
found_categories.each_wit... | ruby | def update(request)
if options[:multiple]
found_categories = request.every(options[:category])
found_values = request.every(options[:value])
fail 'Capture mismatch for multiple values in a request' unless found_categories.length == found_values.length
found_categories.each_wit... | [
"def",
"update",
"(",
"request",
")",
"if",
"options",
"[",
":multiple",
"]",
"found_categories",
"=",
"request",
".",
"every",
"(",
"options",
"[",
":category",
"]",
")",
"found_values",
"=",
"request",
".",
"every",
"(",
"options",
"[",
":value",
"]",
... | Get the value information from the request and store it in the respective categories.
If a request can contain multiple usable values for this tracker, the :multiple option
should be set to true. In this case, all the values and respective categories will be
read from the request using the #every method from the fi... | [
"Get",
"the",
"value",
"information",
"from",
"the",
"request",
"and",
"store",
"it",
"in",
"the",
"respective",
"categories",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L40-L54 |
14,322 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.display_value | def display_value(value)
return '- ' if value.nil?
return '0 ' if value.zero?
case [Math.log10(value.abs).floor, 0].max
when 0...4 then '%d ' % value
when 4...7 then '%dk' % (value / 1000)
when 7...10 then '%dM' % (value / 1_000_000)
when 10...13 then '%dG' % (val... | ruby | def display_value(value)
return '- ' if value.nil?
return '0 ' if value.zero?
case [Math.log10(value.abs).floor, 0].max
when 0...4 then '%d ' % value
when 4...7 then '%dk' % (value / 1000)
when 7...10 then '%dM' % (value / 1_000_000)
when 10...13 then '%dG' % (val... | [
"def",
"display_value",
"(",
"value",
")",
"return",
"'- '",
"if",
"value",
".",
"nil?",
"return",
"'0 '",
"if",
"value",
".",
"zero?",
"case",
"[",
"Math",
".",
"log10",
"(",
"value",
".",
"abs",
")",
".",
"floor",
",",
"0",
"]",
".",
"max",
"when... | Display a value | [
"Display",
"a",
"value"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L73-L85 |
14,323 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.title | def title
@title ||= begin
if options[:title]
options[:title]
else
title_builder = ''
title_builder << "#{options[:value]} " if options[:value].is_a?(Symbol)
title_builder << (options[:category].is_a?(Symbol) ? "per #{options[:category]}" : 'per request')
... | ruby | def title
@title ||= begin
if options[:title]
options[:title]
else
title_builder = ''
title_builder << "#{options[:value]} " if options[:value].is_a?(Symbol)
title_builder << (options[:category].is_a?(Symbol) ? "per #{options[:category]}" : 'per request')
... | [
"def",
"title",
"@title",
"||=",
"begin",
"if",
"options",
"[",
":title",
"]",
"options",
"[",
":title",
"]",
"else",
"title_builder",
"=",
"''",
"title_builder",
"<<",
"\"#{options[:value]} \"",
"if",
"options",
"[",
":value",
"]",
".",
"is_a?",
"(",
"Symbo... | Returns the title of this tracker for reports | [
"Returns",
"the",
"title",
"of",
"this",
"tracker",
"for",
"reports"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L104-L115 |
14,324 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.to_yaml_object | def to_yaml_object
return nil if @categories.empty?
@categories.each do |cat, info|
info[:stddev] = stddev(cat)
info[:median] = median(cat) if info[:buckets]
info[:interval_95_percent] = percentile_interval(cat, 95) if info[:buckets]
end
@categories
end | ruby | def to_yaml_object
return nil if @categories.empty?
@categories.each do |cat, info|
info[:stddev] = stddev(cat)
info[:median] = median(cat) if info[:buckets]
info[:interval_95_percent] = percentile_interval(cat, 95) if info[:buckets]
end
@categories
end | [
"def",
"to_yaml_object",
"return",
"nil",
"if",
"@categories",
".",
"empty?",
"@categories",
".",
"each",
"do",
"|",
"cat",
",",
"info",
"|",
"info",
"[",
":stddev",
"]",
"=",
"stddev",
"(",
"cat",
")",
"info",
"[",
":median",
"]",
"=",
"median",
"(",
... | Returns all the categories and the tracked duration as a hash than can be exported to YAML | [
"Returns",
"all",
"the",
"categories",
"and",
"the",
"tracked",
"duration",
"as",
"a",
"hash",
"than",
"can",
"be",
"exported",
"to",
"YAML"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L118-L126 |
14,325 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.bucket_index | def bucket_index(value)
return 0 if value < @min_bucket_value
return @number_of_buckets - 1 if value >= @max_bucket_value
((Math.log(value) - Math.log(@min_bucket_value)) / @bucket_size).floor
end | ruby | def bucket_index(value)
return 0 if value < @min_bucket_value
return @number_of_buckets - 1 if value >= @max_bucket_value
((Math.log(value) - Math.log(@min_bucket_value)) / @bucket_size).floor
end | [
"def",
"bucket_index",
"(",
"value",
")",
"return",
"0",
"if",
"value",
"<",
"@min_bucket_value",
"return",
"@number_of_buckets",
"-",
"1",
"if",
"value",
">=",
"@max_bucket_value",
"(",
"(",
"Math",
".",
"log",
"(",
"value",
")",
"-",
"Math",
".",
"log",
... | Returns the bucket index for a value | [
"Returns",
"the",
"bucket",
"index",
"for",
"a",
"value"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L129-L134 |
14,326 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.bucket_value | def bucket_value(index, type = nil)
case type
when :begin, :start, :lower, :lower_bound then bucket_lower_bound(index)
when :end, :finish, :upper, :upper_bound then bucket_upper_bound(index)
else bucket_average_value(index)
end
end | ruby | def bucket_value(index, type = nil)
case type
when :begin, :start, :lower, :lower_bound then bucket_lower_bound(index)
when :end, :finish, :upper, :upper_bound then bucket_upper_bound(index)
else bucket_average_value(index)
end
end | [
"def",
"bucket_value",
"(",
"index",
",",
"type",
"=",
"nil",
")",
"case",
"type",
"when",
":begin",
",",
":start",
",",
":lower",
",",
":lower_bound",
"then",
"bucket_lower_bound",
"(",
"index",
")",
"when",
":end",
",",
":finish",
",",
":upper",
",",
"... | Returns a single value representing a bucket. | [
"Returns",
"a",
"single",
"value",
"representing",
"a",
"bucket",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L152-L158 |
14,327 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.percentile_index | def percentile_index(category, x, inclusive = false)
total_encountered = 0
@categories[category][:buckets].each_with_index do |count, index|
total_encountered += count
percentage = ((total_encountered.to_f / hits(category).to_f) * 100).floor
return index if (inclusive && percentage >... | ruby | def percentile_index(category, x, inclusive = false)
total_encountered = 0
@categories[category][:buckets].each_with_index do |count, index|
total_encountered += count
percentage = ((total_encountered.to_f / hits(category).to_f) * 100).floor
return index if (inclusive && percentage >... | [
"def",
"percentile_index",
"(",
"category",
",",
"x",
",",
"inclusive",
"=",
"false",
")",
"total_encountered",
"=",
"0",
"@categories",
"[",
"category",
"]",
"[",
":buckets",
"]",
".",
"each_with_index",
"do",
"|",
"count",
",",
"index",
"|",
"total_encount... | Returns the upper bound value that would include x% of the hits. | [
"Returns",
"the",
"upper",
"bound",
"value",
"that",
"would",
"include",
"x%",
"of",
"the",
"hits",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L171-L178 |
14,328 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.percentile_interval | def percentile_interval(category, x)
case x
when Range
lower, upper = percentile_indices(category, x.begin, x.end)
Range.new(bucket_lower_bound(lower), bucket_upper_bound(upper))
when Numeric
percentile_interval(category, Range.new((100 - x) / 2, (100 - (100 - x) / 2)))
e... | ruby | def percentile_interval(category, x)
case x
when Range
lower, upper = percentile_indices(category, x.begin, x.end)
Range.new(bucket_lower_bound(lower), bucket_upper_bound(upper))
when Numeric
percentile_interval(category, Range.new((100 - x) / 2, (100 - (100 - x) / 2)))
e... | [
"def",
"percentile_interval",
"(",
"category",
",",
"x",
")",
"case",
"x",
"when",
"Range",
"lower",
",",
"upper",
"=",
"percentile_indices",
"(",
"category",
",",
"x",
".",
"begin",
",",
"x",
".",
"end",
")",
"Range",
".",
"new",
"(",
"bucket_lower_boun... | Returns a percentile interval, i.e. the lower bound and the upper bound of the values
that represent the x%-interval for the bucketized dataset.
A 90% interval means that 5% of the values would have been lower than the lower bound and
5% would have been higher than the upper bound, leaving 90% of the values within ... | [
"Returns",
"a",
"percentile",
"interval",
"i",
".",
"e",
".",
"the",
"lower",
"bound",
"and",
"the",
"upper",
"bound",
"of",
"the",
"values",
"that",
"represent",
"the",
"x%",
"-",
"interval",
"for",
"the",
"bucketized",
"dataset",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L209-L219 |
14,329 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.statistics_header | def statistics_header(options)
[
{ title: options[:title], width: :rest },
{ title: 'Hits', align: :right, highlight: (options[:highlight] == :hits), min_width: 4 },
{ title: 'Sum', align: :right, highlight: (options[:highlight] == :sum), min_width: 6 },
{ title: 'Mean', ... | ruby | def statistics_header(options)
[
{ title: options[:title], width: :rest },
{ title: 'Hits', align: :right, highlight: (options[:highlight] == :hits), min_width: 4 },
{ title: 'Sum', align: :right, highlight: (options[:highlight] == :sum), min_width: 6 },
{ title: 'Mean', ... | [
"def",
"statistics_header",
"(",
"options",
")",
"[",
"{",
"title",
":",
"options",
"[",
":title",
"]",
",",
"width",
":",
":rest",
"}",
",",
"{",
"title",
":",
"'Hits'",
",",
"align",
":",
":right",
",",
"highlight",
":",
"(",
"options",
"[",
":high... | Returns the column header for a statistics table to report on the statistics result | [
"Returns",
"the",
"column",
"header",
"for",
"a",
"statistics",
"table",
"to",
"report",
"on",
"the",
"statistics",
"result"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L311-L322 |
14,330 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/numeric_value.rb | RequestLogAnalyzer::Tracker.NumericValue.statistics_row | def statistics_row(cat)
[cat, hits(cat), display_value(sum(cat)), display_value(mean(cat)), display_value(stddev(cat)),
display_value(min(cat)), display_value(max(cat)),
display_value(percentile_interval(cat, 95).begin) + '-' + display_value(percentile_interval(cat, 95).end)]
end | ruby | def statistics_row(cat)
[cat, hits(cat), display_value(sum(cat)), display_value(mean(cat)), display_value(stddev(cat)),
display_value(min(cat)), display_value(max(cat)),
display_value(percentile_interval(cat, 95).begin) + '-' + display_value(percentile_interval(cat, 95).end)]
end | [
"def",
"statistics_row",
"(",
"cat",
")",
"[",
"cat",
",",
"hits",
"(",
"cat",
")",
",",
"display_value",
"(",
"sum",
"(",
"cat",
")",
")",
",",
"display_value",
"(",
"mean",
"(",
"cat",
")",
")",
",",
"display_value",
"(",
"stddev",
"(",
"cat",
")... | Returns a row of statistics information for a report table, given a category | [
"Returns",
"a",
"row",
"of",
"statistics",
"information",
"for",
"a",
"report",
"table",
"given",
"a",
"category"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/numeric_value.rb#L325-L329 |
14,331 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/source/log_parser.rb | RequestLogAnalyzer::Source.LogParser.decompress_file? | def decompress_file?(filename)
nice_command = 'nice -n 5'
return "#{nice_command} gunzip -c -d #{filename}" if filename.match(/\.tar.gz$/) || filename.match(/\.tgz$/) || filename.match(/\.gz$/)
return "#{nice_command} bunzip2 -c -d #{filename}" if filename.match(/\.bz2$/)
return "#{nice_command... | ruby | def decompress_file?(filename)
nice_command = 'nice -n 5'
return "#{nice_command} gunzip -c -d #{filename}" if filename.match(/\.tar.gz$/) || filename.match(/\.tgz$/) || filename.match(/\.gz$/)
return "#{nice_command} bunzip2 -c -d #{filename}" if filename.match(/\.bz2$/)
return "#{nice_command... | [
"def",
"decompress_file?",
"(",
"filename",
")",
"nice_command",
"=",
"'nice -n 5'",
"return",
"\"#{nice_command} gunzip -c -d #{filename}\"",
"if",
"filename",
".",
"match",
"(",
"/",
"\\.",
"/",
")",
"||",
"filename",
".",
"match",
"(",
"/",
"\\.",
"/",
")",
... | Check if a file has a compressed extention in the filename.
If recognized, return the command string used to decompress the file | [
"Check",
"if",
"a",
"file",
"has",
"a",
"compressed",
"extention",
"in",
"the",
"filename",
".",
"If",
"recognized",
"return",
"the",
"command",
"string",
"used",
"to",
"decompress",
"the",
"file"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/source/log_parser.rb#L97-L105 |
14,332 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/source/log_parser.rb | RequestLogAnalyzer::Source.LogParser.parse_file | def parse_file(file, options = {}, &block)
if File.directory?(file)
parse_files(Dir["#{ file }/*"], options, &block)
return
end
@current_source = File.expand_path(file)
@source_changes_handler.call(:started, @current_source) if @source_changes_handler
if decompress_file?(... | ruby | def parse_file(file, options = {}, &block)
if File.directory?(file)
parse_files(Dir["#{ file }/*"], options, &block)
return
end
@current_source = File.expand_path(file)
@source_changes_handler.call(:started, @current_source) if @source_changes_handler
if decompress_file?(... | [
"def",
"parse_file",
"(",
"file",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"if",
"File",
".",
"directory?",
"(",
"file",
")",
"parse_files",
"(",
"Dir",
"[",
"\"#{ file }/*\"",
"]",
",",
"options",
",",
"block",
")",
"return",
"end",
"@... | Parses a log file. Creates an IO stream for the provided file, and sends it to parse_io for
further handling. This method supports progress updates that can be used to display a progressbar
If the logfile is compressed, it is uncompressed to stdout and read.
TODO: Check if IO.popen encounters problems with the give... | [
"Parses",
"a",
"log",
"file",
".",
"Creates",
"an",
"IO",
"stream",
"for",
"the",
"provided",
"file",
"and",
"sends",
"it",
"to",
"parse_io",
"for",
"further",
"handling",
".",
"This",
"method",
"supports",
"progress",
"updates",
"that",
"can",
"be",
"used... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/source/log_parser.rb#L116-L144 |
14,333 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/source/log_parser.rb | RequestLogAnalyzer::Source.LogParser.update_current_request | def update_current_request(request_data, &block) # :yields: request
if alternative_header_line?(request_data)
if @current_request
@current_request << request_data
else
@current_request = @file_format.request(request_data)
end
elsif header_line?(request_data)
... | ruby | def update_current_request(request_data, &block) # :yields: request
if alternative_header_line?(request_data)
if @current_request
@current_request << request_data
else
@current_request = @file_format.request(request_data)
end
elsif header_line?(request_data)
... | [
"def",
"update_current_request",
"(",
"request_data",
",",
"&",
"block",
")",
"# :yields: request",
"if",
"alternative_header_line?",
"(",
"request_data",
")",
"if",
"@current_request",
"@current_request",
"<<",
"request_data",
"else",
"@current_request",
"=",
"@file_form... | Combines the different lines of a request into a single Request object. It will start a
new request when a header line is encountered en will emit the request when a footer line
is encountered.
Combining the lines is done using heuristics. Problems can occur in this process. The
current parse strategy defines how ... | [
"Combines",
"the",
"different",
"lines",
"of",
"a",
"request",
"into",
"a",
"single",
"Request",
"object",
".",
"It",
"will",
"start",
"a",
"new",
"request",
"when",
"a",
"header",
"line",
"is",
"encountered",
"en",
"will",
"emit",
"the",
"request",
"when"... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/source/log_parser.rb#L285-L320 |
14,334 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/source/log_parser.rb | RequestLogAnalyzer::Source.LogParser.handle_request | def handle_request(request, &_block) # :yields: :request, request
@parsed_requests += 1
request.validate
accepted = block_given? ? yield(request) : true
@skipped_requests += 1 unless accepted
end | ruby | def handle_request(request, &_block) # :yields: :request, request
@parsed_requests += 1
request.validate
accepted = block_given? ? yield(request) : true
@skipped_requests += 1 unless accepted
end | [
"def",
"handle_request",
"(",
"request",
",",
"&",
"_block",
")",
"# :yields: :request, request",
"@parsed_requests",
"+=",
"1",
"request",
".",
"validate",
"accepted",
"=",
"block_given?",
"?",
"yield",
"(",
"request",
")",
":",
"true",
"@skipped_requests",
"+=",... | Handles the parsed request by sending it into the pipeline.
- It will call RequestLogAnalyzer::Request#validate on the request instance
- It will send the request into the pipeline, checking whether it was accepted by all the filters.
- It will update the parsed_requests and skipped_requests variables accordingly
... | [
"Handles",
"the",
"parsed",
"request",
"by",
"sending",
"it",
"into",
"the",
"pipeline",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/source/log_parser.rb#L329-L334 |
14,335 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/file_format.rb | RequestLogAnalyzer::FileFormat.CommonRegularExpressions.hostname_or_ip_address | def hostname_or_ip_address(blank = false)
regexp = Regexp.union(hostname, ip_address)
add_blank_option(regexp, blank)
end | ruby | def hostname_or_ip_address(blank = false)
regexp = Regexp.union(hostname, ip_address)
add_blank_option(regexp, blank)
end | [
"def",
"hostname_or_ip_address",
"(",
"blank",
"=",
"false",
")",
"regexp",
"=",
"Regexp",
".",
"union",
"(",
"hostname",
",",
"ip_address",
")",
"add_blank_option",
"(",
"regexp",
",",
"blank",
")",
"end"
] | Creates a regular expression to match a hostname or ip address | [
"Creates",
"a",
"regular",
"expression",
"to",
"match",
"a",
"hostname",
"or",
"ip",
"address"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/file_format.rb#L134-L137 |
14,336 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/file_format.rb | RequestLogAnalyzer::FileFormat.CommonRegularExpressions.timestamp | def timestamp(format_string, blank = false)
regexp = ''
format_string.scan(/([^%]*)(?:%([A-Za-z%]))?/) do |literal, variable|
regexp << Regexp.quote(literal)
if variable
if TIMESTAMP_PARTS.key?(variable)
regexp << TIMESTAMP_PARTS[variable]
else
fai... | ruby | def timestamp(format_string, blank = false)
regexp = ''
format_string.scan(/([^%]*)(?:%([A-Za-z%]))?/) do |literal, variable|
regexp << Regexp.quote(literal)
if variable
if TIMESTAMP_PARTS.key?(variable)
regexp << TIMESTAMP_PARTS[variable]
else
fai... | [
"def",
"timestamp",
"(",
"format_string",
",",
"blank",
"=",
"false",
")",
"regexp",
"=",
"''",
"format_string",
".",
"scan",
"(",
"/",
"/",
")",
"do",
"|",
"literal",
",",
"variable",
"|",
"regexp",
"<<",
"Regexp",
".",
"quote",
"(",
"literal",
")",
... | Create a regular expression for a timestamp, generated by a strftime call.
Provide the format string to construct a matching regular expression.
Set blank to true to allow and empty string, or set blank to a string to set
a substitute for the nil value. | [
"Create",
"a",
"regular",
"expression",
"for",
"a",
"timestamp",
"generated",
"by",
"a",
"strftime",
"call",
".",
"Provide",
"the",
"format",
"string",
"to",
"construct",
"a",
"matching",
"regular",
"expression",
".",
"Set",
"blank",
"to",
"true",
"to",
"all... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/file_format.rb#L143-L157 |
14,337 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/file_format.rb | RequestLogAnalyzer::FileFormat.CommonRegularExpressions.add_blank_option | def add_blank_option(regexp, blank)
case blank
when String then Regexp.union(regexp, Regexp.new(Regexp.quote(blank)))
when true then Regexp.union(regexp, //)
else regexp
end
end | ruby | def add_blank_option(regexp, blank)
case blank
when String then Regexp.union(regexp, Regexp.new(Regexp.quote(blank)))
when true then Regexp.union(regexp, //)
else regexp
end
end | [
"def",
"add_blank_option",
"(",
"regexp",
",",
"blank",
")",
"case",
"blank",
"when",
"String",
"then",
"Regexp",
".",
"union",
"(",
"regexp",
",",
"Regexp",
".",
"new",
"(",
"Regexp",
".",
"quote",
"(",
"blank",
")",
")",
")",
"when",
"true",
"then",
... | Allow the field to be blank if this option is given. This can be true to
allow an empty string or a string alternative for the nil value. | [
"Allow",
"the",
"field",
"to",
"be",
"blank",
"if",
"this",
"option",
"is",
"given",
".",
"This",
"can",
"be",
"true",
"to",
"allow",
"an",
"empty",
"string",
"or",
"a",
"string",
"alternative",
"for",
"the",
"nil",
"value",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/file_format.rb#L184-L190 |
14,338 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/file_format.rb | RequestLogAnalyzer::FileFormat.Base.valid_line_definitions? | def valid_line_definitions?
line_definitions.any? { |(_, ld)| ld.header } && line_definitions.any? { |(_, ld)| ld.footer }
end | ruby | def valid_line_definitions?
line_definitions.any? { |(_, ld)| ld.header } && line_definitions.any? { |(_, ld)| ld.footer }
end | [
"def",
"valid_line_definitions?",
"line_definitions",
".",
"any?",
"{",
"|",
"(",
"_",
",",
"ld",
")",
"|",
"ld",
".",
"header",
"}",
"&&",
"line_definitions",
".",
"any?",
"{",
"|",
"(",
"_",
",",
"ld",
")",
"|",
"ld",
".",
"footer",
"}",
"end"
] | Checks whether the line definitions form a valid language.
A file format should have at least a header and a footer line type | [
"Checks",
"whether",
"the",
"line",
"definitions",
"form",
"a",
"valid",
"language",
".",
"A",
"file",
"format",
"should",
"have",
"at",
"least",
"a",
"header",
"and",
"a",
"footer",
"line",
"type"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/file_format.rb#L277-L279 |
14,339 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/file_format.rb | RequestLogAnalyzer::FileFormat.Base.parse_line | def parse_line(line, &warning_handler)
line_definitions.each do |_lt, definition|
match = definition.matches(line, &warning_handler)
return match if match
end
nil
end | ruby | def parse_line(line, &warning_handler)
line_definitions.each do |_lt, definition|
match = definition.matches(line, &warning_handler)
return match if match
end
nil
end | [
"def",
"parse_line",
"(",
"line",
",",
"&",
"warning_handler",
")",
"line_definitions",
".",
"each",
"do",
"|",
"_lt",
",",
"definition",
"|",
"match",
"=",
"definition",
".",
"matches",
"(",
"line",
",",
"warning_handler",
")",
"return",
"match",
"if",
"m... | Parses a line by trying to parse it using every line definition in this file format | [
"Parses",
"a",
"line",
"by",
"trying",
"to",
"parse",
"it",
"using",
"every",
"line",
"definition",
"in",
"this",
"file",
"format"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/file_format.rb#L297-L304 |
14,340 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/aggregator/summarizer.rb | RequestLogAnalyzer::Aggregator.Summarizer.to_yaml | def to_yaml
require 'yaml'
trackers_export = @trackers.reduce({}) do |export, tracker|
export[tracker.title] = tracker.to_yaml_object; export
end
YAML.dump(trackers_export)
end | ruby | def to_yaml
require 'yaml'
trackers_export = @trackers.reduce({}) do |export, tracker|
export[tracker.title] = tracker.to_yaml_object; export
end
YAML.dump(trackers_export)
end | [
"def",
"to_yaml",
"require",
"'yaml'",
"trackers_export",
"=",
"@trackers",
".",
"reduce",
"(",
"{",
"}",
")",
"do",
"|",
"export",
",",
"tracker",
"|",
"export",
"[",
"tracker",
".",
"title",
"]",
"=",
"tracker",
".",
"to_yaml_object",
";",
"export",
"e... | Exports all the tracker results to YAML. It will call the to_yaml_object method
for every tracker and combines these into a single YAML export. | [
"Exports",
"all",
"the",
"tracker",
"results",
"to",
"YAML",
".",
"It",
"will",
"call",
"the",
"to_yaml_object",
"method",
"for",
"every",
"tracker",
"and",
"combines",
"these",
"into",
"a",
"single",
"YAML",
"export",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/aggregator/summarizer.rb#L80-L86 |
14,341 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/frequency.rb | RequestLogAnalyzer::Tracker.Frequency.prepare | def prepare
options[:category] = options[:value] if options[:value] && !options[:category]
fail "No categorizer set up for category tracker #{inspect}" unless options[:category]
@categorizer = create_lambda(options[:category]) unless options[:multiple]
# Initialize the categories. Use the list... | ruby | def prepare
options[:category] = options[:value] if options[:value] && !options[:category]
fail "No categorizer set up for category tracker #{inspect}" unless options[:category]
@categorizer = create_lambda(options[:category]) unless options[:multiple]
# Initialize the categories. Use the list... | [
"def",
"prepare",
"options",
"[",
":category",
"]",
"=",
"options",
"[",
":value",
"]",
"if",
"options",
"[",
":value",
"]",
"&&",
"!",
"options",
"[",
":category",
"]",
"fail",
"\"No categorizer set up for category tracker #{inspect}\"",
"unless",
"options",
"[",... | Check if categories are set up | [
"Check",
"if",
"categories",
"are",
"set",
"up"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/frequency.rb#L26-L35 |
14,342 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker.rb | RequestLogAnalyzer::Tracker.Base.setup_should_update_checks! | def setup_should_update_checks!
@should_update_checks = []
@should_update_checks.push(lambda { |request| request.has_line_type?(options[:line_type]) }) if options[:line_type]
@should_update_checks.push(options[:if]) if options[:if].respond_to?(:call)
@should_update_checks.push(lambda { |request|... | ruby | def setup_should_update_checks!
@should_update_checks = []
@should_update_checks.push(lambda { |request| request.has_line_type?(options[:line_type]) }) if options[:line_type]
@should_update_checks.push(options[:if]) if options[:if].respond_to?(:call)
@should_update_checks.push(lambda { |request|... | [
"def",
"setup_should_update_checks!",
"@should_update_checks",
"=",
"[",
"]",
"@should_update_checks",
".",
"push",
"(",
"lambda",
"{",
"|",
"request",
"|",
"request",
".",
"has_line_type?",
"(",
"options",
"[",
":line_type",
"]",
")",
"}",
")",
"if",
"options",... | Initialize the class
Note that the options are only applicable if should_update? is not overwritten
by the inheriting class.
=== Options
* <tt>:if</tt> Handle request if this proc is true for the handled request.
* <tt>:unless</tt> Handle request if this proc is false for the handled request.
* <tt>:line_type</t... | [
"Initialize",
"the",
"class",
"Note",
"that",
"the",
"options",
"are",
"only",
"applicable",
"if",
"should_update?",
"is",
"not",
"overwritten",
"by",
"the",
"inheriting",
"class",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker.rb#L28-L35 |
14,343 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker.rb | RequestLogAnalyzer::Tracker.Base.create_lambda | def create_lambda(arg)
case arg
when Proc then arg
when Symbol then lambda { |request| request[arg] }
else fail "Canot create a lambda expression from this argument: #{arg.inspect}!"
end
end | ruby | def create_lambda(arg)
case arg
when Proc then arg
when Symbol then lambda { |request| request[arg] }
else fail "Canot create a lambda expression from this argument: #{arg.inspect}!"
end
end | [
"def",
"create_lambda",
"(",
"arg",
")",
"case",
"arg",
"when",
"Proc",
"then",
"arg",
"when",
"Symbol",
"then",
"lambda",
"{",
"|",
"request",
"|",
"request",
"[",
"arg",
"]",
"}",
"else",
"fail",
"\"Canot create a lambda expression from this argument: #{arg.insp... | Creates a lambda expression to return a static field from a request. If the
argument already is a lambda exprssion, it will simply return the argument. | [
"Creates",
"a",
"lambda",
"expression",
"to",
"return",
"a",
"static",
"field",
"from",
"a",
"request",
".",
"If",
"the",
"argument",
"already",
"is",
"a",
"lambda",
"exprssion",
"it",
"will",
"simply",
"return",
"the",
"argument",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker.rb#L39-L45 |
14,344 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/line_definition.rb | RequestLogAnalyzer.LineDefinition.match_for | def match_for(line, request, &warning_handler)
if match_info = matches(line, &warning_handler)
convert_captured_values(match_info[:captures], request)
else
false
end
end | ruby | def match_for(line, request, &warning_handler)
if match_info = matches(line, &warning_handler)
convert_captured_values(match_info[:captures], request)
else
false
end
end | [
"def",
"match_for",
"(",
"line",
",",
"request",
",",
"&",
"warning_handler",
")",
"if",
"match_info",
"=",
"matches",
"(",
"line",
",",
"warning_handler",
")",
"convert_captured_values",
"(",
"match_info",
"[",
":captures",
"]",
",",
"request",
")",
"else",
... | matches the line and converts the captured values using the request's
convert_value function. | [
"matches",
"the",
"line",
"and",
"converts",
"the",
"captured",
"values",
"using",
"the",
"request",
"s",
"convert_value",
"function",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/line_definition.rb#L104-L110 |
14,345 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/request.rb | RequestLogAnalyzer.Request.add_parsed_line | def add_parsed_line(parsed_line)
value_hash = parsed_line[:line_definition].convert_captured_values(parsed_line[:captures], self)
value_hash[:line_type] = parsed_line[:line_definition].name
value_hash[:lineno] = parsed_line[:lineno]
value_hash[:source] = parsed_line[:source]
value_hash[:co... | ruby | def add_parsed_line(parsed_line)
value_hash = parsed_line[:line_definition].convert_captured_values(parsed_line[:captures], self)
value_hash[:line_type] = parsed_line[:line_definition].name
value_hash[:lineno] = parsed_line[:lineno]
value_hash[:source] = parsed_line[:source]
value_hash[:co... | [
"def",
"add_parsed_line",
"(",
"parsed_line",
")",
"value_hash",
"=",
"parsed_line",
"[",
":line_definition",
"]",
".",
"convert_captured_values",
"(",
"parsed_line",
"[",
":captures",
"]",
",",
"self",
")",
"value_hash",
"[",
":line_type",
"]",
"=",
"parsed_line"... | Adds another line to the request when it is parsed in the LogParser.
The line should be provided as a hash with the attributes line_definition, :captures,
:lineno and :source set. This function is called from LogParser. | [
"Adds",
"another",
"line",
"to",
"the",
"request",
"when",
"it",
"is",
"parsed",
"in",
"the",
"LogParser",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/request.rb#L133-L140 |
14,346 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/request.rb | RequestLogAnalyzer.Request.add_line_hash | def add_line_hash(value_hash)
@lines << value_hash
if value_hash[:compound]
value_hash.each do |key, value|
if value_hash[:compound].include?(key)
@attributes[key] = [] if @attributes[key].nil?
@attributes[key] = [@attributes[key]] unless @attributes[key].is_a?(Arra... | ruby | def add_line_hash(value_hash)
@lines << value_hash
if value_hash[:compound]
value_hash.each do |key, value|
if value_hash[:compound].include?(key)
@attributes[key] = [] if @attributes[key].nil?
@attributes[key] = [@attributes[key]] unless @attributes[key].is_a?(Arra... | [
"def",
"add_line_hash",
"(",
"value_hash",
")",
"@lines",
"<<",
"value_hash",
"if",
"value_hash",
"[",
":compound",
"]",
"value_hash",
".",
"each",
"do",
"|",
"key",
",",
"value",
"|",
"if",
"value_hash",
"[",
":compound",
"]",
".",
"include?",
"(",
"key",... | Adds another line to the request using a plain hash.
The line should be provides as a hash of the fields parsed from the line. | [
"Adds",
"another",
"line",
"to",
"the",
"request",
"using",
"a",
"plain",
"hash",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/request.rb#L145-L160 |
14,347 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/request.rb | RequestLogAnalyzer.Request.has_line_type? | def has_line_type?(line_type)
return true if @lines.length == 1 && @lines[0][:line_type] == line_type.to_sym
@lines.find { |l| l[:line_type] == line_type.to_sym }
end | ruby | def has_line_type?(line_type)
return true if @lines.length == 1 && @lines[0][:line_type] == line_type.to_sym
@lines.find { |l| l[:line_type] == line_type.to_sym }
end | [
"def",
"has_line_type?",
"(",
"line_type",
")",
"return",
"true",
"if",
"@lines",
".",
"length",
"==",
"1",
"&&",
"@lines",
"[",
"0",
"]",
"[",
":line_type",
"]",
"==",
"line_type",
".",
"to_sym",
"@lines",
".",
"find",
"{",
"|",
"l",
"|",
"l",
"[",
... | Checks whether the given line type was parsed from the log file for this request | [
"Checks",
"whether",
"the",
"given",
"line",
"type",
"was",
"parsed",
"from",
"the",
"log",
"file",
"for",
"this",
"request"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/request.rb#L169-L172 |
14,348 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/request.rb | RequestLogAnalyzer.Request.every | def every(field)
@lines.reduce([]) { |result, fields| result << fields[field] if fields.key?(field); result }
end | ruby | def every(field)
@lines.reduce([]) { |result, fields| result << fields[field] if fields.key?(field); result }
end | [
"def",
"every",
"(",
"field",
")",
"@lines",
".",
"reduce",
"(",
"[",
"]",
")",
"{",
"|",
"result",
",",
"fields",
"|",
"result",
"<<",
"fields",
"[",
"field",
"]",
"if",
"fields",
".",
"key?",
"(",
"field",
")",
";",
"result",
"}",
"end"
] | Returns an array of all the "field" values that were captured for this request | [
"Returns",
"an",
"array",
"of",
"all",
"the",
"field",
"values",
"that",
"were",
"captured",
"for",
"this",
"request"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/request.rb#L186-L188 |
14,349 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/request.rb | RequestLogAnalyzer.Request.completed? | def completed?
header_found, footer_found = false, false
@lines.each do |line|
line_def = file_format.line_definitions[line[:line_type]]
header_found = true if line_def.header
footer_found = true if line_def.footer
end
header_found && footer_found
end | ruby | def completed?
header_found, footer_found = false, false
@lines.each do |line|
line_def = file_format.line_definitions[line[:line_type]]
header_found = true if line_def.header
footer_found = true if line_def.footer
end
header_found && footer_found
end | [
"def",
"completed?",
"header_found",
",",
"footer_found",
"=",
"false",
",",
"false",
"@lines",
".",
"each",
"do",
"|",
"line",
"|",
"line_def",
"=",
"file_format",
".",
"line_definitions",
"[",
"line",
"[",
":line_type",
"]",
"]",
"header_found",
"=",
"true... | Checks whether this request is completed. A completed request contains both a parsed header
line and a parsed footer line. Not that calling this function in single line mode will always
return false. | [
"Checks",
"whether",
"this",
"request",
"is",
"completed",
".",
"A",
"completed",
"request",
"contains",
"both",
"a",
"parsed",
"header",
"line",
"and",
"a",
"parsed",
"footer",
"line",
".",
"Not",
"that",
"calling",
"this",
"function",
"in",
"single",
"line... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/request.rb#L199-L207 |
14,350 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/traffic.rb | RequestLogAnalyzer::Tracker.Traffic.prepare | def prepare
options[:value] = options[:traffic] if options[:traffic]
options[:total] = true
super
@number_of_buckets = options[:number_of_buckets] || 1000
@min_bucket_value = options[:min_bucket_value] ? options[:min_bucket_value].to_f : 1
@max_bucket_value = options[:max_bucket_v... | ruby | def prepare
options[:value] = options[:traffic] if options[:traffic]
options[:total] = true
super
@number_of_buckets = options[:number_of_buckets] || 1000
@min_bucket_value = options[:min_bucket_value] ? options[:min_bucket_value].to_f : 1
@max_bucket_value = options[:max_bucket_v... | [
"def",
"prepare",
"options",
"[",
":value",
"]",
"=",
"options",
"[",
":traffic",
"]",
"if",
"options",
"[",
":traffic",
"]",
"options",
"[",
":total",
"]",
"=",
"true",
"super",
"@number_of_buckets",
"=",
"options",
"[",
":number_of_buckets",
"]",
"||",
"... | Check if duration and catagory option have been received, | [
"Check",
"if",
"duration",
"and",
"catagory",
"option",
"have",
"been",
"received"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/traffic.rb#L13-L24 |
14,351 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/filter/field.rb | RequestLogAnalyzer::Filter.Field.filter | def filter(request)
found_field = request.every(@field).any? { |value| @value === value.to_s }
return nil if !found_field && @mode == :select
return nil if found_field && @mode == :reject
request
end | ruby | def filter(request)
found_field = request.every(@field).any? { |value| @value === value.to_s }
return nil if !found_field && @mode == :select
return nil if found_field && @mode == :reject
request
end | [
"def",
"filter",
"(",
"request",
")",
"found_field",
"=",
"request",
".",
"every",
"(",
"@field",
")",
".",
"any?",
"{",
"|",
"value",
"|",
"@value",
"===",
"value",
".",
"to_s",
"}",
"return",
"nil",
"if",
"!",
"found_field",
"&&",
"@mode",
"==",
":... | Keep request if @mode == :select and request has the field and value.
Drop request if @mode == :reject and request has the field and value.
Returns nil otherwise.
<tt>request</tt> Request Object | [
"Keep",
"request",
"if"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/filter/field.rb#L32-L37 |
14,352 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/output/html.rb | RequestLogAnalyzer::Output.HTML.header | def header
@io.content_type = content_type if @io.respond_to?(:content_type)
@io << '<html>'
@io << tag(:head) do |headers|
headers << tag(:title, 'Request-log-analyzer report')
headers << tag(:style, '
body {
font: normal 11px auto "Trebuchet MS", Verdana, Arial, Hel... | ruby | def header
@io.content_type = content_type if @io.respond_to?(:content_type)
@io << '<html>'
@io << tag(:head) do |headers|
headers << tag(:title, 'Request-log-analyzer report')
headers << tag(:style, '
body {
font: normal 11px auto "Trebuchet MS", Verdana, Arial, Hel... | [
"def",
"header",
"@io",
".",
"content_type",
"=",
"content_type",
"if",
"@io",
".",
"respond_to?",
"(",
":content_type",
")",
"@io",
"<<",
"'<html>'",
"@io",
"<<",
"tag",
"(",
":head",
")",
"do",
"|",
"headers",
"|",
"headers",
"<<",
"tag",
"(",
":title"... | Genrate HTML header and associated stylesheet | [
"Genrate",
"HTML",
"header",
"and",
"associated",
"stylesheet"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/output/html.rb#L76-L147 |
14,353 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/controller.rb | RequestLogAnalyzer.Controller.handle_source_change | def handle_source_change(change, filename)
@aggregators.each { |agg| agg.source_change(change, File.expand_path(filename, Dir.pwd)) }
end | ruby | def handle_source_change(change, filename)
@aggregators.each { |agg| agg.source_change(change, File.expand_path(filename, Dir.pwd)) }
end | [
"def",
"handle_source_change",
"(",
"change",
",",
"filename",
")",
"@aggregators",
".",
"each",
"{",
"|",
"agg",
"|",
"agg",
".",
"source_change",
"(",
"change",
",",
"File",
".",
"expand_path",
"(",
"filename",
",",
"Dir",
".",
"pwd",
")",
")",
"}",
... | Source change handler | [
"Source",
"change",
"handler"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/controller.rb#L282-L284 |
14,354 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/controller.rb | RequestLogAnalyzer.Controller.add_filter | def add_filter(filter, filter_options = {})
filter = RequestLogAnalyzer::Filter.const_get(RequestLogAnalyzer.to_camelcase(filter)) if filter.is_a?(Symbol)
@filters << filter.new(source.file_format, @options.merge(filter_options))
end | ruby | def add_filter(filter, filter_options = {})
filter = RequestLogAnalyzer::Filter.const_get(RequestLogAnalyzer.to_camelcase(filter)) if filter.is_a?(Symbol)
@filters << filter.new(source.file_format, @options.merge(filter_options))
end | [
"def",
"add_filter",
"(",
"filter",
",",
"filter_options",
"=",
"{",
"}",
")",
"filter",
"=",
"RequestLogAnalyzer",
"::",
"Filter",
".",
"const_get",
"(",
"RequestLogAnalyzer",
".",
"to_camelcase",
"(",
"filter",
")",
")",
"if",
"filter",
".",
"is_a?",
"(",
... | Adds a request filter to the controller. | [
"Adds",
"a",
"request",
"filter",
"to",
"the",
"controller",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/controller.rb#L296-L299 |
14,355 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/controller.rb | RequestLogAnalyzer.Controller.filter_request | def filter_request(request)
@filters.each do |filter|
request = filter.filter(request)
return nil if request.nil?
end
request
end | ruby | def filter_request(request)
@filters.each do |filter|
request = filter.filter(request)
return nil if request.nil?
end
request
end | [
"def",
"filter_request",
"(",
"request",
")",
"@filters",
".",
"each",
"do",
"|",
"filter",
"|",
"request",
"=",
"filter",
".",
"filter",
"(",
"request",
")",
"return",
"nil",
"if",
"request",
".",
"nil?",
"end",
"request",
"end"
] | Push a request through the entire filterchain (@filters).
<tt>request</tt> The request to filter.
Returns the filtered request or nil. | [
"Push",
"a",
"request",
"through",
"the",
"entire",
"filterchain",
"("
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/controller.rb#L304-L310 |
14,356 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/controller.rb | RequestLogAnalyzer.Controller.aggregate_request | def aggregate_request(request)
return false unless request
@aggregators.each { |agg| agg.aggregate(request) }
true
end | ruby | def aggregate_request(request)
return false unless request
@aggregators.each { |agg| agg.aggregate(request) }
true
end | [
"def",
"aggregate_request",
"(",
"request",
")",
"return",
"false",
"unless",
"request",
"@aggregators",
".",
"each",
"{",
"|",
"agg",
"|",
"agg",
".",
"aggregate",
"(",
"request",
")",
"}",
"true",
"end"
] | Push a request to all the aggregators (@aggregators).
<tt>request</tt> The request to push to the aggregators. | [
"Push",
"a",
"request",
"to",
"all",
"the",
"aggregators",
"("
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/controller.rb#L314-L318 |
14,357 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/controller.rb | RequestLogAnalyzer.Controller.run! | def run!
# @aggregators.each{|agg| p agg}
@aggregators.each { |agg| agg.prepare }
install_signal_handlers
@source.each_request do |request|
break if @interrupted
aggregate_request(filter_request(request))
end
@aggregators.each { |agg| agg.finalize }
@output.... | ruby | def run!
# @aggregators.each{|agg| p agg}
@aggregators.each { |agg| agg.prepare }
install_signal_handlers
@source.each_request do |request|
break if @interrupted
aggregate_request(filter_request(request))
end
@aggregators.each { |agg| agg.finalize }
@output.... | [
"def",
"run!",
"# @aggregators.each{|agg| p agg}",
"@aggregators",
".",
"each",
"{",
"|",
"agg",
"|",
"agg",
".",
"prepare",
"}",
"install_signal_handlers",
"@source",
".",
"each_request",
"do",
"|",
"request",
"|",
"break",
"if",
"@interrupted",
"aggregate_request"... | Runs RequestLogAnalyzer
1. Call prepare on every aggregator
2. Generate requests from source object
3. Filter out unwanted requests
4. Call aggregate for remaning requests on every aggregator
4. Call finalize on every aggregator
5. Call report on every aggregator
6. Finalize Source | [
"Runs",
"RequestLogAnalyzer",
"1",
".",
"Call",
"prepare",
"on",
"every",
"aggregator",
"2",
".",
"Generate",
"requests",
"from",
"source",
"object",
"3",
".",
"Filter",
"out",
"unwanted",
"requests",
"4",
".",
"Call",
"aggregate",
"for",
"remaning",
"requests... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/controller.rb#L328-L359 |
14,358 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/tracker/duration.rb | RequestLogAnalyzer::Tracker.Duration.display_value | def display_value(time)
case time
when nil then '-'
when 0...1 then '%0ims' % (time * 1000)
when 1...60 then '%0.02fs' % time
when 60...3600 then '%dm%02ds' % [time / 60, (time % 60).round]
else '%dh%02dm%02ds' % [time / 3600, (time % 3600) / 60, (time % 6... | ruby | def display_value(time)
case time
when nil then '-'
when 0...1 then '%0ims' % (time * 1000)
when 1...60 then '%0.02fs' % time
when 60...3600 then '%dm%02ds' % [time / 60, (time % 60).round]
else '%dh%02dm%02ds' % [time / 3600, (time % 3600) / 60, (time % 6... | [
"def",
"display_value",
"(",
"time",
")",
"case",
"time",
"when",
"nil",
"then",
"'-'",
"when",
"0",
"...",
"1",
"then",
"'%0ims'",
"%",
"(",
"time",
"*",
"1000",
")",
"when",
"1",
"...",
"60",
"then",
"'%0.02fs'",
"%",
"time",
"when",
"60",
"...",
... | Display a duration | [
"Display",
"a",
"duration"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/tracker/duration.rb#L36-L44 |
14,359 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/aggregator/database_inserter.rb | RequestLogAnalyzer::Aggregator.DatabaseInserter.prepare | def prepare
require 'request_log_analyzer/database'
@sources = {}
@database = RequestLogAnalyzer::Database.new(options[:database])
@database.file_format = source.file_format
database.drop_database_schema! if options[:reset_database]
database.create_database_schema!
end | ruby | def prepare
require 'request_log_analyzer/database'
@sources = {}
@database = RequestLogAnalyzer::Database.new(options[:database])
@database.file_format = source.file_format
database.drop_database_schema! if options[:reset_database]
database.create_database_schema!
end | [
"def",
"prepare",
"require",
"'request_log_analyzer/database'",
"@sources",
"=",
"{",
"}",
"@database",
"=",
"RequestLogAnalyzer",
"::",
"Database",
".",
"new",
"(",
"options",
"[",
":database",
"]",
")",
"@database",
".",
"file_format",
"=",
"source",
".",
"fil... | Establishes a connection to the database and creates the necessary database schema for the
current file format | [
"Establishes",
"a",
"connection",
"to",
"the",
"database",
"and",
"creates",
"the",
"necessary",
"database",
"schema",
"for",
"the",
"current",
"file",
"format"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/aggregator/database_inserter.rb#L18-L27 |
14,360 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/aggregator/database_inserter.rb | RequestLogAnalyzer::Aggregator.DatabaseInserter.aggregate | def aggregate(request)
@request_object = RequestLogAnalyzer::Database::Request.new(first_lineno: request.first_lineno, last_lineno: request.last_lineno)
request.lines.each do |line|
class_columns = database.get_class(line[:line_type]).column_names.reject { |column| %w(id source_id request_id).includ... | ruby | def aggregate(request)
@request_object = RequestLogAnalyzer::Database::Request.new(first_lineno: request.first_lineno, last_lineno: request.last_lineno)
request.lines.each do |line|
class_columns = database.get_class(line[:line_type]).column_names.reject { |column| %w(id source_id request_id).includ... | [
"def",
"aggregate",
"(",
"request",
")",
"@request_object",
"=",
"RequestLogAnalyzer",
"::",
"Database",
"::",
"Request",
".",
"new",
"(",
"first_lineno",
":",
"request",
".",
"first_lineno",
",",
"last_lineno",
":",
"request",
".",
"last_lineno",
")",
"request"... | Aggregates a request into the database
This will create a record in the requests table and create a record for every line that has been parsed,
in which the captured values will be stored. | [
"Aggregates",
"a",
"request",
"into",
"the",
"database",
"This",
"will",
"create",
"a",
"record",
"in",
"the",
"requests",
"table",
"and",
"create",
"a",
"record",
"for",
"every",
"line",
"that",
"has",
"been",
"parsed",
"in",
"which",
"the",
"captured",
"... | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/aggregator/database_inserter.rb#L32-L48 |
14,361 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/aggregator/database_inserter.rb | RequestLogAnalyzer::Aggregator.DatabaseInserter.warning | def warning(type, message, lineno)
RequestLogAnalyzer::Database::Warning.create!(warning_type: type.to_s, message: message, lineno: lineno)
end | ruby | def warning(type, message, lineno)
RequestLogAnalyzer::Database::Warning.create!(warning_type: type.to_s, message: message, lineno: lineno)
end | [
"def",
"warning",
"(",
"type",
",",
"message",
",",
"lineno",
")",
"RequestLogAnalyzer",
"::",
"Database",
"::",
"Warning",
".",
"create!",
"(",
"warning_type",
":",
"type",
".",
"to_s",
",",
"message",
":",
"message",
",",
"lineno",
":",
"lineno",
")",
... | Records w warining in the warnings table. | [
"Records",
"w",
"warining",
"in",
"the",
"warnings",
"table",
"."
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/aggregator/database_inserter.rb#L58-L60 |
14,362 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/aggregator/database_inserter.rb | RequestLogAnalyzer::Aggregator.DatabaseInserter.source_change | def source_change(change, filename)
if File.exist?(filename)
case change
when :started
@sources[filename] = RequestLogAnalyzer::Database::Source.create!(filename: filename)
when :finished
@sources[filename].update_attributes!(filesize: File.size(filename), mtime: File.m... | ruby | def source_change(change, filename)
if File.exist?(filename)
case change
when :started
@sources[filename] = RequestLogAnalyzer::Database::Source.create!(filename: filename)
when :finished
@sources[filename].update_attributes!(filesize: File.size(filename), mtime: File.m... | [
"def",
"source_change",
"(",
"change",
",",
"filename",
")",
"if",
"File",
".",
"exist?",
"(",
"filename",
")",
"case",
"change",
"when",
":started",
"@sources",
"[",
"filename",
"]",
"=",
"RequestLogAnalyzer",
"::",
"Database",
"::",
"Source",
".",
"create!... | Records source changes in the sources table | [
"Records",
"source",
"changes",
"in",
"the",
"sources",
"table"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/aggregator/database_inserter.rb#L63-L72 |
14,363 | wvanbergen/request-log-analyzer | lib/request_log_analyzer/aggregator/database_inserter.rb | RequestLogAnalyzer::Aggregator.DatabaseInserter.report | def report(output)
output.title('Request database created')
output << "A database file has been created with all parsed request information.\n"
output << "#{@request_count} requests have been added to the database.\n"
output << "\n"
output << "To open a Ruby console to inspect the data... | ruby | def report(output)
output.title('Request database created')
output << "A database file has been created with all parsed request information.\n"
output << "#{@request_count} requests have been added to the database.\n"
output << "\n"
output << "To open a Ruby console to inspect the data... | [
"def",
"report",
"(",
"output",
")",
"output",
".",
"title",
"(",
"'Request database created'",
")",
"output",
"<<",
"\"A database file has been created with all parsed request information.\\n\"",
"output",
"<<",
"\"#{@request_count} requests have been added to the database.\\n\"",
... | Prints a short report of what has been inserted into the database | [
"Prints",
"a",
"short",
"report",
"of",
"what",
"has",
"been",
"inserted",
"into",
"the",
"database"
] | b83865d440278583ac8e4901bb33878244fd7c75 | https://github.com/wvanbergen/request-log-analyzer/blob/b83865d440278583ac8e4901bb33878244fd7c75/lib/request_log_analyzer/aggregator/database_inserter.rb#L75-L84 |
14,364 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/set.rb | ActiveScaffold::DataStructures.Set.add | def add(*args)
args.flatten! # allow [] as a param
args.each do |arg|
arg = arg.to_sym if arg.is_a? String
@set << arg unless @set.include? arg # avoid duplicates
end
end | ruby | def add(*args)
args.flatten! # allow [] as a param
args.each do |arg|
arg = arg.to_sym if arg.is_a? String
@set << arg unless @set.include? arg # avoid duplicates
end
end | [
"def",
"add",
"(",
"*",
"args",
")",
"args",
".",
"flatten!",
"# allow [] as a param",
"args",
".",
"each",
"do",
"|",
"arg",
"|",
"arg",
"=",
"arg",
".",
"to_sym",
"if",
"arg",
".",
"is_a?",
"String",
"@set",
"<<",
"arg",
"unless",
"@set",
".",
"inc... | the way to add items to the set. | [
"the",
"way",
"to",
"add",
"items",
"to",
"the",
"set",
"."
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/set.rb#L20-L26 |
14,365 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/set.rb | ActiveScaffold::DataStructures.Set.exclude | def exclude(*args)
args.flatten! # allow [] as a param
args.collect!(&:to_sym) # symbolize the args
# check respond_to? :to_sym, ActionColumns doesn't respond to to_sym
@set.reject! { |c| c.respond_to?(:to_sym) && args.include?(c.to_sym) } # reject all items specified
end | ruby | def exclude(*args)
args.flatten! # allow [] as a param
args.collect!(&:to_sym) # symbolize the args
# check respond_to? :to_sym, ActionColumns doesn't respond to to_sym
@set.reject! { |c| c.respond_to?(:to_sym) && args.include?(c.to_sym) } # reject all items specified
end | [
"def",
"exclude",
"(",
"*",
"args",
")",
"args",
".",
"flatten!",
"# allow [] as a param",
"args",
".",
"collect!",
"(",
":to_sym",
")",
"# symbolize the args",
"# check respond_to? :to_sym, ActionColumns doesn't respond to to_sym",
"@set",
".",
"reject!",
"{",
"|",
"c"... | the way to remove items from the set. | [
"the",
"way",
"to",
"remove",
"items",
"from",
"the",
"set",
"."
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/set.rb#L30-L35 |
14,366 | activescaffold/active_scaffold | lib/active_scaffold/attribute_params.rb | ActiveScaffold.AttributeParams.attributes_hash_is_empty? | def attributes_hash_is_empty?(hash, klass)
hash.all? do |key, value|
# convert any possible multi-parameter attributes like 'created_at(5i)' to simply 'created_at'
column_name = key.to_s.split('(', 2)[0]
# datetimes will always have a value. so we ignore them when checking whether the has... | ruby | def attributes_hash_is_empty?(hash, klass)
hash.all? do |key, value|
# convert any possible multi-parameter attributes like 'created_at(5i)' to simply 'created_at'
column_name = key.to_s.split('(', 2)[0]
# datetimes will always have a value. so we ignore them when checking whether the has... | [
"def",
"attributes_hash_is_empty?",
"(",
"hash",
",",
"klass",
")",
"hash",
".",
"all?",
"do",
"|",
"key",
",",
"value",
"|",
"# convert any possible multi-parameter attributes like 'created_at(5i)' to simply 'created_at'",
"column_name",
"=",
"key",
".",
"to_s",
".",
"... | Determines whether the given attributes hash is "empty".
This isn't a literal emptiness - it's an attempt to discern whether the user intended it to be empty or not. | [
"Determines",
"whether",
"the",
"given",
"attributes",
"hash",
"is",
"empty",
".",
"This",
"isn",
"t",
"a",
"literal",
"emptiness",
"-",
"it",
"s",
"an",
"attempt",
"to",
"discern",
"whether",
"the",
"user",
"intended",
"it",
"to",
"be",
"empty",
"or",
"... | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/attribute_params.rb#L294-L315 |
14,367 | activescaffold/active_scaffold | lib/active_scaffold/actions/nested.rb | ActiveScaffold::Actions::Nested.ChildMethods.do_add_existing | def do_add_existing
parent_record = nested_parent_record(:update)
@record = active_scaffold_config.model.find(params[:associated_id])
if parent_record && @record
parent_record.send(nested.association.name) << @record
parent_record.save
else
false
end
end | ruby | def do_add_existing
parent_record = nested_parent_record(:update)
@record = active_scaffold_config.model.find(params[:associated_id])
if parent_record && @record
parent_record.send(nested.association.name) << @record
parent_record.save
else
false
end
end | [
"def",
"do_add_existing",
"parent_record",
"=",
"nested_parent_record",
"(",
":update",
")",
"@record",
"=",
"active_scaffold_config",
".",
"model",
".",
"find",
"(",
"params",
"[",
":associated_id",
"]",
")",
"if",
"parent_record",
"&&",
"@record",
"parent_record",... | The actual "add_existing" algorithm | [
"The",
"actual",
"add_existing",
"algorithm"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/actions/nested.rb#L238-L247 |
14,368 | activescaffold/active_scaffold | lib/active_scaffold/extensions/action_view_rendering.rb | ActiveScaffold.RenderingHelper.render | def render(*args, &block)
if args.first.is_a?(Hash) && args.first[:active_scaffold]
render_embedded args.first
elsif args.first == :super
@_view_paths ||= lookup_context.view_paths.clone
@_last_template ||= lookup_context.last_template
parts = @virtual_path.split('/')
... | ruby | def render(*args, &block)
if args.first.is_a?(Hash) && args.first[:active_scaffold]
render_embedded args.first
elsif args.first == :super
@_view_paths ||= lookup_context.view_paths.clone
@_last_template ||= lookup_context.last_template
parts = @virtual_path.split('/')
... | [
"def",
"render",
"(",
"*",
"args",
",",
"&",
"block",
")",
"if",
"args",
".",
"first",
".",
"is_a?",
"(",
"Hash",
")",
"&&",
"args",
".",
"first",
"[",
":active_scaffold",
"]",
"render_embedded",
"args",
".",
"first",
"elsif",
"args",
".",
"first",
"... | Adds two rendering options.
==render :super
This syntax skips all template overrides and goes directly to the provided ActiveScaffold templates.
Useful if you want to wrap an existing template. Just call super!
==render :active_scaffold => #{controller.to_s}, options = {}+
Lets you embed an ActiveScaffold by r... | [
"Adds",
"two",
"rendering",
"options",
"."
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/extensions/action_view_rendering.rb#L38-L82 |
14,369 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/action_link.rb | ActiveScaffold::DataStructures.ActionLink.initialize_copy | def initialize_copy(action_link)
self.parameters = parameters.clone if action_link.instance_variable_get(:@parameters)
self.html_options = html_options.clone if action_link.instance_variable_get(:@html_options)
end | ruby | def initialize_copy(action_link)
self.parameters = parameters.clone if action_link.instance_variable_get(:@parameters)
self.html_options = html_options.clone if action_link.instance_variable_get(:@html_options)
end | [
"def",
"initialize_copy",
"(",
"action_link",
")",
"self",
".",
"parameters",
"=",
"parameters",
".",
"clone",
"if",
"action_link",
".",
"instance_variable_get",
"(",
":@parameters",
")",
"self",
".",
"html_options",
"=",
"html_options",
".",
"clone",
"if",
"act... | provides a quick way to set any property of the object from a hash | [
"provides",
"a",
"quick",
"way",
"to",
"set",
"any",
"property",
"of",
"the",
"object",
"from",
"a",
"hash"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/action_link.rb#L31-L34 |
14,370 | activescaffold/active_scaffold | lib/active_scaffold/config/nested.rb | ActiveScaffold::Config.Nested.add_link | def add_link(attribute, options = {})
column = @core.columns[attribute.to_sym]
raise ArgumentError, "unknown column #{attribute}" if column.nil?
raise ArgumentError, "column #{attribute} is not an association" if column.association.nil?
label =
if column.association.polymorphic?
... | ruby | def add_link(attribute, options = {})
column = @core.columns[attribute.to_sym]
raise ArgumentError, "unknown column #{attribute}" if column.nil?
raise ArgumentError, "column #{attribute} is not an association" if column.association.nil?
label =
if column.association.polymorphic?
... | [
"def",
"add_link",
"(",
"attribute",
",",
"options",
"=",
"{",
"}",
")",
"column",
"=",
"@core",
".",
"columns",
"[",
"attribute",
".",
"to_sym",
"]",
"raise",
"ArgumentError",
",",
"\"unknown column #{attribute}\"",
"if",
"column",
".",
"nil?",
"raise",
"Ar... | Add a nested ActionLink | [
"Add",
"a",
"nested",
"ActionLink"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/config/nested.rb#L26-L42 |
14,371 | activescaffold/active_scaffold | lib/active_scaffold/actions/create.rb | ActiveScaffold::Actions.Create.do_create | def do_create(options = {})
attributes = options[:attributes] || params[:record]
active_scaffold_config.model.transaction do
@record = update_record_from_params(new_model, active_scaffold_config.create.columns, attributes)
apply_constraints_to_record(@record, :allow_autosave => true)
... | ruby | def do_create(options = {})
attributes = options[:attributes] || params[:record]
active_scaffold_config.model.transaction do
@record = update_record_from_params(new_model, active_scaffold_config.create.columns, attributes)
apply_constraints_to_record(@record, :allow_autosave => true)
... | [
"def",
"do_create",
"(",
"options",
"=",
"{",
"}",
")",
"attributes",
"=",
"options",
"[",
":attributes",
"]",
"||",
"params",
"[",
":record",
"]",
"active_scaffold_config",
".",
"model",
".",
"transaction",
"do",
"@record",
"=",
"update_record_from_params",
"... | A somewhat complex method to actually create a new record. The complexity is from support for subforms and associated records.
If you want to customize this behavior, consider using the +before_create_save+ and +after_create_save+ callbacks. | [
"A",
"somewhat",
"complex",
"method",
"to",
"actually",
"create",
"a",
"new",
"record",
".",
"The",
"complexity",
"is",
"from",
"support",
"for",
"subforms",
"and",
"associated",
"records",
".",
"If",
"you",
"want",
"to",
"customize",
"this",
"behavior",
"co... | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/actions/create.rb#L93-L108 |
14,372 | activescaffold/active_scaffold | lib/active_scaffold/config/core.rb | ActiveScaffold::Config.Core._configure_sti | def _configure_sti
column = model.inheritance_column
if sti_create_links
columns[column].form_ui ||= :hidden
else
columns[column].form_ui ||= :select
columns[column].options ||= {}
columns[column].options[:options] = sti_children.collect do |model_name|
[model... | ruby | def _configure_sti
column = model.inheritance_column
if sti_create_links
columns[column].form_ui ||= :hidden
else
columns[column].form_ui ||= :select
columns[column].options ||= {}
columns[column].options[:options] = sti_children.collect do |model_name|
[model... | [
"def",
"_configure_sti",
"column",
"=",
"model",
".",
"inheritance_column",
"if",
"sti_create_links",
"columns",
"[",
"column",
"]",
".",
"form_ui",
"||=",
":hidden",
"else",
"columns",
"[",
"column",
"]",
".",
"form_ui",
"||=",
":select",
"columns",
"[",
"col... | To be called after your finished configuration | [
"To",
"be",
"called",
"after",
"your",
"finished",
"configuration"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/config/core.rb#L208-L219 |
14,373 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/sorting.rb | ActiveScaffold::DataStructures.Sorting.add | def add(column_name, direction = nil)
direction ||= 'ASC'
direction = direction.to_s.upcase
column = get_column(column_name)
raise ArgumentError, "Could not find column #{column_name}" if column.nil?
raise ArgumentError, 'Sorting direction unknown' unless %i[ASC DESC].include? direction.to... | ruby | def add(column_name, direction = nil)
direction ||= 'ASC'
direction = direction.to_s.upcase
column = get_column(column_name)
raise ArgumentError, "Could not find column #{column_name}" if column.nil?
raise ArgumentError, 'Sorting direction unknown' unless %i[ASC DESC].include? direction.to... | [
"def",
"add",
"(",
"column_name",
",",
"direction",
"=",
"nil",
")",
"direction",
"||=",
"'ASC'",
"direction",
"=",
"direction",
".",
"to_s",
".",
"upcase",
"column",
"=",
"get_column",
"(",
"column_name",
")",
"raise",
"ArgumentError",
",",
"\"Could not find ... | add a clause to the sorting, assuming the column is sortable | [
"add",
"a",
"clause",
"to",
"the",
"sorting",
"assuming",
"the",
"column",
"is",
"sortable"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/sorting.rb#L37-L45 |
14,374 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/sorting.rb | ActiveScaffold::DataStructures.Sorting.clause | def clause(grouped_columns_calculations = nil)
return nil if sorts_by_method? || default_sorting?
# unless the sorting is by method, create the sql string
order = []
each do |sort_column, sort_direction|
next if constraint_columns.include? sort_column.name
sql = grouped_columns_... | ruby | def clause(grouped_columns_calculations = nil)
return nil if sorts_by_method? || default_sorting?
# unless the sorting is by method, create the sql string
order = []
each do |sort_column, sort_direction|
next if constraint_columns.include? sort_column.name
sql = grouped_columns_... | [
"def",
"clause",
"(",
"grouped_columns_calculations",
"=",
"nil",
")",
"return",
"nil",
"if",
"sorts_by_method?",
"||",
"default_sorting?",
"# unless the sorting is by method, create the sql string",
"order",
"=",
"[",
"]",
"each",
"do",
"|",
"sort_column",
",",
"sort_d... | builds an order-by clause | [
"builds",
"an",
"order",
"-",
"by",
"clause"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/sorting.rb#L123-L143 |
14,375 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/sorting.rb | ActiveScaffold::DataStructures.Sorting.get_column | def get_column(name_or_column)
# it's a column
return name_or_column if name_or_column.is_a? ActiveScaffold::DataStructures::Column
# it's a name
name_or_column = name_or_column.to_s.split('.').last if name_or_column.to_s.include? '.'
@columns[name_or_column]
end | ruby | def get_column(name_or_column)
# it's a column
return name_or_column if name_or_column.is_a? ActiveScaffold::DataStructures::Column
# it's a name
name_or_column = name_or_column.to_s.split('.').last if name_or_column.to_s.include? '.'
@columns[name_or_column]
end | [
"def",
"get_column",
"(",
"name_or_column",
")",
"# it's a column",
"return",
"name_or_column",
"if",
"name_or_column",
".",
"is_a?",
"ActiveScaffold",
"::",
"DataStructures",
"::",
"Column",
"# it's a name",
"name_or_column",
"=",
"name_or_column",
".",
"to_s",
".",
... | possibly converts the given argument into a column object from @columns (if it's not already) | [
"possibly",
"converts",
"the",
"given",
"argument",
"into",
"a",
"column",
"object",
"from"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/sorting.rb#L154-L160 |
14,376 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/columns.rb | ActiveScaffold::DataStructures.Columns.add | def add(*args)
args.flatten! # allow [] as a param
args = args.collect(&:to_sym)
# make the columns inheritable
@_inheritable.concat(args)
# then add columns to @set (unless they already exist)
args.each { |a| @set << ActiveScaffold::DataStructures::Column.new(a.to_sym, @active_reco... | ruby | def add(*args)
args.flatten! # allow [] as a param
args = args.collect(&:to_sym)
# make the columns inheritable
@_inheritable.concat(args)
# then add columns to @set (unless they already exist)
args.each { |a| @set << ActiveScaffold::DataStructures::Column.new(a.to_sym, @active_reco... | [
"def",
"add",
"(",
"*",
"args",
")",
"args",
".",
"flatten!",
"# allow [] as a param",
"args",
"=",
"args",
".",
"collect",
"(",
":to_sym",
")",
"# make the columns inheritable",
"@_inheritable",
".",
"concat",
"(",
"args",
")",
"# then add columns to @set (unless t... | the way to add columns to the set. this is primarily useful for virtual columns.
note that this also makes columns inheritable | [
"the",
"way",
"to",
"add",
"columns",
"to",
"the",
"set",
".",
"this",
"is",
"primarily",
"useful",
"for",
"virtual",
"columns",
".",
"note",
"that",
"this",
"also",
"makes",
"columns",
"inheritable"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/columns.rb#L32-L40 |
14,377 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/column.rb | ActiveScaffold::DataStructures.Column.set_link | def set_link(action, options = {})
if action.is_a?(ActiveScaffold::DataStructures::ActionLink) || (action.is_a? Proc)
@link = action
else
options[:label] ||= label
options[:position] ||= :after unless options.key?(:position)
options[:type] ||= :member
@link = ActiveSc... | ruby | def set_link(action, options = {})
if action.is_a?(ActiveScaffold::DataStructures::ActionLink) || (action.is_a? Proc)
@link = action
else
options[:label] ||= label
options[:position] ||= :after unless options.key?(:position)
options[:type] ||= :member
@link = ActiveSc... | [
"def",
"set_link",
"(",
"action",
",",
"options",
"=",
"{",
"}",
")",
"if",
"action",
".",
"is_a?",
"(",
"ActiveScaffold",
"::",
"DataStructures",
"::",
"ActionLink",
")",
"||",
"(",
"action",
".",
"is_a?",
"Proc",
")",
"@link",
"=",
"action",
"else",
... | associate an action_link with this column | [
"associate",
"an",
"action_link",
"with",
"this",
"column"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/column.rb#L156-L165 |
14,378 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/action_links.rb | ActiveScaffold::DataStructures.ActionLinks.add | def add(action, options = {})
link =
if action.is_a?(ActiveScaffold::DataStructures::ActionLink) || action.is_a?(ActiveScaffold::DataStructures::ActionLinks)
action
else
options[:type] ||= default_type if default_type
ActiveScaffold::DataStructures::ActionLink.new(act... | ruby | def add(action, options = {})
link =
if action.is_a?(ActiveScaffold::DataStructures::ActionLink) || action.is_a?(ActiveScaffold::DataStructures::ActionLinks)
action
else
options[:type] ||= default_type if default_type
ActiveScaffold::DataStructures::ActionLink.new(act... | [
"def",
"add",
"(",
"action",
",",
"options",
"=",
"{",
"}",
")",
"link",
"=",
"if",
"action",
".",
"is_a?",
"(",
"ActiveScaffold",
"::",
"DataStructures",
"::",
"ActionLink",
")",
"||",
"action",
".",
"is_a?",
"(",
"ActiveScaffold",
"::",
"DataStructures",... | adds an ActionLink, creating one from the arguments if need be | [
"adds",
"an",
"ActionLink",
"creating",
"one",
"from",
"the",
"arguments",
"if",
"need",
"be"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/action_links.rb#L13-L33 |
14,379 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/action_links.rb | ActiveScaffold::DataStructures.ActionLinks.add_to_group | def add_to_group(link, group_name = nil)
add_to = root
add_to = group_name.split('.').inject(root) { |group, name| group.send(name) } if group_name
add_to << link unless link.nil?
end | ruby | def add_to_group(link, group_name = nil)
add_to = root
add_to = group_name.split('.').inject(root) { |group, name| group.send(name) } if group_name
add_to << link unless link.nil?
end | [
"def",
"add_to_group",
"(",
"link",
",",
"group_name",
"=",
"nil",
")",
"add_to",
"=",
"root",
"add_to",
"=",
"group_name",
".",
"split",
"(",
"'.'",
")",
".",
"inject",
"(",
"root",
")",
"{",
"|",
"group",
",",
"name",
"|",
"group",
".",
"send",
"... | adds a link to a specific group
groups are represented as a string separated by a dot
eg member.crud | [
"adds",
"a",
"link",
"to",
"a",
"specific",
"group",
"groups",
"are",
"represented",
"as",
"a",
"string",
"separated",
"by",
"a",
"dot",
"eg",
"member",
".",
"crud"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/action_links.rb#L43-L47 |
14,380 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/action_links.rb | ActiveScaffold::DataStructures.ActionLinks.[] | def [](val)
links = []
@set.each do |item|
if item.is_a?(ActiveScaffold::DataStructures::ActionLinks)
collected = item[val]
links << collected unless collected.nil?
elsif item.action.to_s == val.to_s
links << item
end
end
links.first
end | ruby | def [](val)
links = []
@set.each do |item|
if item.is_a?(ActiveScaffold::DataStructures::ActionLinks)
collected = item[val]
links << collected unless collected.nil?
elsif item.action.to_s == val.to_s
links << item
end
end
links.first
end | [
"def",
"[]",
"(",
"val",
")",
"links",
"=",
"[",
"]",
"@set",
".",
"each",
"do",
"|",
"item",
"|",
"if",
"item",
".",
"is_a?",
"(",
"ActiveScaffold",
"::",
"DataStructures",
"::",
"ActionLinks",
")",
"collected",
"=",
"item",
"[",
"val",
"]",
"links"... | finds an ActionLink by matching the action | [
"finds",
"an",
"ActionLink",
"by",
"matching",
"the",
"action"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/action_links.rb#L50-L61 |
14,381 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/action_links.rb | ActiveScaffold::DataStructures.ActionLinks.each | def each(options = {}, &block)
method = options[:reverse] ? :reverse_each : :each
@set.sort_by(&:weight).send(method) do |item|
if item.is_a?(ActiveScaffold::DataStructures::ActionLinks) && !options[:groups]
item.each(options, &block)
elsif options[:include_set]
yield ite... | ruby | def each(options = {}, &block)
method = options[:reverse] ? :reverse_each : :each
@set.sort_by(&:weight).send(method) do |item|
if item.is_a?(ActiveScaffold::DataStructures::ActionLinks) && !options[:groups]
item.each(options, &block)
elsif options[:include_set]
yield ite... | [
"def",
"each",
"(",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"method",
"=",
"options",
"[",
":reverse",
"]",
"?",
":reverse_each",
":",
":each",
"@set",
".",
"sort_by",
"(",
":weight",
")",
".",
"send",
"(",
"method",
")",
"do",
"|",
"item... | iterates over the links, possibly by type | [
"iterates",
"over",
"the",
"links",
"possibly",
"by",
"type"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/action_links.rb#L98-L109 |
14,382 | activescaffold/active_scaffold | lib/active_scaffold/data_structures/action_columns.rb | ActiveScaffold::DataStructures.ActionColumns.add_subgroup | def add_subgroup(label, &proc)
columns = ActiveScaffold::DataStructures::ActionColumns.new
columns.label = label
columns.action = action
columns.configure(&proc)
exclude columns.collect_columns
add columns
end | ruby | def add_subgroup(label, &proc)
columns = ActiveScaffold::DataStructures::ActionColumns.new
columns.label = label
columns.action = action
columns.configure(&proc)
exclude columns.collect_columns
add columns
end | [
"def",
"add_subgroup",
"(",
"label",
",",
"&",
"proc",
")",
"columns",
"=",
"ActiveScaffold",
"::",
"DataStructures",
"::",
"ActionColumns",
".",
"new",
"columns",
".",
"label",
"=",
"label",
"columns",
".",
"action",
"=",
"action",
"columns",
".",
"configur... | nests a subgroup in the column set | [
"nests",
"a",
"subgroup",
"in",
"the",
"column",
"set"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/data_structures/action_columns.rb#L38-L45 |
14,383 | activescaffold/active_scaffold | lib/active_scaffold/actions/delete.rb | ActiveScaffold::Actions.Delete.do_destroy | def do_destroy(record)
record ||= destroy_find_record
begin
self.successful = record.destroy
rescue StandardError => exception
flash[:warning] = as_(:cant_destroy_record, :record => ERB::Util.h(record.to_label))
self.successful = false
logger.warn do
"\n\n#{ex... | ruby | def do_destroy(record)
record ||= destroy_find_record
begin
self.successful = record.destroy
rescue StandardError => exception
flash[:warning] = as_(:cant_destroy_record, :record => ERB::Util.h(record.to_label))
self.successful = false
logger.warn do
"\n\n#{ex... | [
"def",
"do_destroy",
"(",
"record",
")",
"record",
"||=",
"destroy_find_record",
"begin",
"self",
".",
"successful",
"=",
"record",
".",
"destroy",
"rescue",
"StandardError",
"=>",
"exception",
"flash",
"[",
":warning",
"]",
"=",
"as_",
"(",
":cant_destroy_recor... | A simple method to handle the actual destroying of a record
May be overridden to customize the behavior | [
"A",
"simple",
"method",
"to",
"handle",
"the",
"actual",
"destroying",
"of",
"a",
"record",
"May",
"be",
"overridden",
"to",
"customize",
"the",
"behavior"
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/actions/delete.rb#L40-L53 |
14,384 | activescaffold/active_scaffold | lib/active_scaffold/constraints.rb | ActiveScaffold.Constraints.conditions_from_constraints | def conditions_from_constraints
hash_conditions = {}
conditions = [hash_conditions]
active_scaffold_constraints.each do |k, v|
column = active_scaffold_config.columns[k]
if column
# Assume this is a multi-level association constraint.
# example:
# data m... | ruby | def conditions_from_constraints
hash_conditions = {}
conditions = [hash_conditions]
active_scaffold_constraints.each do |k, v|
column = active_scaffold_config.columns[k]
if column
# Assume this is a multi-level association constraint.
# example:
# data m... | [
"def",
"conditions_from_constraints",
"hash_conditions",
"=",
"{",
"}",
"conditions",
"=",
"[",
"hash_conditions",
"]",
"active_scaffold_constraints",
".",
"each",
"do",
"|",
"k",
",",
"v",
"|",
"column",
"=",
"active_scaffold_config",
".",
"columns",
"[",
"k",
... | Returns search conditions based on the current scaffold constraints.
Supports constraints based on either a column name (in which case it checks for an association
or just uses the search_sql) or a database field name.
All of this work is primarily to support nested scaffolds in a manner generally useful for other... | [
"Returns",
"search",
"conditions",
"based",
"on",
"the",
"current",
"scaffold",
"constraints",
"."
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/constraints.rb#L44-L80 |
14,385 | activescaffold/active_scaffold | lib/active_scaffold/constraints.rb | ActiveScaffold.Constraints.condition_from_association_constraint | def condition_from_association_constraint(association, value)
# when the reverse association is a :belongs_to, the id for the associated object only exists as
# the primary_key on the other table. so for :has_one and :has_many (when the reverse is :belongs_to),
# we have to use the other model's prima... | ruby | def condition_from_association_constraint(association, value)
# when the reverse association is a :belongs_to, the id for the associated object only exists as
# the primary_key on the other table. so for :has_one and :has_many (when the reverse is :belongs_to),
# we have to use the other model's prima... | [
"def",
"condition_from_association_constraint",
"(",
"association",
",",
"value",
")",
"# when the reverse association is a :belongs_to, the id for the associated object only exists as",
"# the primary_key on the other table. so for :has_one and :has_many (when the reverse is :belongs_to),",
"# we... | We do NOT want to use .search_sql. If anything, search_sql will refer
to a human-searchable value on the associated record. | [
"We",
"do",
"NOT",
"want",
"to",
"use",
".",
"search_sql",
".",
"If",
"anything",
"search_sql",
"will",
"refer",
"to",
"a",
"human",
"-",
"searchable",
"value",
"on",
"the",
"associated",
"record",
"."
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/constraints.rb#L96-L123 |
14,386 | activescaffold/active_scaffold | lib/active_scaffold/constraints.rb | ActiveScaffold.Constraints.apply_constraints_to_record | def apply_constraints_to_record(record, options = {})
options[:allow_autosave] = false if options[:allow_autosave].nil?
constraints = options[:constraints] || active_scaffold_constraints
config = record.is_a?(active_scaffold_config.model) ? active_scaffold_config : active_scaffold_config_for(record.c... | ruby | def apply_constraints_to_record(record, options = {})
options[:allow_autosave] = false if options[:allow_autosave].nil?
constraints = options[:constraints] || active_scaffold_constraints
config = record.is_a?(active_scaffold_config.model) ? active_scaffold_config : active_scaffold_config_for(record.c... | [
"def",
"apply_constraints_to_record",
"(",
"record",
",",
"options",
"=",
"{",
"}",
")",
"options",
"[",
":allow_autosave",
"]",
"=",
"false",
"if",
"options",
"[",
":allow_autosave",
"]",
".",
"nil?",
"constraints",
"=",
"options",
"[",
":constraints",
"]",
... | Applies constraints to the given record.
Searches through the known columns for association columns. If the given constraint is an association,
it assumes that the constraint value is an id. It then does a association.klass.find with the value
and adds the associated object to the record.
For some operations Acti... | [
"Applies",
"constraints",
"to",
"the",
"given",
"record",
"."
] | 1954f85b5395d09de09fa86f3ea70c29bbee2612 | https://github.com/activescaffold/active_scaffold/blob/1954f85b5395d09de09fa86f3ea70c29bbee2612/lib/active_scaffold/constraints.rb#L141-L173 |
14,387 | rossta/montrose | lib/montrose/schedule.rb | Montrose.Schedule.events | def events(opts = {})
enums = @rules.map { |r| r.merge(opts).events }
Enumerator.new do |y|
loop do
enum = active_enums(enums).min_by(&:peek) or break
y << enum.next
end
end
end | ruby | def events(opts = {})
enums = @rules.map { |r| r.merge(opts).events }
Enumerator.new do |y|
loop do
enum = active_enums(enums).min_by(&:peek) or break
y << enum.next
end
end
end | [
"def",
"events",
"(",
"opts",
"=",
"{",
"}",
")",
"enums",
"=",
"@rules",
".",
"map",
"{",
"|",
"r",
"|",
"r",
".",
"merge",
"(",
"opts",
")",
".",
"events",
"}",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"loop",
"do",
"enum",
"=",
"acti... | Returns an enumerator for iterating over timestamps in the schedule
@example Return the events
schedule = Montrose::Schedule.build do |s|
s << { every: :day }
end
schedule.events
@return [Enumerator] an enumerator of recurrence timestamps | [
"Returns",
"an",
"enumerator",
"for",
"iterating",
"over",
"timestamps",
"in",
"the",
"schedule"
] | 91af7d2d5c337aa255510179d24eb023775674bb | https://github.com/rossta/montrose/blob/91af7d2d5c337aa255510179d24eb023775674bb/lib/montrose/schedule.rb#L72-L80 |
14,388 | rossta/montrose | lib/montrose/stack.rb | Montrose.Stack.advance | def advance(time)
yes, no = @stack.partition { |rule| rule.include?(time) }
if no.empty?
yes.all? { |rule| rule.advance!(time) } or return false
puts time if ENV["DEBUG"]
yield time if block_given?
true
else
no.any? { |rule| rule.continue?(time) }
end
... | ruby | def advance(time)
yes, no = @stack.partition { |rule| rule.include?(time) }
if no.empty?
yes.all? { |rule| rule.advance!(time) } or return false
puts time if ENV["DEBUG"]
yield time if block_given?
true
else
no.any? { |rule| rule.continue?(time) }
end
... | [
"def",
"advance",
"(",
"time",
")",
"yes",
",",
"no",
"=",
"@stack",
".",
"partition",
"{",
"|",
"rule",
"|",
"rule",
".",
"include?",
"(",
"time",
")",
"}",
"if",
"no",
".",
"empty?",
"yes",
".",
"all?",
"{",
"|",
"rule",
"|",
"rule",
".",
"ad... | Given a time instance, advances state of when all
recurrence rules on the stack match, and yielding
time to the block, otherwise, invokes break? on
non-matching rules.
@param [Time] time - time instance candidate for recurrence | [
"Given",
"a",
"time",
"instance",
"advances",
"state",
"of",
"when",
"all",
"recurrence",
"rules",
"on",
"the",
"stack",
"match",
"and",
"yielding",
"time",
"to",
"the",
"block",
"otherwise",
"invokes",
"break?",
"on",
"non",
"-",
"matching",
"rules",
"."
] | 91af7d2d5c337aa255510179d24eb023775674bb | https://github.com/rossta/montrose/blob/91af7d2d5c337aa255510179d24eb023775674bb/lib/montrose/stack.rb#L42-L53 |
14,389 | mailgun/mailgun-ruby | lib/mailgun/messages/message_builder.rb | Mailgun.MessageBuilder.add_campaign_id | def add_campaign_id(campaign_id)
fail(Mailgun::ParameterError, 'Too many campaigns added to message.', campaign_id) if @counters[:attributes][:campaign_id] >= Mailgun::Chains::MAX_CAMPAIGN_IDS
set_multi_complex('o:campaign', campaign_id)
@counters[:attributes][:campaign_id] += 1
end | ruby | def add_campaign_id(campaign_id)
fail(Mailgun::ParameterError, 'Too many campaigns added to message.', campaign_id) if @counters[:attributes][:campaign_id] >= Mailgun::Chains::MAX_CAMPAIGN_IDS
set_multi_complex('o:campaign', campaign_id)
@counters[:attributes][:campaign_id] += 1
end | [
"def",
"add_campaign_id",
"(",
"campaign_id",
")",
"fail",
"(",
"Mailgun",
"::",
"ParameterError",
",",
"'Too many campaigns added to message.'",
",",
"campaign_id",
")",
"if",
"@counters",
"[",
":attributes",
"]",
"[",
":campaign_id",
"]",
">=",
"Mailgun",
"::",
... | Add campaign IDs to message. Limit of 3 per message.
@param [String] campaign_id A defined campaign ID to add to the message.
@return [void] | [
"Add",
"campaign",
"IDs",
"to",
"message",
".",
"Limit",
"of",
"3",
"per",
"message",
"."
] | 265efffd51209b0170a3225bbe945b649643465a | https://github.com/mailgun/mailgun-ruby/blob/265efffd51209b0170a3225bbe945b649643465a/lib/mailgun/messages/message_builder.rb#L176-L181 |
14,390 | mailgun/mailgun-ruby | lib/mailgun/messages/message_builder.rb | Mailgun.MessageBuilder.add_tag | def add_tag(tag)
if @counters[:attributes][:tag] >= Mailgun::Chains::MAX_TAGS
fail Mailgun::ParameterError, 'Too many tags added to message.', tag
end
set_multi_complex('o:tag', tag)
@counters[:attributes][:tag] += 1
end | ruby | def add_tag(tag)
if @counters[:attributes][:tag] >= Mailgun::Chains::MAX_TAGS
fail Mailgun::ParameterError, 'Too many tags added to message.', tag
end
set_multi_complex('o:tag', tag)
@counters[:attributes][:tag] += 1
end | [
"def",
"add_tag",
"(",
"tag",
")",
"if",
"@counters",
"[",
":attributes",
"]",
"[",
":tag",
"]",
">=",
"Mailgun",
"::",
"Chains",
"::",
"MAX_TAGS",
"fail",
"Mailgun",
"::",
"ParameterError",
",",
"'Too many tags added to message.'",
",",
"tag",
"end",
"set_mul... | Add tags to message. Limit of 3 per message.
@param [String] tag A defined campaign ID to add to the message.
@return [void] | [
"Add",
"tags",
"to",
"message",
".",
"Limit",
"of",
"3",
"per",
"message",
"."
] | 265efffd51209b0170a3225bbe945b649643465a | https://github.com/mailgun/mailgun-ruby/blob/265efffd51209b0170a3225bbe945b649643465a/lib/mailgun/messages/message_builder.rb#L187-L193 |
14,391 | mailgun/mailgun-ruby | lib/mailgun/messages/message_builder.rb | Mailgun.MessageBuilder.header | def header(name, data)
fail(Mailgun::ParameterError, 'Header name for message must be specified') if name.to_s.empty?
begin
jsondata = make_json data
set_single("h:#{name}", jsondata)
rescue Mailgun::ParameterError
set_single("h:#{name}", data)
end
end | ruby | def header(name, data)
fail(Mailgun::ParameterError, 'Header name for message must be specified') if name.to_s.empty?
begin
jsondata = make_json data
set_single("h:#{name}", jsondata)
rescue Mailgun::ParameterError
set_single("h:#{name}", data)
end
end | [
"def",
"header",
"(",
"name",
",",
"data",
")",
"fail",
"(",
"Mailgun",
"::",
"ParameterError",
",",
"'Header name for message must be specified'",
")",
"if",
"name",
".",
"to_s",
".",
"empty?",
"begin",
"jsondata",
"=",
"make_json",
"data",
"set_single",
"(",
... | Add custom data to the message. The data should be either a hash or JSON
encoded. The custom data will be added as a header to your message.
@param [string] name A name for the custom data. (Ex. X-Mailgun-<Name of Data>: {})
@param [Hash] data Either a hash or JSON string.
@return [void] | [
"Add",
"custom",
"data",
"to",
"the",
"message",
".",
"The",
"data",
"should",
"be",
"either",
"a",
"hash",
"or",
"JSON",
"encoded",
".",
"The",
"custom",
"data",
"will",
"be",
"added",
"as",
"a",
"header",
"to",
"your",
"message",
"."
] | 265efffd51209b0170a3225bbe945b649643465a | https://github.com/mailgun/mailgun-ruby/blob/265efffd51209b0170a3225bbe945b649643465a/lib/mailgun/messages/message_builder.rb#L247-L255 |
14,392 | mailgun/mailgun-ruby | lib/mailgun/messages/message_builder.rb | Mailgun.MessageBuilder.bool_lookup | def bool_lookup(value)
return 'yes' if %w(true yes yep).include? value.to_s.downcase
return 'no' if %w(false no nope).include? value.to_s.downcase
value
end | ruby | def bool_lookup(value)
return 'yes' if %w(true yes yep).include? value.to_s.downcase
return 'no' if %w(false no nope).include? value.to_s.downcase
value
end | [
"def",
"bool_lookup",
"(",
"value",
")",
"return",
"'yes'",
"if",
"%w(",
"true",
"yes",
"yep",
")",
".",
"include?",
"value",
".",
"to_s",
".",
"downcase",
"return",
"'no'",
"if",
"%w(",
"false",
"no",
"nope",
")",
".",
"include?",
"value",
".",
"to_s"... | Converts boolean type to string
@param [String] value The item to convert
@return [void] | [
"Converts",
"boolean",
"type",
"to",
"string"
] | 265efffd51209b0170a3225bbe945b649643465a | https://github.com/mailgun/mailgun-ruby/blob/265efffd51209b0170a3225bbe945b649643465a/lib/mailgun/messages/message_builder.rb#L342-L346 |
14,393 | mailgun/mailgun-ruby | lib/mailgun/messages/batch_message.rb | Mailgun.BatchMessage.send_message | def send_message
rkey = 'recipient-variables'
set_multi_simple rkey, JSON.generate(@recipient_variables)
@message[rkey] = @message[rkey].first if @message.key?(rkey)
response = @client.send_message(@domain, @message).to_h!
message_id = response['id'].gsub(/\>|\</, '')
@message_ids[m... | ruby | def send_message
rkey = 'recipient-variables'
set_multi_simple rkey, JSON.generate(@recipient_variables)
@message[rkey] = @message[rkey].first if @message.key?(rkey)
response = @client.send_message(@domain, @message).to_h!
message_id = response['id'].gsub(/\>|\</, '')
@message_ids[m... | [
"def",
"send_message",
"rkey",
"=",
"'recipient-variables'",
"set_multi_simple",
"rkey",
",",
"JSON",
".",
"generate",
"(",
"@recipient_variables",
")",
"@message",
"[",
"rkey",
"]",
"=",
"@message",
"[",
"rkey",
"]",
".",
"first",
"if",
"@message",
".",
"key?... | This method initiates a batch send to the API. It formats the recipient
variables, posts to the API, gathers the message IDs, then flushes that data
to prepare for the next batch. This method implements the Mailgun Client, thus,
an exception will be thrown if a communication error occurs.
@return [Boolean] | [
"This",
"method",
"initiates",
"a",
"batch",
"send",
"to",
"the",
"API",
".",
"It",
"formats",
"the",
"recipient",
"variables",
"posts",
"to",
"the",
"API",
"gathers",
"the",
"message",
"IDs",
"then",
"flushes",
"that",
"data",
"to",
"prepare",
"for",
"the... | 265efffd51209b0170a3225bbe945b649643465a | https://github.com/mailgun/mailgun-ruby/blob/265efffd51209b0170a3225bbe945b649643465a/lib/mailgun/messages/batch_message.rb#L85-L94 |
14,394 | mailgun/mailgun-ruby | lib/mailgun/messages/batch_message.rb | Mailgun.BatchMessage.store_recipient_variables | def store_recipient_variables(recipient_type, address, variables)
variables = { id: @counters[:recipients][recipient_type] } unless variables
@recipient_variables[address] = variables
end | ruby | def store_recipient_variables(recipient_type, address, variables)
variables = { id: @counters[:recipients][recipient_type] } unless variables
@recipient_variables[address] = variables
end | [
"def",
"store_recipient_variables",
"(",
"recipient_type",
",",
"address",
",",
"variables",
")",
"variables",
"=",
"{",
"id",
":",
"@counters",
"[",
":recipients",
"]",
"[",
"recipient_type",
"]",
"}",
"unless",
"variables",
"@recipient_variables",
"[",
"address"... | This method stores recipient variables for each recipient added, if
variables exist. | [
"This",
"method",
"stores",
"recipient",
"variables",
"for",
"each",
"recipient",
"added",
"if",
"variables",
"exist",
"."
] | 265efffd51209b0170a3225bbe945b649643465a | https://github.com/mailgun/mailgun-ruby/blob/265efffd51209b0170a3225bbe945b649643465a/lib/mailgun/messages/batch_message.rb#L98-L101 |
14,395 | mailgun/mailgun-ruby | lib/mailgun/response.rb | Mailgun.Response.to_yaml | def to_yaml
YAML.dump(to_h)
rescue => err
raise ParseError.new(err), err
end | ruby | def to_yaml
YAML.dump(to_h)
rescue => err
raise ParseError.new(err), err
end | [
"def",
"to_yaml",
"YAML",
".",
"dump",
"(",
"to_h",
")",
"rescue",
"=>",
"err",
"raise",
"ParseError",
".",
"new",
"(",
"err",
")",
",",
"err",
"end"
] | Return response as Yaml
@return [String] A string containing response as YAML | [
"Return",
"response",
"as",
"Yaml"
] | 265efffd51209b0170a3225bbe945b649643465a | https://github.com/mailgun/mailgun-ruby/blob/265efffd51209b0170a3225bbe945b649643465a/lib/mailgun/response.rb#L47-L51 |
14,396 | mailgun/mailgun-ruby | lib/railgun/mailer.rb | Railgun.Mailer.deliver! | def deliver!(mail)
mg_message = Railgun.transform_for_mailgun(mail)
response = @mg_client.send_message(@domain, mg_message)
if response.code == 200 then
mg_id = response.to_h['id']
mail.message_id = mg_id
end
response
end | ruby | def deliver!(mail)
mg_message = Railgun.transform_for_mailgun(mail)
response = @mg_client.send_message(@domain, mg_message)
if response.code == 200 then
mg_id = response.to_h['id']
mail.message_id = mg_id
end
response
end | [
"def",
"deliver!",
"(",
"mail",
")",
"mg_message",
"=",
"Railgun",
".",
"transform_for_mailgun",
"(",
"mail",
")",
"response",
"=",
"@mg_client",
".",
"send_message",
"(",
"@domain",
",",
"mg_message",
")",
"if",
"response",
".",
"code",
"==",
"200",
"then",... | Initialize the Railgun mailer.
@param [Hash] config Hash of config values, typically from `app_config.action_mailer.mailgun_config` | [
"Initialize",
"the",
"Railgun",
"mailer",
"."
] | 265efffd51209b0170a3225bbe945b649643465a | https://github.com/mailgun/mailgun-ruby/blob/265efffd51209b0170a3225bbe945b649643465a/lib/railgun/mailer.rb#L42-L51 |
14,397 | mailgun/mailgun-ruby | lib/mailgun/client.rb | Mailgun.Client.send_message | def send_message(working_domain, data)
if test_mode? then
Mailgun::Client.deliveries << data
return Response.from_hash(
{
:body => '{"id": "test-mode-mail@localhost", "message": "Queued. Thank you."}',
:code => 200,
}
)
end
case data... | ruby | def send_message(working_domain, data)
if test_mode? then
Mailgun::Client.deliveries << data
return Response.from_hash(
{
:body => '{"id": "test-mode-mail@localhost", "message": "Queued. Thank you."}',
:code => 200,
}
)
end
case data... | [
"def",
"send_message",
"(",
"working_domain",
",",
"data",
")",
"if",
"test_mode?",
"then",
"Mailgun",
"::",
"Client",
".",
"deliveries",
"<<",
"data",
"return",
"Response",
".",
"from_hash",
"(",
"{",
":body",
"=>",
"'{\"id\": \"test-mode-mail@localhost\", \"messag... | Simple Message Sending
@param [String] working_domain This is the domain you wish to send from.
@param [Hash] data This should be a standard Hash
containing required parameters for the requested resource.
@return [Mailgun::Response] A Mailgun::Response object. | [
"Simple",
"Message",
"Sending"
] | 265efffd51209b0170a3225bbe945b649643465a | https://github.com/mailgun/mailgun-ruby/blob/265efffd51209b0170a3225bbe945b649643465a/lib/mailgun/client.rb#L63-L93 |
14,398 | mailgun/mailgun-ruby | lib/mailgun/client.rb | Mailgun.Client.post | def post(resource_path, data, headers = {})
response = @http_client[resource_path].post(data, headers)
Response.new(response)
rescue => err
raise communication_error err
end | ruby | def post(resource_path, data, headers = {})
response = @http_client[resource_path].post(data, headers)
Response.new(response)
rescue => err
raise communication_error err
end | [
"def",
"post",
"(",
"resource_path",
",",
"data",
",",
"headers",
"=",
"{",
"}",
")",
"response",
"=",
"@http_client",
"[",
"resource_path",
"]",
".",
"post",
"(",
"data",
",",
"headers",
")",
"Response",
".",
"new",
"(",
"response",
")",
"rescue",
"=>... | Generic Mailgun POST Handler
@param [String] resource_path This is the API resource you wish to interact
with. Be sure to include your domain, where necessary.
@param [Hash] data This should be a standard Hash
containing required parameters for the requested resource.
@param [Hash] headers Additional headers to p... | [
"Generic",
"Mailgun",
"POST",
"Handler"
] | 265efffd51209b0170a3225bbe945b649643465a | https://github.com/mailgun/mailgun-ruby/blob/265efffd51209b0170a3225bbe945b649643465a/lib/mailgun/client.rb#L103-L108 |
14,399 | mailgun/mailgun-ruby | lib/mailgun/client.rb | Mailgun.Client.get | def get(resource_path, params = nil, accept = '*/*')
if params
response = @http_client[resource_path].get(params: params, accept: accept)
else
response = @http_client[resource_path].get(accept: accept)
end
Response.new(response)
rescue => err
raise communication_error e... | ruby | def get(resource_path, params = nil, accept = '*/*')
if params
response = @http_client[resource_path].get(params: params, accept: accept)
else
response = @http_client[resource_path].get(accept: accept)
end
Response.new(response)
rescue => err
raise communication_error e... | [
"def",
"get",
"(",
"resource_path",
",",
"params",
"=",
"nil",
",",
"accept",
"=",
"'*/*'",
")",
"if",
"params",
"response",
"=",
"@http_client",
"[",
"resource_path",
"]",
".",
"get",
"(",
"params",
":",
"params",
",",
"accept",
":",
"accept",
")",
"e... | Generic Mailgun GET Handler
@param [String] resource_path This is the API resource you wish to interact
with. Be sure to include your domain, where necessary.
@param [Hash] params This should be a standard Hash
containing required parameters for the requested resource.
@param [String] accept Acceptable Content-Ty... | [
"Generic",
"Mailgun",
"GET",
"Handler"
] | 265efffd51209b0170a3225bbe945b649643465a | https://github.com/mailgun/mailgun-ruby/blob/265efffd51209b0170a3225bbe945b649643465a/lib/mailgun/client.rb#L118-L127 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.