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

autoload_once fix when using Pathnames on ruby 1.9 #2673

Closed
wants to merge 1,436 commits into from

Conversation

jdelStrother
Copy link
Contributor

Heya,
I ran into a fun issue on ruby 1.9 where my autoload_once stuff was geting reloaded on each request. Turns out that under 1.9, "/var/log".start_with?(Pathname("/var")) returns false, and I was using :

config.autoload_once_paths += [config.root.join('lib')]

Converting to strings fixed the issue. The attached patch just calls to_s on the autoload_once pathnames in load_once_path?, which is the only problem I've discovered when using Pathnames instead of regular strings.

Any thoughts?

-Jonathan

arunagw and others added 30 commits May 24, 2011 19:33
…thod 'prerequisites' for nil:NilClass (from rspec)
This fixes rake for me in RefineryCMS.
tenderlove and others added 27 commits July 29, 2011 14:47
Fix ArgumentError in ActiveSupport::Cache::CacheStore.read_multi
… time is 00:50 GMT+1. Without the quoting, the YAML parser would parse this as 00:50 UTC, into the local time of 01:50 GMT+1. Then, it would get written into the database in local time as 01:50. When it came back out the UTC date from the database and the UTC date of two weeks ago would be compared. The former would be 23:50, and the latter would be 00:50, so the two dates would differ, causing the assertion to fail. Quoting it prevents the YAML parser from getting involved.
Fix ActiveSupport::Gzip under Ruby 1.8.7. Closes rails#2416
Porting changes on form_tag method signature to 3-0-stable
XSS attacks.  Thanks Sascha Depold for the report.
* 3-0-10:
  bumping rails to 3.0.10
  properly subsituting bad utf8 characters
  Tags with invalid names should also be stripped in order to prevent XSS attacks.  Thanks Sascha Depold for the report.
  prevent sql injection attacks by escaping quotes in column names
  Properly escape glob characters.
  bumping to 3.0.10.rc1
  more changelog updates
  updating CHANGELOGs
Use mysql_creation_options inside rescue block
Prototype rails.js fixes for 3-0-stable
Under ruby 1.9.2 - 
  "/var/log".starts_with?(Pathname.new("/var"))  # => false

so setting config.autoload_once_paths with Pathnames would not work
@vijaydev
Copy link
Member

a PR that went bad?

@jdelStrother
Copy link
Contributor Author

Uhh... yeah, no kidding. Let me try reapplying to master & trying again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet