Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Ruby Gem

on:
push:
tags: [ 'v*.*.*' ]
tags: ["v*.*.*"]

jobs:
build:
Expand All @@ -13,31 +13,31 @@ jobs:
packages: write

steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.7
uses: actions/setup-ruby@v1
with:
ruby-version: 2.7.x
- uses: actions/checkout@v2
- name: Set up Ruby 3.1
uses: actions/setup-ruby@v1
with:
ruby-version: 3.1.x

- name: Publish to GPR
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
OWNER: ${{ github.repository_owner }}
- name: Publish to GPR
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
OWNER: ${{ github.repository_owner }}

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
29 changes: 14 additions & 15 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,31 @@ name: Ruby
on:
push:
pull_request:
branches: [ main ]
branches: [main]

jobs:
test:

runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ["2.7", "3.0", "3.1", "3.2", "3.3"]
ruby-version: ["3.1", "3.2", "3.3", "3.4"]
allow-failure: [false]
include:
- ruby-version: "ruby-head"
allow-failure: true
continue-on-error: ${{ matrix.allow-failure }}

steps:
- name: Checkout 🛎
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
- name: Run codacy-coverage-reporter 📈
uses: codacy/codacy-coverage-reporter-action@v1
with:
- name: Checkout 🛎
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
- name: Run codacy-coverage-reporter 📈
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AllCops:
TargetRubyVersion: 2.7
TargetRubyVersion: 3.1
Metrics/AbcSize:
Enabled: false
Metrics/CyclomaticComplexity:
Expand Down
7 changes: 4 additions & 3 deletions edits.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ Gem::Specification.new do |spec|
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.required_ruby_version = ">= 2.7"
spec.required_ruby_version = ">= 3.1"

spec.add_development_dependency "benchmark-ips", "~> 2.8"
spec.add_development_dependency "benchmark"
spec.add_development_dependency "benchmark-ips", "~> 2.10"
spec.add_development_dependency "bundler", "~> 2.0"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "redcarpet", "~> 3.5"
spec.add_development_dependency "rspec", "~> 3.9"
spec.add_development_dependency "rspec", "~> 3.11"
spec.add_development_dependency "simplecov", "~> 0.21"
spec.add_development_dependency "simplecov-lcov", "~> 0.8"
spec.add_development_dependency "yard", "~> 0.9"
Expand Down
2 changes: 1 addition & 1 deletion lib/edits/jaro_winkler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def self.distance(
threshold: WINKLER_THRESHOLD,
weight: WINKLER_PREFIX_WEIGHT
)
1.0 - similarity(seq1, seq2, threshold: threshold, weight: weight)
1.0 - similarity(seq1, seq2, threshold:, weight:)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint/Syntax: unexpected token tCOMMA

end
end
end
2 changes: 1 addition & 1 deletion tasks/benchmark.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require "edits"
desc "Compare metrics"
task :benchmark do
words = File.read("/usr/share/dict/words")
.split(/\n/).compact.shuffle(random: Random.new(1))
.split("\n").compact.shuffle(random: Random.new(1))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/MultilineMethodCallIndentation: Align .split with .read on line 8.


Benchmark.bm(20) do |x|
x.report("Hamming") do
Expand Down
6 changes: 3 additions & 3 deletions tasks/benchmark/levenshtein.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace :benchmark do
desc "levenshtein distance vs distance_with_max (x100)"
task :lev_max do
words = File.read("/usr/share/dict/words")
.split(/\n/).compact.shuffle(random: Random.new(1))
.split("\n").compact.shuffle(random: Random.new(1))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/MultilineMethodCallIndentation: Align .split with .read on line 10.

.take(101)

Benchmark.ips do |x|
Expand Down Expand Up @@ -67,7 +67,7 @@ namespace :benchmark do
desc "restricted distance vs distance_with_max (x100)"
task :restricted_max do
words = File.read("/usr/share/dict/words")
.split(/\n/).compact.shuffle(random: Random.new(1))
.split("\n").compact.shuffle(random: Random.new(1))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/MultilineMethodCallIndentation: Align .split with .read on line 69.

.take(101)

Benchmark.ips do |x|
Expand Down Expand Up @@ -126,7 +126,7 @@ namespace :benchmark do
desc "most_similar vs min_by (100 words)"
task :lev_similar do
words = File.read("/usr/share/dict/words")
.split(/\n/).compact.shuffle(random: Random.new(1))
.split("\n").compact.shuffle(random: Random.new(1))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/MultilineMethodCallIndentation: Align .split with .read on line 128.

.take(100)

Benchmark.ips do |x|
Expand Down