Skip to content

Commit c434afb

Browse files
committed
fix
1 parent 999c613 commit c434afb

23 files changed

+633
-134
lines changed

ruby/cross_service_examples/item_tracker/env/setup_scripts/create_table.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ def create_table
5353
{
5454
resource_arn: @config['resource_arn'],
5555
secret_arn: @config['secret_arn'],
56-
sql: 'CREATE TABLE work_items (work_item_id INT AUTO_INCREMENT PRIMARY KEY, description VARCHAR(400), guide VARCHAR(45), status VARCHAR(400), username VARCHAR(45), archived TINYINT(4));',
56+
sql: 'CREATE TABLE work_items (work_item_id INT AUTO_INCREMENT PRIMARY KEY,
57+
description VARCHAR(400),
58+
guide VARCHAR(45),
59+
status VARCHAR(400),
60+
username VARCHAR(45),
61+
archived TINYINT(4));',
62+
5763
database: @config['database']
5864
}
5965
)

ruby/example_code/dynamodb/partiql/scenario_partiql_batch.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def run_scenario
2525
puts '# #'.yellow
2626
puts '######################################################################################################'.yellow
2727
puts ''
28-
puts 'You have launched a demo of Amazon DynamoDB using PartiQL and the AWS for Ruby v3 SDK. Over the next 60 seconds, it will'
28+
puts 'You have launched a demo of Amazon DynamoDB using PartiQL and the AWS for Ruby v3 SDK. Over the next 60 seconds,
29+
it will'
2930
puts 'do the following:'
3031
puts ' 1. Create a new DynamoDB table.'
3132
puts ' 2. Write batch data into the table'

ruby/example_code/dynamodb/partiql/scenario_partiql_single.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def run_scenario
2525
puts '# #'.yellow
2626
puts '######################################################################################################'.yellow
2727
puts ''
28-
puts 'You have launched a demo of Amazon DynamoDB using PartiQL and the AWS for Ruby v3 SDK. Over the next 60 seconds,it will'
28+
puts 'You have launched a demo of Amazon DynamoDB using PartiQL and the AWS for Ruby v3 SDK. Over the next 60 seconds,
29+
it will'
2930
puts 'do the following:'
3031
puts ' 1. Create a new DynamoDB table.'
3132
puts ' 2. Write batch data into the table'

ruby/example_code/glue/glue_wrapper.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@
77
# snippet-start:[ruby.example_code.glue.GlueWrapper.full]
88
# snippet-start:[ruby.example_code.glue.GlueWrapper.decl]
99

10-
# The `GlueWrapper` class serves as a wrapper around the AWS Glue API, providing a simplified interface for common operations.
11-
# It encapsulates the functionality of the AWS SDK for Glue and provides methods for interacting with Glue crawlers, databases, tables, jobs, and S3 resources.
10+
# The `GlueWrapper` class serves as a wrapper around the AWS Glue API,
11+
providing a simplified interface for common operations.
12+
# It encapsulates the functionality of the AWS SDK for Glue and provides methods for interacting with Glue crawlers,
13+
databases,
14+
tables,
15+
jobs,
16+
and S3 resources.
1217
# The class initializes with a Glue client and a logger, allowing it to make API calls and log any errors or informational messages.
1318
class GlueWrapper
1419
def initialize(glue_client, logger)

ruby/example_code/iam/list_admins.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize(iam_client, logger: Logger.new($stdout))
1515
end
1616

1717
# Checks if the specified IAM entity (user or group) has admin privileges
18-
def has_admin_privileges?(entity)
18+
def admin_privileges?(entity)
1919
entity_policies = @iam.list_attached_user_policies(user_name: entity.user_name) if entity.respond_to?(:user_name)
2020
if entity.respond_to?(:group_name)
2121
entity_policies ||= @iam.list_attached_group_policies(group_name: entity.group_name)

ruby/example_code/iam/list_users.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def initialize(iam_client, logger: Logger.new($stdout))
1616
# Displays information about available users in AWS Identity and Access Management (IAM).
1717
# This includes user names, associated group names, inline embedded user policy names,
1818
# and access key IDs. Logging is added for monitoring purposes.
19-
def get_user_details
19+
def user_details
2020
@logger.info('Requesting list of users')
2121
users_response = @iam_client.list_users
2222

ruby/example_code/iam/manage_users.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def delete_user(user_name)
153153
# AWS Identity and Access Management (IAM). This includes user names, associated
154154
# group names, inline embedded user policy names, and access key IDs. Logging is
155155
# added for monitoring purposes.
156-
def get_user_details
156+
def user_details
157157
@logger.info('Requesting list of users')
158158
users_response = list_users
159159
if users_response.users.empty?

ruby/example_code/iam/spec/list_admins_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
it 'returns true' do
1414
user = iam_client.create_user(user_name: 'test_admin_user').user
1515
iam_client.attach_user_policy({
16-
policy_arn: 'arn:aws:iam::aws:policy/AdministratorAccess', # Use the correct ARN for the admin policy
16+
policy_arn: 'arn:aws:iam::aws:policy/AdministratorAccess',
17+
# Use the correct ARN for the admin policy
1718
user_name: user.user_name
1819
})
1920

ruby/example_code/lambda/lambda_function.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# @param context [Hash] Methods and properties that provide information
1414
# about the invocation, function, and execution environment.
1515
# @return incremented_number [String] The incremented number.
16-
def lambda_handler(event:, context:)
16+
def lambda_handler(event:, _)
1717
logger = Logger.new($stdout)
1818
log_level = ENV['LOG_LEVEL']
1919
logger.level = case log_level

ruby/example_code/lambda/lambda_function_updated.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# @param context [Hash] Methods and properties that provide information.
1414
# about the invocation, function, and execution environment.
1515
# @ return product [String] The product of the two numbers.
16-
def lambda_handler(event:, context:)
16+
def lambda_handler(event:, _)
1717
logger = Logger.new($stdout)
1818
log_level = ENV['LOG_LEVEL']
1919
logger.level = case log_level

0 commit comments

Comments
 (0)