Skip to content

Commit

Permalink
Bump version to 3.0.0
Browse files Browse the repository at this point in the history
  * Drop support for Ruby 3.0
  • Loading branch information
infused committed Dec 28, 2023
1 parent e4e15ff commit 00c5911
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 262 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3', 'head']
ruby-version: ['3.1', '3.2', '3.3', 'head']

steps:
- uses: actions/checkout@v3
Expand Down
164 changes: 1 addition & 163 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,201 +5,39 @@ require:
AllCops:
NewCops: enable

Layout/ArgumentAlignment:
Enabled: true
EnforcedStyle: with_fixed_indentation

Layout/ParameterAlignment:
Enabled: true
EnforcedStyle: with_fixed_indentation

Layout/CaseIndentation:
Enabled: false

Layout/ElseAlignment:
Enabled: false

Layout/EmptyLinesAroundBlockBody:
Gemspec/RequiredRubyVersion:
Enabled: false

Layout/EndAlignment:
Enabled: true
EnforcedStyleAlignWith: start_of_line

Layout/FirstArrayElementIndentation:
Enabled: true
EnforcedStyle: consistent

Layout/FirstHashElementIndentation:
Enabled: true
EnforcedStyle: consistent

Layout/LineLength:
Enabled: false

Layout/MultilineHashBraceLayout:
Enabled: true
EnforcedStyle: symmetrical

Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented

Layout/MultilineOperationIndentation:
Enabled: true
EnforcedStyle: indented

Layout/RescueEnsureAlignment:
Enabled: false

Layout/SpaceInsideHashLiteralBraces:
Enabled: true
EnforcedStyle: no_space

Layout/SpaceInLambdaLiteral:
Enabled: true
EnforcedStyle: require_space

Layout/TrailingWhitespace:
Enabled: false

Lint/AmbiguousBlockAssociation:
Enabled: false

Lint/AssignmentInCondition:
Enabled: false

Lint/SuppressedException:
Enabled: true

Lint/ShadowingOuterLocalVariable:
Enabled: false

Lint/RedundantSplatExpansion:
Enabled: false

Metrics/AbcSize:
Enabled: false

Metrics/BlockLength:
CountComments: false
Enabled: true
Max: 100

Metrics/ClassLength:
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: true
Max: 10

Metrics/MethodLength:
Enabled: false

Metrics/ModuleLength:
Enabled: false

Metrics/PerceivedComplexity:
Enabled: true
Max: 10

Naming/AccessorMethodName:
Enabled: true

Naming/FileName:
Enabled: false

Naming/MethodParameterName:
Enabled: false

Naming/PredicateName:
Enabled: true

Naming/VariableNumber:
Enabled: false

RSpec/AnyInstance:
Enabled: false

RSpec/DescribeClass:
Enabled: true

RSpec/DescribedClass:
Enabled: false

RSpec/ExampleLength:
Enabled: true
Max: 25

RSpec/HookArgument:
Enabled: false

RSpec/ImplicitSubject:
Enabled: false

RSpec/LetSetup:
Enabled: false

RSpec/MessageSpies:
Enabled: false

RSpec/MultipleExpectations:
Enabled: false

RSpec/NestedGroups:
Enabled: true
Max: 5

RSpec/NotToNot:
Enabled: true
EnforcedStyle: to_not

RSpec/VerifiedDoubleReference:
Enabled: false

Security/YAMLLoad:
Enabled: true

Style/Alias:
Enabled: false

Style/ClassAndModuleChildren:
Enabled: false

Style/Documentation:
Enabled: false

Style/EmptyMethod:
Enabled: true
EnforcedStyle: expanded

Style/FormatStringToken:
Enabled: false

Style/GuardClause:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/Lambda:
Enabled: false

Style/NumericPredicate:
Enabled: false

Style/PerlBackrefs:
Enabled: false

Style/RedundantBegin:
Enabled: false

Style/RescueModifier:
Enabled: false

Style/SafeNavigation:
Enabled: false

Style/SymbolArray:
Enabled: true
EnforcedStyle: brackets
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.2
3.3.0
34 changes: 0 additions & 34 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,3 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec features)

## Uncomment to clear the screen before every task
# clearing :on

## Guard internally checks for changes in the Guardfile and exits.
## If you want Guard to automatically start up again, run guard in a
## shell loop, e.g.:
##
## $ while bundle exec guard; do echo "Restarting Guard..."; done
##
## Note: if you are using the `directories` clause above and you are not
## watching the project directory ('.'), then you will want to move
## the Guardfile to a watched dir and symlink it back, e.g.
#
# $ mkdir config
# $ mv Guardfile config/
# $ ln -s config/Guardfile .
#
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"

# Note: The cmd option is now required due to the increasing number of ways
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle exec rspec'
# * bundler binstubs: 'bin/rspec'
# * spring: 'bin/rspec' (This will use spring if running and you have
# installed the spring binstubs per the docs)
# * zeus: 'zeus rspec' (requires the server to be started separately)
# * 'just' rspec: 'rspec'

guard :rspec, cmd: 'bundle exec rspec' do
require 'guard/rspec/dsl'
dsl = Guard::RSpec::Dsl.new(self)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2023 Keith Morrison <keithm@infused.org>
Copyright (c) 2015-2024 Keith Morrison <keithm@infused.org>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A Ruby library for working with compass points.

Compass Point is compatible with the following versions of Ruby:

* MRI Ruby 3.0.x, 3.1.x, 3.2.x, and 3.3.x
* MRI Ruby 3.1.x, 3.2.x, and 3.3.x

## Installation

Expand Down Expand Up @@ -68,7 +68,7 @@ example:

## License

Copyright (c) 2015-2023 Keith Morrison <<keithm@infused.org>>
Copyright (c) 2015-2024 Keith Morrison <<keithm@infused.org>>

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion compass_point.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ Gem::Specification.new do |s|
s.files = Dir['LICENSE', 'README.md', '{lib,spec}/**/*.rb', 'compass_points.gemspec']
s.require_paths = ['lib']

s.required_ruby_version = '>= 3.0.0'
s.required_ruby_version = '>= 3.1.0'
s.metadata['rubygems_mfa_required'] = 'true'
end
12 changes: 5 additions & 7 deletions lib/compass_point.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CompassPoint
VERSION = '2.0.1'.freeze
VERSION = '3.0.0'.freeze

COMPASS_BEARING_REGEX = /(n|s)\s(\d{1,3}).?\s(e|w)/.freeze
COMPASS_BEARING_REGEX = /(n|s)\s(\d{1,3}).?\s(e|w)/

POINTS = {
n: {min: 354.38, mid: 0.0, max: 5.62, name: 'North'},
Expand Down Expand Up @@ -41,9 +41,9 @@ class CompassPoint
class << self
def azimuth(s)
input = normalize_input(s)
if point = find_point(input)
if (point = find_point(input))
point[:mid]
elsif match = input.match(COMPASS_BEARING_REGEX)
elsif (match = input.match(COMPASS_BEARING_REGEX))
azimuth_from_match(match)
end
end
Expand Down Expand Up @@ -96,15 +96,13 @@ def azimuth_from_match(match)
180
end

adjust = match[2].to_i

operation = if (match[1] == 'n' && match[3] == 'w') || (match[1] == 's' && match[3] == 'e')
:-
else
:+
end

base.send(operation, adjust)
base.send(operation, match[2].to_i)
end

def generate_compass_quadrant_bearing(b)
Expand Down
Loading

0 comments on commit 00c5911

Please sign in to comment.