Ruby Issue Tracking System: Issueshttps://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-11-17T09:56:15ZRuby Issue Tracking System
Redmine Ruby master - Feature #7378 (Closed): Adding Pathname#writehttps://bugs.ruby-lang.org/issues/73782012-11-17T09:56:15Zaef (Alexander E. Fischer)aef@raxys.net
<p>There should be a variant of File.write for Pathname.</p>
<p>I will provide a patch if this is acceptable.</p>
<p>(Please see my other Pathname related tickets too: <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Adding Pathname#glob (Closed)" href="https://bugs.ruby-lang.org/issues/7360">#7360</a> <a class="issue tracker-2 status-6 priority-4 priority-default closed" title="Feature: Adding Pathname#touch (Rejected)" href="https://bugs.ruby-lang.org/issues/7361">#7361</a> <a class="issue tracker-2 status-2 priority-4 priority-default" title="Feature: Adding Pathname#start_with? (Assigned)" href="https://bugs.ruby-lang.org/issues/7362">#7362</a> <a class="issue tracker-2 status-6 priority-4 priority-default closed" title="Feature: Remove the global Pathname() method (Rejected)" href="https://bugs.ruby-lang.org/issues/7363">#7363</a> )</p> Ruby master - Feature #7363 (Rejected): Remove the global Pathname() methodhttps://bugs.ruby-lang.org/issues/73632012-11-15T22:50:18Zaef (Alexander E. Fischer)aef@raxys.net
<p>About a year ago I sumbitted an not yet accepted patch for Ruby on GitHub which deprecates the global Pathname() method and adds the .[] operator to the Pathname class. The patch got ignored, supposedly because I didn't post it here.</p>
<p><a href="https://github.com/ruby/ruby/pull/61" class="external">https://github.com/ruby/ruby/pull/61</a></p>
<p>I think poisoning the global namespace with methods named after classes should be considered bad style. Instead, all related methods should lie below the Class' namespace. I hope you share that opinion.</p>
<p>As some User once suggested that probably only collection type classes (e.g. Set) should have a .[] operator, I'm no longer proposing to add .[] instead to Pathname.</p>
<p>If you like the idea, please let me know. I will modify the patch then.</p> Ruby master - Feature #7361 (Rejected): Adding Pathname#touchhttps://bugs.ruby-lang.org/issues/73612012-11-15T22:30:18Zaef (Alexander E. Fischer)aef@raxys.net
<p>Pathname has an #mkdir method to create a directory at the path, but does not have a #touch method to create an empty file at that path.</p>
<p>There were numerous cases where I had to fallback to using</p>
<p>new_file = Pathname.new('location/for/new/file')<br>
FileUtils.touch(new_file)</p>
<p>instead of simply being able to use:</p>
<p>new_file.touch</p>
<p>I would like to add this method. If you like it, let me know. I will provide a patch then.</p> Ruby master - Feature #7360 (Closed): Adding Pathname#globhttps://bugs.ruby-lang.org/issues/73602012-11-15T22:26:44Zaef (Alexander E. Fischer)aef@raxys.net
<p>Currently there is only a Pathname.glob method, which allows you to find Pathname objects by a pattern including wildcard characters like '*'.</p>
<p>I would like to be able to use this relative to a current Pathname.</p>
<p>some_directory = Pathname.new('some_directory')<br>
Pathname.glob(some_directory + 'a*') # all children starting with "a"</p>
<p>could then simply be:</p>
<p>some_directory.glob('a*') # all children starting with "a"</p>
<p>If you like the idea, please let me know. I will provide a patch then.</p> Ruby master - Feature #7359 (Rejected): #eql? and #equal? naminghttps://bugs.ruby-lang.org/issues/73592012-11-15T22:00:06Zaef (Alexander E. Fischer)aef@raxys.net
<p>In my opinion the difference between @#eql?@ and @#equal?@ is really unintuitive. How about making their difference more obvious by giving one of them a more accurate name?</p>
<p>My proposal is to rename @#equal?@ to @#identic?@.</p>
<p>If you deprecate #equal? at the same time, maybe in the far future it can have a comeback as an alias for #eql? to make those people happy who dislike to use abbreviations just to reduce the character count by two and simultaneously making it harder to read in a classical sense.</p>
<p>If you like it, let me know. Then I will provide a patch.</p> Ruby master - Bug #7213 (Rejected): Namespace regression problem in RSpec from 1.9.2 to 1.9.3https://bugs.ruby-lang.org/issues/72132012-10-25T05:02:15Zaef (Alexander E. Fischer)aef@raxys.net
<p>This article describes a bug which appeared in 1.9.3: "Including namespace module through RSpec config in Ruby 1.9.3":<a href="http://stackoverflow.com/questions/13042298/including-namespace-module-through-rspec-config-in-ruby-1-9-3" class="external">http://stackoverflow.com/questions/13042298/including-namespace-module-through-rspec-config-in-ruby-1-9-3</a></p>
<p>Some people believe that it could be related to <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Object.const_get(:A, false) can access BasicObject::A (Closed)" href="https://bugs.ruby-lang.org/issues/3422">#3422</a> which seemed to introduce regression but it wasn't sure if this regression was wanted or not.</p>