This project is archived and is in readonly mode.
[BUG] [PATCH] Allow https URIs to be supplied for rails templates
Reported by Xavier Shay | November 7th, 2010 @ 06:49 AM | in 3.0.5
This fails:
$ rails new testrails -O -T -J -m https://github.com/xaviershay/sandbox/raw/master/rails/template.rb
The template [/private/tmp/https:/github.com/xaviershay/sandbox/raw/master/rails/template.rb] could not be loaded. Error: Could not find "/private/tmp/https:/github.com/xaviershay/sandbox/raw/master/rails/template.rb" in any of your source paths. Your current source paths are:
/Users/xavier/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/generators/rails/app/templates
I have attached a fix with test, just needed to change the regex. I also performed the following test to confirm it worked (after temporarily adding 'i18n' gem to the Gemfile):
bundle exec ruby bin/rails new /tmp/bogus -m https://github.com/xaviershay/sandbox/raw/master/rails/template.rb
Comments and changes to this ticket
-
Ryan Bigg November 7th, 2010 @ 06:58 AM
- Importance changed from to Low
There is no patch on this ticket. Please attach it!
Thanks for trying this mate.
-
Xavier Shay November 7th, 2010 @ 07:35 AM
hmm, can't seem to get lighthouse to take it.
Here it is as a gist:
https://gist.github.com/63d1660cb8c706dee4f7 -
Andrew White November 7th, 2010 @ 09:28 AM
The url in the test points to an actual gist - the expects on :open will prevent the request but it should be an fake url so that it's obviously irrelevant.
-
Xavier Shay November 7th, 2010 @ 10:12 AM
I agree. My patch test is copied from another test in that file. They should both be changed (along with any others). Out of scope for this ticket.
-
Daniel Kehoe November 23rd, 2010 @ 01:15 AM
The priority on this should be "HIGH" and it really should be included in 3.0.4.
It's a tiny fix but without it, any application generator template hosted on GitHub is inaccessible.
GitHub recently changed all URIs from http to https to increase security (subsequent to awareness of the Firesheep exploit). Many projects that offer an application generator template put them on GitHub.
For an example of the consequences of this failure, see the GitHub support ticket:
http://support.github.com/discussions/site/2213-github-https-redire...I've got two apps that use application generator templates on GitHub and I've had requests for help from people who were relying on the templates to get started.
-- Daniel
-
Xavier Shay November 26th, 2010 @ 07:58 PM
To help speed things up, please review the patch by applying it and ensuring it works as advertised, then add a +1 to this ticket.
-
Jan November 27th, 2010 @ 03:48 PM
Uh, oh, seems like your patch made it: https://github.com/rails/rails/commit/667bcac439f2bf0bdd072cf9dc286...
-
Jan November 27th, 2010 @ 03:52 PM
Well, without the "?" from your regexp it now supports https only... :(
-
Santiago Pastorino November 27th, 2010 @ 10:05 PM
- State changed from new to open
- Milestone cleared.
- Assigned user set to Santiago Pastorino
Xavier, can you provide a patch again with the ? and with a test for http.
Thanks. -
Xavier Shay November 27th, 2010 @ 11:42 PM
There is already a test for http, that is currently failing on master.
ruby -Itest test/generators/app_generator_test.rb ~/Code/ex/rails/railties master Loaded suite test/generators/app_generator_test Started ............................E.......... Finished in 1.668626 seconds. 1) Error: test_template_is_executed_when_supplied(AppGeneratorTest): Rails::Generators::Error: The template [/Users/xavier/Code/ex/rails/railties/http:/gist.github.com/103208.txt] could not be loaded. Error: Could not find "/Users/xavier/Code/ex/rails/railties/http:/gist.github.com/103208.txt" in any of your source paths. Your current source paths are:
As such, only the code needs to change. Here is a new fix, I have confirmed it fixes the test:
https://gist.github.com/raw/718394/de680f23fdc4004bca34fc6a89ee54a8... -
Repository November 28th, 2010 @ 12:06 AM
- State changed from open to committed
(from [76053fe4d12bd2be38e16b3322f9de73e09b43bc]) Allow http templates again, fix the broken test
[#5926 state:committed]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
https://github.com/rails/rails/commit/76053fe4d12bd2be38e16b3322f9d... -
James OKelly November 29th, 2010 @ 03:19 AM
I just updated to rails 3.0.3 to get around this issue and whenever I try a
rails new temp -m https://github.com/dreamr/Rails3-Greenfield-Template/raw/master/mai...
I get "Could not find "/Users/james/development/https:/github.com/dreamr/Rails3-Greenfield-Template/raw/master/main.rb" in any of your source paths"
So the request is not going through the web. I am updating the tests locally for rails and seeing whats up.
OS X SL Ruby 1.8.7-head
-
James OKelly November 29th, 2010 @ 03:21 AM
Also when I installed 3.0.3 it said at the end:
File not found: lib
just an fyi, ill get to that after I get these tests up and running to look into the http/https issue.
-
Xavier Shay November 29th, 2010 @ 03:29 AM
This fix has not been released yet, it is scheduled for 3.0.4
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Referenced by
- 5928 generator template should work over https connection Duplicate of #5926
- 4571 application template does not understand https urls. There is also an issue in rails itself preventing https t...
- 5926 [BUG] [PATCH] Allow https URIs to be supplied for rails templates [#5926 state:committed]