Skip to content

Commit

Permalink
Merge 8d35ad6 into dc7cb17
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzedge committed May 14, 2023
2 parents dc7cb17 + 8d35ad6 commit 17dd453
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 28 deletions.
31 changes: 30 additions & 1 deletion .codeclimate.yml
@@ -1,2 +1,31 @@
exclude_paths:
exclude_patterns:
- 'tasks/'
plugins:
# No to-dos or similar
fixme:
enabled: true
exclude_patterns:
- '.rubocop.*'
# ABC-complexity
flog:
enabled: true
exclude_patterns:
- 'specs/'
# Markdown lint with rules from https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md
markdownlint:
enabled: true
# Code smells
reek:
enabled: true
exclude_patterns:
- 'specs/'
# Ruby lint
rubocop:
enabled: true
channel: rubocop-1-50-2
# Semgrep Ruby rules
semgrep:
enabled: true
runs:
- configs:
- rules/ruby/lang
2 changes: 2 additions & 0 deletions .mdlrc
@@ -0,0 +1,2 @@
rule 'MD013', line_length: 120
rule 'MD029', style: 'ordered'
25 changes: 9 additions & 16 deletions CHANGELOG.md
@@ -1,3 +1,5 @@
# CHANGELOG

## 2.3.2 [compare][compare_v2_3_1_and_master]

## 2.3.1 [compare][compare_v2_3_0_and_v2_3_1]
Expand Down Expand Up @@ -60,7 +62,7 @@
- Add `Readers::Reader` and `Serializer::Serializer` base classes
- Make all readers/serializers extend from their corresponding base classes
- Better docs with `Reader`/`Serializer` and generics
- Fix all code blocks from `\`` to `+` and add some more
- Fix all code blocks from backtick to `+` and add some more
- Add `@return [void]` where appropriate
- Add `@return [self]` where appropriate
- Fix `Nodes::Node` duplicate and broken references
Expand Down Expand Up @@ -319,20 +321,15 @@ Most of these help with the gem's overall performance.

- Add Ruby 2.4 to supported versions by [@gonzedge][github_user_gonzedge]
- Drastically reduce size of gem by [@gonzedge][github_user_gonzedge]

By excluding unnecessary `assets/` and `reports/` when building the gem.
**Size reduction**: from ~472KB to ~21KB.

- By excluding unnecessary `assets/` and `reports/` when building the gem.
- **Size reduction**: from ~472KB to ~21KB.
- Make root node accessible via container by [@gonzedge][github_user_gonzedge]

So that anyone using rambling-trie can develop their custom algorithms

- So that anyone using rambling-trie can develop their custom algorithms
- Expose root node's `#to_a` method through `Container` by
[@gonzedge][github_user_gonzedge]
- Add own `Forwardable#delegate` because of [Ruby 2.4 performance
degradation][ruby_bug_13111] by [@gonzedge][github_user_gonzedge]

Was able to take Creation and Compression benchmarks (~8.8s and ~1.5s
- Was able to take Creation and Compression benchmarks (~8.8s and ~1.5s
respectively) back down to the Ruby 2.3.3 levels by adding own definition of
`Forwardable#delegate`.

Expand Down Expand Up @@ -411,16 +408,12 @@ Most of these help with the gem's overall performance.

- `Rambling::Trie.create` now returns a `Container` instead of a `Root` by
[@gonzedge][github_user_gonzedge]

`Container` exposes these API entry points:

- `Container` exposes these API entry points:
- `#partial_word?` and its alias `#match?`
- `#word?` and its alias `#include?`
- `#add` and its alias `#<<`
- yield the constructed `Container` on `#initialize`

`Rambling::Trie::Node` and its subclasses no longer expose:

- `Rambling::Trie::Node` and its subclasses no longer expose:
- `#match?`
- `#include?`
- `#<<`
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
@@ -1,4 +1,4 @@
## Contributing to Rambling Trie
# Contributing to Rambling Trie

1. If you have found a bug or have a feature request, please [search through the issues][github_issues_all] to see if it has already been reported. If that's not the case, then [create a new one][github_issues_new] with a full description of what you have found or what you need.
2. If you have bug fix or a feature implementation in mind, then [fork Rambling Trie][github_fork] and create a branch with a descriptive name.
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -16,7 +16,7 @@ group :development do
end

group :test do
gem 'coveralls_reborn', '~> 0.27.0', require: false
gem 'coveralls_reborn', require: false
gem 'rspec_junit_formatter'
gem 'simplecov', require: false
end
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -184,8 +184,8 @@ trie = Rambling::Trie.load '/path/to/file'

Currently, these formats are supported to store tries on disk:

- Ruby's [binary (Marshal)][marshal] format
- [YAML][yaml]
* Ruby's [binary (Marshal)][marshal] format
* [YAML][yaml]

> When dumping into or loading from disk, the format is determined
> automatically based on the file extension, so `.yml` or `.yaml` files will be
Expand Down
18 changes: 11 additions & 7 deletions spec/integration/rambling/trie_spec.rb
Expand Up @@ -13,24 +13,28 @@
let(:changelog_path) { File.join root_path, 'CHANGELOG.md' }
let(:changelog) { File.read changelog_path }

let(:changelog_versions) do
matches = []
changelog.scan %r{^## (\d+\.\d+\.\d+)} do |match|
matches << match[0]
end
matches
end

it 'matches with the version in the README badge' do
match = %r{\?version=(?<version>.*)$}.match readme
expect(match['version']).to eq Rambling::Trie::VERSION
end

it 'is the version before the one at the top of the CHANGELOG' do
match = %r{## (?<version>\d+\.\d+\.\d+)}.match changelog.split("\n")[0]
changelog_version = Gem::Version.new match['version']
changelog_version = Gem::Version.new changelog_versions.first
lib_version = Gem::Version.new "#{Rambling::Trie::VERSION}.0"
expect(changelog_version).to eq lib_version.bump
end

it 'is included in the CHANGELOG diffs' do
matches = Set.new
changelog.scan %r{^## (\d+\.\d+\.\d+)} do |match|
matches << match[0]
end
expect(matches).to include Rambling::Trie::VERSION
changelog_versions.shift
expect(changelog_versions.first).to eq Rambling::Trie::VERSION
end
end

Expand Down

0 comments on commit 17dd453

Please sign in to comment.