Skip to content

Commit

Permalink
Rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
niborg committed Jul 27, 2024
1 parent fde464b commit 4b4c698
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ Style/NegatedWhile:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylenegatedwhile

Style/OptionalBooleanParameter:
Enabled: false

Style/ParallelAssignment:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleparallelassignment
Expand Down
2 changes: 1 addition & 1 deletion lib/gpx/bounds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def center_lon

# Returns true if the pt is within these bounds.
def contains?(pt)
((pt.lat >= min_lat) && (pt.lat <= max_lat) && (pt.lon >= min_lon) && (pt.lon <= max_lon))
(pt.lat >= min_lat) && (pt.lat <= max_lat) && (pt.lon >= min_lon) && (pt.lon <= max_lon)
end

# Adds an item to itself, expanding its min/max lat/lon as needed to
Expand Down
3 changes: 0 additions & 3 deletions lib/gpx/gpx_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ def reset_meta_data
@moving_duration = 0.0
end

# rubocop:disable Style/OptionalBooleanParameter

# Updates the meta data for this GPX file. Meta data includes the
# bounds, the high and low points, and the distance. This is useful when
# you modify the GPX data (i.e. by adding or deleting points) and you
Expand All @@ -222,7 +220,6 @@ def to_s(update_time = true)
doc = generate_xml_doc
doc.to_xml
end
# rubocop:enable Style/OptionalBooleanParameter

def inspect
"<#{self.class.name}:...>"
Expand Down
2 changes: 1 addition & 1 deletion lib/gpx/route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def initialize(opts = {})
@points << Point.new(element: point, gpx_file: @gpx_file)
end
else
@points = (opts[:points] || [])
@points = opts[:points] || []
@name = (opts[:name])
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/gpx/segment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def append_point(pt)

# Returns true if the given time is within this Segment.
def contains_time?(time)
((time >= @earliest_point.time) && (time <= @latest_point.time))
(time >= @earliest_point.time) && (time <= @latest_point.time)
rescue StandardError
false
end
Expand Down Expand Up @@ -105,7 +105,7 @@ def delete_if

# Returns true if this Segment has no points.
def empty?
(points.nil? || points.empty?)
points.nil? || points.empty?
end

# Prints out a nice summary of this Segment.
Expand Down
2 changes: 1 addition & 1 deletion lib/gpx/track.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def delete_area(area)
# Returns true if this track has no points in it. This should return
# true even when the track has empty segments.
def empty?
(points.nil? || points.empty?)
points.nil? || points.empty?
end

# Prints out a friendly summary of this track (sans points). Useful for
Expand Down

0 comments on commit 4b4c698

Please sign in to comment.