Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract abbrev as bundled gems #9607

Merged
merged 4 commits into from Jan 19, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/maintainers.md
Expand Up @@ -72,10 +72,6 @@ have commit right, others don't.

## Default gems Maintainers
### Libraries
#### lib/abbrev.rb
* Akinori MUSHA (knu)
* https://github.com/ruby/abbrev
* https://rubygems.org/gems/abbrev

#### lib/benchmark.rb
* *unmaintained*
Expand Down Expand Up @@ -479,6 +475,10 @@ have commit right, others don't.
#### observer
* https://github.com/ruby/observer

#### abbrev
* https://github.com/ruby/abbrev


## Platform Maintainers
### mswin64 (Microsoft Windows)
* NAKAMURA Usaku (usa)
Expand Down
2 changes: 1 addition & 1 deletion doc/standard_library.rdoc
Expand Up @@ -33,7 +33,6 @@ Socket:: Access underlying OS socket implementations

== Libraries

Abbrev:: Calculates a set of unique abbreviations for a given set of strings
Benchmark:: Provides methods to measure and report the time used to execute code
Bundler:: Manage your Ruby application's gem dependencies
CGI:: Support for the Common Gateway Interface protocol
Expand Down Expand Up @@ -130,3 +129,4 @@ GetoptLong:: Parse command line options similar to the GNU C getopt_long()
Base64:: Support for encoding and decoding binary data using a Base64 representation
BigDecimal:: Provides arbitrary-precision floating point decimal arithmetic
Observable:: Provides a mechanism for publish/subscribe pattern in Ruby
Abbrev:: Calculates a set of unique abbreviations for a given set of strings
1 change: 1 addition & 0 deletions gems/bundled_gems
Expand Up @@ -26,3 +26,4 @@ getoptlong 0.2.1 https://github.com/ruby/getoptlong
base64 0.2.0 https://github.com/ruby/base64
bigdecimal 3.1.6 https://github.com/ruby/bigdecimal
observer 0.1.2 https://github.com/ruby/observer
abbrev 0.1.2 https://github.com/ruby/abbrev
30 changes: 0 additions & 30 deletions lib/abbrev.gemspec

This file was deleted.

133 changes: 0 additions & 133 deletions lib/abbrev.rb

This file was deleted.

47 changes: 25 additions & 22 deletions spec/ruby/library/abbrev/abbrev_spec.rb
@@ -1,31 +1,34 @@
require_relative '../../spec_helper'
require 'abbrev'

#test both Abbrev.abbrev and Array#abbrev in
#the same manner, as they're more or less aliases
#of one another
ruby_version_is ""..."3.4" do
require 'abbrev'

[["Abbrev.abbrev", -> a { Abbrev.abbrev(a)}],
["Array#abbrev", -> a { a.abbrev}]
].each do |(name, func)|
#test both Abbrev.abbrev and Array#abbrev in
#the same manner, as they're more or less aliases
#of one another

describe name do
it "returns a hash of all unambiguous abbreviations of the array of strings passed in" do
func.call(['ruby', 'rules']).should == {"rub" => "ruby",
"ruby" => "ruby",
"rul" => "rules",
"rule" => "rules",
"rules" => "rules"}
[["Abbrev.abbrev", -> a { Abbrev.abbrev(a)}],
["Array#abbrev", -> a { a.abbrev}]
].each do |(name, func)|

func.call(["car", "cone"]).should == {"ca" => "car",
"car" => "car",
"co" => "cone",
"con" => "cone",
"cone" => "cone"}
end
describe name do
it "returns a hash of all unambiguous abbreviations of the array of strings passed in" do
func.call(['ruby', 'rules']).should == {"rub" => "ruby",
"ruby" => "ruby",
"rul" => "rules",
"rule" => "rules",
"rules" => "rules"}

func.call(["car", "cone"]).should == {"ca" => "car",
"car" => "car",
"co" => "cone",
"con" => "cone",
"cone" => "cone"}
end

it "returns an empty hash when called on an empty array" do
func.call([]).should == {}
it "returns an empty hash when called on an empty array" do
func.call([]).should == {}
end
end
end
end
55 changes: 0 additions & 55 deletions test/test_abbrev.rb

This file was deleted.

1 change: 0 additions & 1 deletion tool/sync_default_gems.rb
Expand Up @@ -19,7 +19,6 @@ module SyncDefaultGems
"open-uri": "ruby/open-uri",
"resolv-replace": "ruby/resolv-replace",
English: "ruby/English",
abbrev: "ruby/abbrev",
benchmark: "ruby/benchmark",
cgi: "ruby/cgi",
csv: 'ruby/csv',
Expand Down