Commit 12fdb928b25e6dd8ecefa5c6bb148c8eb4ee83da
1 parent
34268f13
Exists in
master
and in
29 other branches
noosfero-load: avoid multiple loads of noosfero module
Showing
8 changed files
with
10 additions
and
9 deletions
Show diff stats
config/environment.rb
@@ -120,7 +120,8 @@ Noosfero.default_locale = nil | @@ -120,7 +120,8 @@ Noosfero.default_locale = nil | ||
120 | Tag.hierarchical = true | 120 | Tag.hierarchical = true |
121 | 121 | ||
122 | # several local libraries | 122 | # several local libraries |
123 | -require 'noosfero' | 123 | + |
124 | +require_dependency 'noosfero' | ||
124 | require 'sqlite_extension' | 125 | require 'sqlite_extension' |
125 | 126 | ||
126 | # load a local configuration if present, but not under test environment. | 127 | # load a local configuration if present, but not under test environment. |
config/routes.rb
1 | -require 'noosfero' | 1 | +require_dependency 'noosfero' |
2 | 2 | ||
3 | ActionController::Routing::Routes.draw do |map| | 3 | ActionController::Routing::Routes.draw do |map| |
4 | # The priority is based upon order of creation: first created -> highest priority. | 4 | # The priority is based upon order of creation: first created -> highest priority. |
lib/noosfero/plugin.rb
lib/tasks/doc.rake
@@ -92,7 +92,7 @@ namespace :noosfero do | @@ -92,7 +92,7 @@ namespace :noosfero do | ||
92 | 92 | ||
93 | po4a_conf = 'tmp/po4a.conf' | 93 | po4a_conf = 'tmp/po4a.conf' |
94 | file po4a_conf => english_xhtml do | 94 | file po4a_conf => english_xhtml do |
95 | - require 'noosfero' | 95 | + require_dependency 'noosfero' |
96 | begin | 96 | begin |
97 | File.open(po4a_conf, 'w') do |file| | 97 | File.open(po4a_conf, 'w') do |file| |
98 | file.puts "[po4a_langs] #{(Noosfero.locales.keys - ['en']).join(' ')}" | 98 | file.puts "[po4a_langs] #{(Noosfero.locales.keys - ['en']).join(' ')}" |
@@ -136,7 +136,7 @@ namespace :noosfero do | @@ -136,7 +136,7 @@ namespace :noosfero do | ||
136 | desc "Translates Noosfero online documentation (does not touch PO files)" | 136 | desc "Translates Noosfero online documentation (does not touch PO files)" |
137 | task :translate => [:link_plugins_textiles, :do_translation] | 137 | task :translate => [:link_plugins_textiles, :do_translation] |
138 | task :do_translation => english_xhtml do | 138 | task :do_translation => english_xhtml do |
139 | - require 'noosfero' | 139 | + require_dependency 'noosfero' |
140 | languages = Noosfero.locales.keys - ['en'] | 140 | languages = Noosfero.locales.keys - ['en'] |
141 | languages.each do |lang| | 141 | languages.each do |lang| |
142 | po = "po/#{lang}/noosfero-doc.po" | 142 | po = "po/#{lang}/noosfero-doc.po" |
lib/tasks/gettext.rake
@@ -39,7 +39,7 @@ end | @@ -39,7 +39,7 @@ end | ||
39 | desc "Update pot/po files to match new version." | 39 | desc "Update pot/po files to match new version." |
40 | task :updatepo do | 40 | task :updatepo do |
41 | require 'gettext_rails/tools' | 41 | require 'gettext_rails/tools' |
42 | - require 'noosfero' | 42 | + require_dependency 'noosfero' |
43 | 43 | ||
44 | GetText::RubyParser::ID << '__' | 44 | GetText::RubyParser::ID << '__' |
45 | GetText::RubyParser::PLURAL_ID << 'n__' | 45 | GetText::RubyParser::PLURAL_ID << 'n__' |
lib/tasks/package.rake
lib/tasks/release.rake
lib/tasks/version.rake