search for: expand_path

Displaying 20 results from an estimated 153 matches for "expand_path".

2007 Dec 28
6
Arbitrary system files readable in 1.0.4 - 1.1.2
...to URIs like /.%252e/.%252e/.%252e/.%252e/.%252e/.%252e/.%252e/etc/passwd and it would serve the actual /etc/passwd file. The issue seems to be in lib/mongrel/handlers.rb in the change from 1.0.3 to 1.0.4 req_path = HttpRequest.unescape(path_info) - if @path - req_path = File.expand_path(File.join(@path, path_info), @path) - else - req_path = File.expand_path(req_path) - end - - if req_path.index(@path) == 0 and File.exist? req_path - # it exists and it''s in the right location + # Add the drive letter or root path + req_path = File.jo...
2006 Aug 10
4
1.1.5 Upgrade and config.load_path not working
Hey, I am trying to upgrade to 1.1.5 and rails no longer finds my controllers the live outside app/controllers. I was on 1.1.2 previously and here is my setup In environment.rb config.load_paths += [File.join(File.expand_path(RAILS_ROOT), "rails_shared/controllers") ] config.load_paths += [File.join(File.expand_path(RAILS_ROOT), "rails_shared/helpers") ] config.load_paths += [File.join(File.expand_path(RAILS_ROOT), "rails_shared/lib") ] And within rails_shared/controllers I have a l...
2006 Aug 10
5
Major security vulnerability in the latest Rails 1.1.5
...=============== --- actionpack/lib/action_controller/routing.rb (revision 4745) +++ actionpack/lib/action_controller/routing.rb (working copy) @@ -270,10 +270,11 @@ protected def safe_load_paths #:nodoc: if defined?(RAILS_ROOT) + extended_root = Regexp.escape(File.expand_path(RAILS_ROOT)) $LOAD_PATH.select do |base| base = File.expand_path(base) extended_root = File.expand_path(RAILS_ROOT) - base.match(/\A#{Regexp.escape(extended_root)}\/*#{file_kinds(:lib) * ''|''}/) || base =~ %r{rails-[\d.]+/builtin...
2006 Oct 28
4
Mounting an app as ''/'' under Apache?
Hello everyone, I have a site with a collection of camping apps. I''m trying to force one of them, blog.rb, to run as the index (''/''). I think that I understand the RDoc as stating that I can execute the following to make that happen: Camping::FastCGI.serve File.expand_path(current), Blog But, when doing so, I recieve the following error: Camping Problem!*/*/NoMethodError undefined method `has_key?'' for nil:NilClass - /home/styledbits/local/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/fastcgi.rb:176:in `serve'' - /home/styledbits/local/l...
2012 Jul 16
1
After moving from Ruby 1.8.7 to 1.9.3 - test/unit/error (LoadError)
...rname(__FILE__) # $: << File.dirname(__FILE__) + ''..'' # $: << File.dirname(__FILE__) + ''../..'' # $: << File.join(File.dirname(__FILE__),''..'') # require File.dirname(__FILE__) + ''/../config/boot'' # require File.expand_path(''../../config/boot'', __FILE__) # require File.expand_path(__FILE__)+''/../../config/boot'' APP_PATH = File.expand_path(''../../config/application'', __FILE__) require File.expand_path(''../../config/boot'', __FILE__) # require ...
2009 May 14
6
Generated test files and bad require 'test_helper'
Why do the generated test files have: require ''test_helper'' It cannot obviously find the file because it''s located in a subdirectory. That''s annoying. -- Posted via http://www.ruby-forum.com/.
2006 Aug 07
9
problems with ActionMailer
Hi all, I''m trying to create a worker to send a mail to all the users in my db. Right now I''m doing the tests, this is the code in my worker (Masivo is the ActionMailer subclass): def do_work(args) @progress = 0 @logger.info("MAILER: starting job") records = Record.find(:all) total = records.size records.each_with_index do |record, idx|
2008 May 19
4
2 Minor issues with 1.3.0 on windows
...t possibly relevant to some: at line 8 my system would not require the '':'' as it is already part of SYSTEMDRIVE). Second, since our USERPROFILE starts C:\Documents and Settings\... the we need additional quoting in CommandLine#execute around the :stdout and :stderr options. File.expand_path returns a string with embedded spaces which would be choked on later. We just wrapped those options on lines 67 and 68 with quotation marks. With those two changes, CC.rb is working great for us. Thanks for your efforts, and I hope these little notes will help other windows users. -- Joe Swatos...
2006 Dec 30
2
Another RSpec on Rails issue: how to test send_file()
Hi! Today I needed to implement some controller code, that uses send_file() to send image data. How can this be tested / specified with RSpec? bye, Tobias
2008 Jan 04
1
patch for html display
...rb (working copy) @@ -6,8 +6,9 @@ # Formats backtraces so they''re clickable by TextMate class TextMateFormatter < HtmlFormatter def backtrace_line(line) - line.gsub(/([^:]*\.rb):(\d*)/) do - "<a href=\"txmt://open?url=file://#{File.expand_path($1)}&line=#{$2}\">#{$1}:#{$2}</a> " + line.gsub!(/^(On line #([0-9]+) of )(.+)$/) { "app/views/#{$3}:#{$2}"} + line.gsub(/([^:]*\.(rb|rhtml|erb)):(\d*)/) do + "<a href=\"txmt://open?url=file://#{File.expand_path($1)}&lin...
2011 May 10
7
Webrick script/server file does not exist
...create vendor/plugins/.gitkeep But as you can see script directory contains only one file rails Here is its content: #!/usr/bin/env ruby.exe # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. APP_PATH = File.expand_path(''../../config/application'', __FILE__) require File.expand_path(''../../config/boot'', __FILE__) require ''rails/commands'' So the command C:\Sites\helloworld\ruby script/server to start WebRick does not work because script/server file...
2008 Oct 06
10
Uninitialized constant Spec:Story
Hi, I''m fairly new to Rails and v. new to RSpec. Think it looks pretty useful and so I''m trying it out for the first time. I have installed the rspec-rails gem and created a simple plain text my_story file and my_story.rb file along the lines described here - http://www.tomtenthij.co.uk/2008/1/25/rspec-plain-text-story-runner-on-a-fresh-rails-app. When I run
2007 Feb 08
1
mongrel cluster and local gems loading problem
Hello, I''m trying to augment the GEM_PATH to load gems from ~/.gem/ using this at the begging of the rails application config/environment.rb file: ENV[''GEM_PATH''] = File.expand_path(''~/.gem'') This works fine from within script/console: $ script/console >> require ''pdf/writer'' => true But when I try to run: mongrel_rails cluster::start It fails to load the local gem. I started to dig into the code, and realized that rubygem...
2011 May 19
1
Module in Rails
Hi, I want to use module in Rails 3 I have module in /lib directory. file name: my_module.rb Code of Module: module MyModule def self.my_method loop do puts "I am started!!!" sleep 2 end end end Now, I want to use this module in my rb file resides in app_root/daemon directory named myserver.rb How can i use that? -- You received this message
2006 Jan 16
2
Basic (newbie) Webrick / ssl config question
I have a simple Intranet app I want to make accessible via the Internet for remote access by our employees. I want to use ssl (https) connections and I''ve found enough messages to imply Webrick as included in rails can do the job. The message at http://wrath.rubyonrails.org/pipermail/rails/2005-January/001993.html even appears to tell me exactly how to do it by modifying
2008 Mar 17
8
should have_tag outside Rails
Hi Google has not helped me here. I''m looking for a way to use the have_tag assert_select wrapper outside RSpec on Rails (but in a Rails project) so I can use it to check text strings. Has anyone managed this? Thanks Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL:
2003 Dec 10
1
cvs version 1.11.10 import? [security fix]
On a recent NetBSD commit I saw that they have imported cvs 1.11.10 as a security fix yesterday: http://mail-index.netbsd.org/source-changes/2003/12/10/0025.html http://mail-index.netbsd.org/source-changes/2003/12/10/0026.html itojun has clairfied the commit in a mail sent to tech-userlevel list of NetBSD: http://mail-index.netbsd.org/tech-userlevel/2003/12/10/0003.html Will this affect
2011 Feb 04
6
A plugin inside an engine
In Rails 3, is it possible to have a plugin inside an engine? Adding the lib dir of the plugin to autoload_paths doesn''t seem to work. I can manage to load it by adding that path to $: and requiring the init.rb file, but I''m not sure that''s the correct approach. Thanks! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2007 Feb 11
4
Let's make RAILS_ROOT an absolute path on Windows
As this Caboose article [] suggests, I am not the only one who had this problem. RAILS_ROOT is a relative path on Windows, and it can bite you in unexpected ways. I had that problem while working on CruiseControl.rb. There is a trivial patch fixing it (by simply applying File.expand_path to the path before assigning it into the RAILS_ROOT constant): http://dev.rubyonrails.org/ticket/7259 Best regards, Alex Verkhovsky --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" grou...
2006 May 05
11
Listing Actions
OK, call me crazy, but am I the first one to want to list out the actions that are available @ runtime? Anyone else come across this yet? Am I crazy? Well, yes, but... -- Posted via http://www.ruby-forum.com/.