[macruby-changes] [4355] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Tue Jul 13 15:37:11 PDT 2010
Revision: 4355
http://trac.macosforge.org/projects/ruby/changeset/4355
Author: ernest.prabhakar at gmail.com
Date: 2010-07-13 15:37:10 -0700 (Tue, 13 Jul 2010)
Log Message:
-----------
Deprecate Dispatch::Queue#label in favor of to_s
Modified Paths:
--------------
MacRuby/trunk/gcd.c
MacRuby/trunk/spec/macruby/core/gcd/queue_spec.rb
MacRuby/trunk/spec/macruby/tags/macruby/core/gcd/queue_tags.txt
Modified: MacRuby/trunk/gcd.c
===================================================================
--- MacRuby/trunk/gcd.c 2010-07-13 22:37:08 UTC (rev 4354)
+++ MacRuby/trunk/gcd.c 2010-07-13 22:37:10 UTC (rev 4355)
@@ -528,14 +528,14 @@
/*
* call-seq:
- * gcdq.label -> str
+ * gcdq.to_s -> str
*
- * Returns the label of the dispatch queue (aliased to 'to_s')
+ * Returns the label of the dispatch queue
*
* gcdq = Dispatch::Queue.new('doc')
- * gcdq.label #=> 'doc'
+ * gcdq.to_s #=> 'doc'
* gcdq = Dispatch::Queue.main
- * gcdq.label #=> 'com.apple.main-thread'
+ * gcdq.to_s #=> 'com.apple.main-thread'
*
*/
@@ -1247,7 +1247,7 @@
rb_objc_define_method(cQueue, "async", rb_queue_dispatch_async, -1);
rb_objc_define_method(cQueue, "sync", rb_queue_dispatch_sync, 0);
rb_objc_define_method(cQueue, "after", rb_queue_dispatch_after, 1);
- rb_objc_define_method(cQueue, "label", rb_queue_label, 0);
+ rb_objc_define_method(cQueue, "label", rb_queue_label, 0); // deprecated
rb_objc_define_method(cQueue, "to_s", rb_queue_label, 0);
rb_objc_define_method(cQueue, "resume!", rb_dispatch_resume, 0);
rb_objc_define_method(cQueue, "suspend!", rb_dispatch_suspend, 0);
Modified: MacRuby/trunk/spec/macruby/core/gcd/queue_spec.rb
===================================================================
--- MacRuby/trunk/spec/macruby/core/gcd/queue_spec.rb 2010-07-13 22:37:08 UTC (rev 4354)
+++ MacRuby/trunk/spec/macruby/core/gcd/queue_spec.rb 2010-07-13 22:37:10 UTC (rev 4355)
@@ -158,17 +158,13 @@
end
end
- describe :label, :shared => true do
+ describe :to_s do
it "returns the name of the queue" do
- @q.label.should == 'org.macruby.gcd_spec.queue'
+ @q.to_s.should == 'org.macruby.gcd_spec.queue'
qm = Dispatch::Queue.main
- qm.label.should == 'com.apple.main-thread'
+ qm.to_s.should == 'com.apple.main-thread'
end
- end
-
- describe :to_s do
- it_should_behave_like :label
end
describe :suspend! do
Modified: MacRuby/trunk/spec/macruby/tags/macruby/core/gcd/queue_tags.txt
===================================================================
--- MacRuby/trunk/spec/macruby/tags/macruby/core/gcd/queue_tags.txt 2010-07-13 22:37:08 UTC (rev 4354)
+++ MacRuby/trunk/spec/macruby/tags/macruby/core/gcd/queue_tags.txt 2010-07-13 22:37:10 UTC (rev 4355)
@@ -1,3 +1,2 @@
fails:Dispatch::Queue == should be true if the underlying dispatch_queues are equal
-fails:to_s returns the name of the queue
fails:suspend! suspends the queue which can be resumed by calling #resume!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100713/76ade7a6/attachment-0001.html>
More information about the macruby-changes
mailing list