Skip to content

Commit

Permalink
Merge pull request #1756 from troessner/support-ruby-3-3
Browse files Browse the repository at this point in the history
Add support for Ruby 3.3
  • Loading branch information
mvz authored Dec 28, 2023
2 parents a05c654 + be810ff commit 17721d2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

strategy:
matrix:
ruby: ["2.7", "3.0", "3.1", "3.2", "jruby-9.4"]
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "jruby-9.4"]

steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ruby RUBY_VERSION

group :development do
gem 'aruba', '~> 2.1'
gem 'bigdecimal', '>= 2.0.0', '< 4.0'
gem 'codeclimate-engine-rb', '~> 0.4.0'
gem 'cucumber', '~> 9.0'
gem 'kramdown', '~> 2.1'
Expand Down
8 changes: 3 additions & 5 deletions lib/reek/documentation_link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ def build(subject)
Kernel.format(HELP_LINK_TEMPLATE, version: Version::STRING, item: name_to_param(subject))
end

# Convert the given subject name to a form that is acceptable in a URL.
# Convert the given subject name to a form that is acceptable in a URL, by
# dasherizeing it at the start of capitalized words. Spaces are discared.
def name_to_param(name)
# Splits the subject on the start of capitalized words, optionally
# preceded by a space. The space is discarded, the start of the word is
# not.
name.split(/ *(?=[A-Z][a-z])/).join('-')
name.split(/([A-Z][a-z][a-z]*)/).map(&:strip).reject(&:empty?).join('-')
end
end
end
6 changes: 6 additions & 0 deletions spec/reek/documentation_link_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
to eq "https://github.com/troessner/reek/blob/v#{Reek::Version::STRING}/docs/Feature-Envy.md"
end

it 'returns the correct link for a smell type with another name' do
expect(described_class.build('UncommunicativeMethodName')).
to eq "https://github.com/troessner/reek/blob/v#{Reek::Version::STRING}" \
'/docs/Uncommunicative-Method-Name.md'
end

it 'returns the correct link for general documentation' do
expect(described_class.build('Rake Task')).
to eq "https://github.com/troessner/reek/blob/v#{Reek::Version::STRING}/docs/Rake-Task.md"
Expand Down

0 comments on commit 17721d2

Please sign in to comment.