[23990] users/jberry/mpwa

source_changes at macosforge.org source_changes at macosforge.org
Sat Apr 14 06:21:50 PDT 2007


Revision: 23990
          http://trac.macosforge.org/projects/macports/changeset/23990
Author:   jberry at macports.org
Date:     2007-04-14 06:21:50 -0700 (Sat, 14 Apr 2007)

Log Message:
-----------
Hook up emission of portpkgs through /portpkg/id url

Modified Paths:
--------------
    users/jberry/mpwa/app/controllers/port_pkg_file_controller.rb
    users/jberry/mpwa/config/routes.rb

Modified: users/jberry/mpwa/app/controllers/port_pkg_file_controller.rb
===================================================================
--- users/jberry/mpwa/app/controllers/port_pkg_file_controller.rb	2007-04-14 13:11:24 UTC (rev 23989)
+++ users/jberry/mpwa/app/controllers/port_pkg_file_controller.rb	2007-04-14 13:21:50 UTC (rev 23990)
@@ -48,4 +48,9 @@
     PortPkgFile.find(params[:id]).destroy
     redirect_to :action => 'list'
   end
+  
+  def emit
+    file = PortPkgFile.find(params[:id])
+    send_data file.file_blob.data, :filename => file.file_path, :type => file.mime_type, :disposition => 'inline'
+  end
 end

Modified: users/jberry/mpwa/config/routes.rb
===================================================================
--- users/jberry/mpwa/config/routes.rb	2007-04-14 13:11:24 UTC (rev 23989)
+++ users/jberry/mpwa/config/routes.rb	2007-04-14 13:21:50 UTC (rev 23990)
@@ -13,6 +13,13 @@
   # -- just remember to delete public/index.html.
   # map.connect '', :controller => "welcome"
 
+  # Pretty url for portpkg by pkgid
+  map.portpkg 'portpkg/:id', :controller => 'port_pkg_file', :action => 'emit', :id => /\d+/
+  
+  # Pretty url for portpkg by named selector (unimplemented)
+  map.connect 'portpkg/:selector/:portname', :controller => 'port_pkg', :action => 'byselector'
+
+
   # Allow downloading Web Service WSDL as a file with an extension
   # instead of a file named 'wsdl'
   map.connect ':controller/service.wsdl', :action => 'wsdl'

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070414/4effcbdb/attachment.html


More information about the macports-changes mailing list