summaryrefslogtreecommitdiff
path: root/lib/set.rb
AgeCommit message (Collapse)Author
2014-08-06* lib/set.rb (Set#replace): Check if an object given is enumerableknu
before clearing self. Reported by yui-knk. [GH-675] https://github.com/ruby/ruby/pull/675 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-06Implement Set#clone. [Fixes GH-661]knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05* lib/set.rb: [DOC] Fix grammatical error by @bouk [fix GH-524]hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28* lib/set.rb: [DOC] Add examples for Set#intersect? and Set#disjoint?zzak
Patch by xavier nayrac [Bug #9331] [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22* lib/set.rb (class SortedSet): Fix source_location for methods defined via ↵tmm1
eval. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-31* lib/set.rb: [DOC] Add a couple of notes on Hash as storage.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-31* lib/set.rb: [DOC] Fix example result. Hash is now ordered.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-31Use the term "sorted" instead "ordered" when mentioning SortSet.knu
* lib/set.rb: [DOC] Use the term "sorted" instead "ordered" when mentioning SortSet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-30Add Set#intersect? and #disjoint?.knu
* lib/set.rb (Set#intersect?, Set#disjoint?): Add new methods for testing if two sets have any element in common. [ruby-core:45641] [Feature #6588] Based on the code by marcandre. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-19Define Set#to_set so that aSet.to_set returns self.knu
* lib/set.rb (Set#to_set): Define Set#to_set so that aSet.to_set returns self. [Fixes GH-359] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-01* lib/set.rb (Set#freeze, taint, untaint): Save a "self" byknu
utilizing super returning self, and add tests while at it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-20* lib/set.rb (Set#delete_if, Set#keep_if): Avoid blockless call ofknu
proc, which is not portable to JRuby. Replace &method() with faster and simpler literal blocks while at it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19* lib/set.rb (Set#delete_if, Set#keep_if): Add comments.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18* lib/set.rb (Set#delete_if, Set#keep_if): Make Set#delete_if andknu
Set#keep_if more space and time efficient by avoiding to_a. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-24Move tests embedded in lib/set.rb to test/test_set.rb.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-22Drop executable bits.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-01* lib/set.rb (#initialize_copy, #eql): Use instance_variable_getknu
instead of instance_eval. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-31* lib/set.rb (Set#{each,reject!,select!}, SortedSet#each): Passknu
the original block through instead of creating one that only yields the passed argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-30* lib/set.rb (Set#{<,>,<=,>=}): Define comparison operators asknu
shorthand for the {proper_}{subset?,superset?} methods (finally). Given a push by Alexander E. Fischer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-20* lib/set.rb (SortedSet.setup): remove old_init after initializeakr
method is redefined. The remove before redefinition makes the warning prevention fragile. [ruby-dev:44892] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-20* lib/set.rb (SortedSet.setup): don't remove old_init. The removeakr
makes the warning prevention fragile. [ruby-dev:44892] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05* ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,ktsj
ext/tk/sample/demos-en/widget, lib/benchmark.rb, lib/irb/cmd/fork.rb, lib/mkmf.rb, lib/net/ftp.rb, lib/net/smtp.rb, lib/open3.rb, lib/pstore.rb, lib/rexml/element.rb, lib/rexml/light/node.rb, lib/rinda/tuplespace.rb, lib/rss/maker/base.rb, lib/rss/maker/entry.rb, lib/scanf.rb, lib/set.rb, lib/shell.rb, lib/shell/command-processor.rb, lib/shell/process-controller.rb, lib/shell/system-command.rb, lib/uri/common.rb: remove unused block arguments to avoid creating Proc objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-19* lib: revert r31635-r31638 and untabify with expand(1).nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18 * lib: Convert tabs to spaces for ruby files perdrbrain
http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style Patch by Steve Klabnik [Ruby 1.9 - Bug #4730] Patch by Jason Dew [Ruby 1.9 - Feature #4718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-11 * lib/set.rb (class Set): Add nodoc to internal-use methods. Patch by ↵drbrain
Pete Higgins. [Ruby 1.9 - Bug #4665] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-10* lib/set.rb (Set#replace): Apply a bit of optimization.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-30* lib/set.rb (keep_if, select!): New methods [ruby-core:29749]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-11Fri Feb 12 02:27:39 2010 Akinori MUSHA <knu@iDaemons.org>knu
* lib/set.rb (Set#initialize, Set#replace, Set#merge) (Set#subtract, Set#&): Fix duck type tests. [ruby-core:28078] * lib/set.rb (Set#initialize, Set#replace, Set#merge) (Set#subtract, Set#&): Try #each if #each_entry fails. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-02* enum.c (enum_each_entry): new method #each_entry to pack valuesmatz
from yield into an array. * lib/set.rb (Set#merge): use Enumerable#each_entry to implement Set compatible to 1.8 behavior. [ruby-core:27985] * lib/set.rb: replace is_a?(Enumerable) with respond_to?(:each) for duck typing. * lib/set.rb (SortedSet#add): typo fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-19* lib/set.rb: Add checks that passed argument is Enumerable. [ruby-core:23844]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-13* lib/set.rb (==): Optimization; patch by Arthur Schreiber [ruby-core:17203]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-07* lib/set.rb (SortedSet#add): Do not require each newly addedknu
element to be Comparable but to respond to <=>. [ruby-dev:38371] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-02* lib/set.rb (SortedSet): Fix document. [Bug #1429]knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-01* lib/set.rb (Set#merge): Only directly use the passed objectsknu
@hash instance variable when self and the passed object are instances of the same class. [Bug #118] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-01* lib/set.rb (SortedSet#add): Do not let an uncomparable objectknu
in. [Bug #118] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06* {ext,lib,test}/**/*.rb: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* golf_prelude.rb, lib/set.rb (TC_Set#test_each),knu
test/readline/test_readline_history.rb (Readline#test_each__enumerator), test/ruby/test_array.rb (TestArray#test_collect), test/ruby/test_enumerator.rb (TestEnumerator#test_initialize): Enumerable::Enumerator is now called Enumerator. * lib/rinda/tuplespace.rb (Rinda::TupleBag#initialize): Use enum_for instead of hardcoding Enumerable::Enumerator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* lib/set.rb (Set#delete_if): Call to_a.knu
(SortedSet#delete_if, TC_SortedSet#test_sortedset): Use super to yield elements in sorted order; [ruby-core:17144] by Arthur Schreiber. (SortedSet#each, SortedSet#each, TC_Set#test_each) (TC_SortedSet#test_sortedset): Return self; [ruby-dev:35002] by Arthur Schreiber. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-03* lib/set.rb (Set#classify): Back out the `group_by' alias.knu
Better think twice. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-03Properly back out.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-03* lib/set.rb (Set#collect, Set#select): Back out. I thought itknu
was consistent but turned out to be wrong. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-03* lib/set.rb (Set#collect, Set#select): Override Enumerableknu
methods and make them return a set. [ruby-core:17055] (Set#delete_if, Set#collect!, Set#reject!, Set#classify) (Set#divide, Set#delete_if): Return an enumerator if no block is given. (Set#classify): Define an alias `group_by' to override that of Enumerable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-23* lib/set.rb (Set#each, SortedSet#each, TC_Set#test_each): Returnknu
an enumerator if no block is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-21* lib/ipaddr.rb: Say that I am the current maintainer.knu
* lib/set.rb: Ditto. * lib/shellwords.rb: Ditto. * ext/syslog/syslog.txt: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-20* lib/set.rb: Revise rdoc.knu
* lib/set.rb (Set#freeze, Set#taint, Set#untaint): Implement Set#freeze, Set#taint, and Set#untaint; requested by: Dan Hutchings <dan AT moltoagitato.com> in [ruby-bugs:PR#9359]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-03* lib/set.rb (Set#^, Set#&): Correct documentation. Those methodsknu
return sets, not arrays; noted by Oliver Frank Wittich <nietz AT mangabrain.de>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-02* lib/set.rb (Set#^): Fix XOR operation against a container thatknu
holds duplicate values. [issue: #6444] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-02* lib/xmlrpc/create.rb (XMLRPC::Create::conv2value): Symbol shouldmatz
come earlier than String. * lib/soap/mapping/rubytypeFactory.rb (RubytypeFactory::obj2soap): ditto. * lib/set.rb (TC_Set::test_s_new): strings are no longer Enumerable * lib/soap/property.rb (Property::load): ditto. * lib/webrick/httputils.rb (WEBrick::HTTPUtils::parse_header): ditto. * lib/soap/mimemessage.rb (MIMEMessage::Headers::parse): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-04* lib/set.rb: test change to follow revision 1.28. (duck typing?)ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e