noosfero | 2 new commits pushed to repository

Antonio Terceiro gitlab at gitlab.com
Wed Jan 28 10:52:09 BRST 2015


Antonio Terceiro pushed to refs/heads/master at <a href="https://gitlab.com/noosfero/noosfero">Noosfero / noosfero</a>

Commits:
<a href="https://gitlab.com/noosfero/noosfero/commit/e3b70593b9f73971ec24d4d89877ab070e62bcf5">e3b70593</a> by Antonio Terceiro
noosfero_urls: move to config/initializers/

- - - - -
<a href="https://gitlab.com/noosfero/noosfero/commit/cd62616e98be44029abca46164f42dd4bd48353f">cd62616e</a> by Antonio Terceiro
noosfero_urls: skip standard HTTP/HTTPS ports

- - - - -


Changes:

=====================================
config/initializers/noosfero_urls.rb
=====================================
--- /dev/null
+++ b/config/initializers/noosfero_urls.rb
@@ -0,0 +1,13 @@
+if Rails.env == 'development'
+  ActionController::Base.send(:prepend_before_filter) do |controller|
+    # XXX note that this is not thread-safe! Accessing a Noosfero instance in
+    # development mode under different ports concurrently _will_ lead to weird
+    # things happening.
+    if [80,443].include?(controller.request.port)
+      url_options = {}
+    else
+      url_options = { :port => controller.request.port }
+    end
+    Noosfero.instance_variable_set('@development_url_options', url_options)
+  end
+end

=====================================
vendor/plugins/noosfero_urls/init.rb
=====================================
--- a/vendor/plugins/noosfero_urls/init.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-if Rails.env == 'development'
-  ActionController::Base.send(:prepend_before_filter) do |controller|
-    Noosfero.instance_variable_set('@development_url_options', { :port => controller.request.port })
-  end
-end

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150128/75b83fcf/attachment.html>


More information about the Noosfero-dev mailing list