Having got quite used to Rails.root returning a Pathname object to allow easy concatenation of paths, I noticed that Rails.public_path doesn''t. I checked in 2.3.5 and master and it''s not in either case. It seems easy enough to do: railties/lib/initializer.rb (for 2.3.5): def public_path @@public_path ||= Pathname(self.root ? File.join(self.root, "public") : "public") end railties/lib/rails.rb (for 3.0 beta): def public_path @@public_path ||= Pathname(self.root ? File.join(self.root, "public") : "public") end Am I missing something? Is there a reason for the inconsistency that I''m unaware of? I''m happy to provide a patch if required, but it''s going to be fairly minimal given the change above is Pathname and two parenthesis :-) Cheers, Andy -- Andy Jeffries http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
I say submit the patch. It sounds to me just like something overlooked. On 18 February 2010 02:26, Andy Jeffries <andyjeffries@gmail.com> wrote:> Having got quite used to Rails.root returning a Pathname object to allow > easy concatenation of paths, I noticed that Rails.public_path doesn''t. I > checked in 2.3.5 and master and it''s not in either case. > > It seems easy enough to do: > > railties/lib/initializer.rb (for 2.3.5): > def public_path > @@public_path ||= Pathname(self.root ? File.join(self.root, "public") > : "public") > end > > railties/lib/rails.rb (for 3.0 beta): > def public_path > @@public_path ||= Pathname(self.root ? File.join(self.root, "public") > : "public") > end > > Am I missing something? Is there a reason for the inconsistency that I''m > unaware of? > > I''m happy to provide a patch if required, but it''s going to be fairly > minimal given the change above is Pathname and two parenthesis :-) > > Cheers, > > > Andy > > -- > Andy Jeffries > http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- Ryan Bigg / Radar -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Just my two cents, leave the method as is with a deprecation notice, and add Rails.public as a Pathname. In Rails 3.1 or something it can be tossed out. There''s enough for people to upgrade already, one more thing isn''t necessary. -Nick On Wed, Feb 17, 2010 at 5:44 PM, Ryan Bigg <radarlistener@gmail.com> wrote:> I say submit the patch. It sounds to me just like something overlooked. > > > On 18 February 2010 02:26, Andy Jeffries <andyjeffries@gmail.com> wrote: > >> Having got quite used to Rails.root returning a Pathname object to allow >> easy concatenation of paths, I noticed that Rails.public_path doesn''t. I >> checked in 2.3.5 and master and it''s not in either case. >> >> It seems easy enough to do: >> >> railties/lib/initializer.rb (for 2.3.5): >> def public_path >> @@public_path ||= Pathname(self.root ? File.join(self.root, >> "public") : "public") >> end >> >> railties/lib/rails.rb (for 3.0 beta): >> def public_path >> @@public_path ||= Pathname(self.root ? File.join(self.root, >> "public") : "public") >> end >> >> Am I missing something? Is there a reason for the inconsistency that I''m >> unaware of? >> >> I''m happy to provide a patch if required, but it''s going to be fairly >> minimal given the change above is Pathname and two parenthesis :-) >> >> Cheers, >> >> >> Andy >> >> -- >> Andy Jeffries >> http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Core" group. >> To post to this group, send email to rubyonrails-core@googlegroups.com. >> To unsubscribe from this group, send email to >> rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-core?hl=en. >> > > > > -- > Ryan Bigg / Radar > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
We''re moving away from global locations for this stuff anyway. Your application object should have a paths object on it with the locations of each conceptual location :) Sent from my iPhone On Feb 17, 2010, at 2:55 PM, Nick Quaranto <nick@quaran.to> wrote: Just my two cents, leave the method as is with a deprecation notice, and add Rails.public as a Pathname. In Rails 3.1 or something it can be tossed out. There''s enough for people to upgrade already, one more thing isn''t necessary. -Nick On Wed, Feb 17, 2010 at 5:44 PM, Ryan Bigg <radarlistener@gmail.com> wrote:> I say submit the patch. It sounds to me just like something overlooked. > > > On 18 February 2010 02:26, Andy Jeffries <andyjeffries@gmail.com> wrote: > >> Having got quite used to Rails.root returning a Pathname object to allow >> easy concatenation of paths, I noticed that Rails.public_path doesn''t. I >> checked in 2.3.5 and master and it''s not in either case. >> >> It seems easy enough to do: >> >> railties/lib/initializer.rb (for 2.3.5): >> def public_path >> @@public_path ||= Pathname(self.root ? File.join(self.root, >> "public") : "public") >> end >> >> railties/lib/rails.rb (for 3.0 beta): >> def public_path >> @@public_path ||= Pathname(self.root ? File.join(self.root, >> "public") : "public") >> end >> >> Am I missing something? Is there a reason for the inconsistency that I''m >> unaware of? >> >> I''m happy to provide a patch if required, but it''s going to be fairly >> minimal given the change above is Pathname and two parenthesis :-) >> >> Cheers, >> >> >> Andy >> >> -- >> Andy Jeffries >> http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Core" group. >> To post to this group, send email to rubyonrails-core@googlegroups.com. >> To unsubscribe from this group, send email to >> rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-core?hl=en. >> > > > > -- > Ryan Bigg / Radar > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Thanks for your input guys - new ticket/patch created: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3988-patch Cheers, Andy -- Andy Jeffries http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery On 17 February 2010 22:55, Nick Quaranto <nick@quaran.to> wrote:> Just my two cents, leave the method as is with a deprecation notice, and > add Rails.public as a Pathname. In Rails 3.1 or something it can be tossed > out. There''s enough for people to upgrade already, one more thing isn''t > necessary. > > -Nick > > > On Wed, Feb 17, 2010 at 5:44 PM, Ryan Bigg <radarlistener@gmail.com>wrote: > >> I say submit the patch. It sounds to me just like something overlooked. >> >> >> On 18 February 2010 02:26, Andy Jeffries <andyjeffries@gmail.com> wrote: >> >>> Having got quite used to Rails.root returning a Pathname object to allow >>> easy concatenation of paths, I noticed that Rails.public_path doesn''t. I >>> checked in 2.3.5 and master and it''s not in either case. >>> >>> It seems easy enough to do: >>> >>> railties/lib/initializer.rb (for 2.3.5): >>> def public_path >>> @@public_path ||= Pathname(self.root ? File.join(self.root, >>> "public") : "public") >>> end >>> >>> railties/lib/rails.rb (for 3.0 beta): >>> def public_path >>> @@public_path ||= Pathname(self.root ? File.join(self.root, >>> "public") : "public") >>> end >>> >>> Am I missing something? Is there a reason for the inconsistency that I''m >>> unaware of? >>> >>> I''m happy to provide a patch if required, but it''s going to be fairly >>> minimal given the change above is Pathname and two parenthesis :-) >>> >>> Cheers, >>> >>> >>> Andy >>> >>> -- >>> Andy Jeffries >>> http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Ruby on Rails: Core" group. >>> To post to this group, send email to rubyonrails-core@googlegroups.com. >>> To unsubscribe from this group, send email to >>> rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-core?hl=en. >>> >> >> >> >> -- >> Ryan Bigg / Radar >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Core" group. >> To post to this group, send email to rubyonrails-core@googlegroups.com. >> To unsubscribe from this group, send email to >> rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-core?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.