public this repo is viewable by everyone
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
rake rails:freeze:edge using 
http://dev.rubyonrails.org/archives/rails_edge.zip instead of Subversion
jeremy (author)
about 1 month ago
commit  4b17082107aced980fc4b511028ee763247bc5ab
tree    39b070c260bef4e88b0bd42e1c2710ff40fa4ed9
parent  ed99dda174da439a0947cdabea3babf027c672ac
...
38
39
40
41
 
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
 
 
 
 
 
 
 
 
 
 
64
65
66
 
 
 
 
 
 
67
68
69
70
71
72
73
74
 
 
75
76
77
...
38
39
40
 
41
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
44
45
46
47
48
49
50
51
52
53
54
 
55
56
57
58
59
60
61
62
 
 
 
 
 
 
63
64
65
66
67
0
@@ -38,40 +38,30 @@ namespace :rails do
0
       end
0
     end
0
 
0
- desc "Lock to latest Edge Rails or a specific revision with REVISION=X (ex: REVISION=4021) or a tag with TAG=Y (ex: TAG=rel_1-1-0)"
0
+ desc 'Lock to latest Edge Rails'
0
     task :edge do
0
- $verbose = false
0
- `svn --version` rescue nil
0
- unless !$?.nil? && $?.success?
0
- $stderr.puts "ERROR: Must have subversion (svn) available in the PATH to lock this application to Edge Rails"
0
- exit 1
0
- end
0
-
0
- rm_rf "vendor/rails"
0
- mkdir_p "vendor/rails"
0
-
0
- svn_root = "http://dev.rubyonrails.org/svn/rails/"
0
-
0
- if ENV['TAG']
0
- rails_svn = "#{svn_root}/tags/#{ENV['TAG']}"
0
- touch "vendor/rails/TAG_#{ENV['TAG']}"
0
- else
0
- rails_svn = "#{svn_root}/trunk"
0
-
0
- if ENV['REVISION'].nil?
0
- ENV['REVISION'] = /^r(\d+)/.match(%x{svn -qr HEAD log #{svn_root}})[1]
0
- puts "REVISION not set. Using HEAD, which is revision #{ENV['REVISION']}."
0
+ require 'open-uri'
0
+
0
+ chdir 'vendor' do
0
+ puts 'Downloading Rails'
0
+ File.open('rails_edge.zip', 'wb') do |dst|
0
+ open 'http://dev.rubyonrails.org/archives/rails_edge.zip' do |src|
0
+ while chunk = src.read(4096)
0
+ dst << chunk
0
+ end
0
+ end
0
         end
0
 
0
- touch "vendor/rails/REVISION_#{ENV['REVISION']}"
0
+ puts 'Unpacking Rails'
0
+ rm_rf 'rails'
1
+ `unzip rails_edge.zip`
0
+ %w(rails_edge.zip rails/Rakefile rails/cleanlogs.sh rails/pushgems.rb rails/release.rb).each do |goner|
0
+ rm_f goner
0
+ end
0
       end
0
 
0
- for framework in %w(railties actionpack activerecord actionmailer activesupport activeresource)
0
- system "svn export #{rails_svn}/#{framework} vendor/rails/#{framework}" + (ENV['REVISION'] ? " -r #{ENV['REVISION']}" : "")
0
- end
0
-
0
- puts "Updating current scripts, javascripts, and configuration settings"
0
- Rake::Task["rails:update"].invoke
0
+ puts 'Updating current scripts, javascripts, and configuration settings'
0
+ Rake::Task['rails:update'].invoke
0
     end
0
   end
0
 

Comments

  • Does "unzip" exist on Windows?

  • leethal about 1 month ago

    Nope, not on Windows XP Professional SP2 at least.

  • technoweenie about 1 month ago

    Suggestions: Perhaps zip/zipfilesystem and fallback to the `unzip` command if it’s not available (with a helpful message asking you to install rubyzip if unzip is unavailable).

  • imajes about 1 month ago

    that’s still yet another dependency. on OS X, you could just call open on it too.

  • jeremymcanally about 1 month ago

    Er why not use tar’s and vendor minitar?

  • atnan about 1 month ago

    There’s also the option of using Github’s tarball export:
    http://github.com/tarballs/rails-rails-master.tar.gz

  • mk about 1 month ago

    will this changeset still be pushed into svn? Then we could just do rake rails:freeze:edge twice and be on the latest revision.
    The zip doesnt seem to be working, yet. It’s got 0k here.

  • yaroslav about 1 month ago

    It can dl a file and unpack on POSIX systems and just dl and puts a warning like "unzip it into …" on Windows.

  • leethal about 1 month ago

    Most users has winrar installed, which afaik has some command line interface. A bit weird to rely on winrar, though.

  • foca about 1 month ago

    I don’t have windows atm, but if you install the gui version of winrar I’m almost sure you don’t get the cli version. And in any case you’d require that *nix users have the `unrar` command operating on their command line.
    I’d say it’s preferable to add another dependency but ensure cross-compatibility if it "just works" for everybody.

  • leethal about 1 month ago

    Windows XP has unzip functionality, but apparently it’s impossible to call it from the command line. There is the "compact" command, but that only works on .cab archives. "rundll32 zipfldr.dll,RouteTheCall rails_edge.zip" will only open the zip in explorer. Oh the beauty of Windows’ API.

  • elliottcable about 1 month ago

    I’m down for using another dependency in the vendor folder, and making it work for everybody.

  • leethal about 1 month ago

    Then again, it was required to have subversion before. So, asking people to install some freeware command line unzipper doesn’t seem too much to ask. After all, you can achieve the same thing by simply downloading the zip and unpacking it to vendor/rails manually, this is just a shortcut.

  • queso about 1 month ago

    Why not just require rubyzip to be installed? Seems like then you can just make the call to it and not worry about which os it is. You could even provide fall thru support for OS’es that do support zip from the command line. leethal is right, svn was a dependency before, why not make rubyzip a dependency now?

  • geoffgarside about 1 month ago

    heck rake’s a dependency, so I don’t really see anything wrong with making rubyzip or some other unarchiver another dependency

  • leethal about 1 month ago

    Yeah, I think the fact that this being a shortcut for downloading it manually means that one can live with some dependencies.
    Oh hai, core team, any say on this?

  • tobi about 1 month ago

    We are looking at using ruby’s build in zlib to extract the files.

  • tobi about 1 month ago

    However, we are all on unix systems so there is not that big of an itch. Any windows users want to raise up to the task?

  • technoweenie about 1 month ago

    leethal: see comment # 3

  • yaroslav about 1 month ago

    totally agree with technoweenie

  • leethal about 1 month ago

    http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2-rake-rails-freeze-edge-on-windows
    Awful code, apply sexyness please.

  • leethal 29 days ago

    ping