Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
ethowitz committed Jan 19, 2024
1 parent 2dfbcbe commit 9bd4f76
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
12 changes: 7 additions & 5 deletions lib/readyset/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def self.call
end

def initialize(connection_count:, controller_status:, database_connection_status:,
last_completed_snapshot:, last_replicator_error:, last_started_controller:,
last_started_replication:, minimum_replication_offset:, maximum_replication_offset:,
snapshot_status:) # :nodoc:
last_completed_snapshot:, last_replicator_error:, last_started_controller:,
last_started_replication:, minimum_replication_offset:,
maximum_replication_offset:, snapshot_status:) # :nodoc:
@connection_count = connection_count
@database_connection_status = database_connection_status
@last_completed_snapshot = last_completed_snapshot
Expand All @@ -41,11 +41,13 @@ def self.from_readyset_result(rows)

new(
connection_count: attributes['Connection Count'].to_i,
database_connection_status: attributes['Database Connection'].downcase.gsub(' ', '_').to_sym,
database_connection_status:
attributes['Database Connection'].downcase.gsub(' ', '_').to_sym,
last_completed_snapshot: parse_timestamp_if_not_nil(attributes['Last completed snapshot']),
last_replicator_error: attributes['Last replicator error'],
last_started_controller: parse_timestamp_if_not_nil(attributes['Last started Controller']),
last_started_replication: parse_timestamp_if_not_nil(attributes['Last started replication']),
last_started_replication:
parse_timestamp_if_not_nil(attributes['Last started replication']),
minimum_replication_offset: attributes['Minimum Replication Offset'],
maximum_replication_offset: attributes['Maximum Replication Offset'],
controller_status: attributes['ReadySet Controller Status'],
Expand Down
6 changes: 3 additions & 3 deletions lib/readyset/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def initialize(name:, status:, description:) # :nodoc:
# @param other [Readyset::Table] the table to which `self` should be compared
# @return [Boolean]
def ==(other) # :nodoc:
self.name == other.name &&
self.description == other.description &&
self.status == other.status
name == other.name &&
description == other.description &&
status == other.status
end

private
Expand Down
2 changes: 1 addition & 1 deletion spec/status_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
status = Readyset::Status.call

expect(status.database_connection_status).to eq(:connected)
expect(status.connection_count).to eq(1)
expect(status.connection_count).to be_a(Integer)
expect(status.snapshot_status).to eq(:completed)
expect(status.minimum_replication_offset).
to match(/\([0-9A-F]{1,8}\/[0-9A-F]{1,8}, [0-9A-F]{1,8}\/[0-9A-F]{1,8}\)/)
Expand Down

0 comments on commit 9bd4f76

Please sign in to comment.