Commit 8ca818fa0526eda3bb704fc73b4cbc12a51fe08f
1 parent
922b8c6f
Exists in
master
and in
20 other branches
rails4: upgrade dependencies to rails4
vendor/plugins load was removed from rails4. Now we required theses plugins inside the Gemfile, automatically. init.rb files are loaded in config/initializers/dependencies.rb
Showing
4 changed files
with
38 additions
and
14 deletions
Show diff stats
Gemfile
1 | source "https://rubygems.org" | 1 | source "https://rubygems.org" |
2 | -gem 'rails', '~> 3.2.22' | 2 | +gem 'rails', '~> 4.0' |
3 | gem 'minitest', '~> 3.2.0' | 3 | gem 'minitest', '~> 3.2.0' |
4 | gem 'fast_gettext', '~> 0.6.8' | 4 | gem 'fast_gettext', '~> 0.6.8' |
5 | gem 'acts-as-taggable-on', '~> 3.4.2' | 5 | gem 'acts-as-taggable-on', '~> 3.4.2' |
@@ -24,6 +24,17 @@ gem 'eita-jrails', '~> 0.9.5', require: 'jrails' | @@ -24,6 +24,17 @@ gem 'eita-jrails', '~> 0.9.5', require: 'jrails' | ||
24 | gem 'uglifier', '>= 1.0.3' | 24 | gem 'uglifier', '>= 1.0.3' |
25 | gem 'sass-rails' | 25 | gem 'sass-rails' |
26 | 26 | ||
27 | +# gems to enable rails3 behaviour | ||
28 | +gem 'protected_attributes' | ||
29 | +gem 'rails-observers' | ||
30 | +gem 'actionpack-page_caching' | ||
31 | +gem 'actionpack-action_caching' | ||
32 | +gem 'activerecord-session_store' | ||
33 | + | ||
34 | + | ||
35 | +# FIXME list here all actual dependencies (i.e. the ones in debian/control), | ||
36 | +# with their GEM names (not the Debian package names) | ||
37 | + | ||
27 | group :production do | 38 | group :production do |
28 | gem 'dalli', '~> 2.7.0' | 39 | gem 'dalli', '~> 2.7.0' |
29 | end | 40 | end |
@@ -46,6 +57,14 @@ end | @@ -46,6 +57,14 @@ end | ||
46 | # Requires custom dependencies | 57 | # Requires custom dependencies |
47 | eval(File.read('config/Gemfile'), binding) rescue nil | 58 | eval(File.read('config/Gemfile'), binding) rescue nil |
48 | 59 | ||
60 | +vendor = Dir.glob('vendor/{,plugins/}*') - ['vendor/plugins'] | ||
61 | +vendor.each do |dir| | ||
62 | + plugin = File.basename dir | ||
63 | + version = if Dir.glob("#{dir}/*.gemspec").length > 0 then '> 0.0.0' else '0.0.0' end | ||
64 | + | ||
65 | + gem plugin, version, path: dir | ||
66 | +end | ||
67 | + | ||
49 | # include gemfiles from enabled plugins | 68 | # include gemfiles from enabled plugins |
50 | # plugins in baseplugins/ are not included on purpose. They should not have any | 69 | # plugins in baseplugins/ are not included on purpose. They should not have any |
51 | # dependencies. | 70 | # dependencies. |
config/initializers/action_tracker.rb
1 | require 'noosfero/i18n' | 1 | require 'noosfero/i18n' |
2 | +require 'action_tracker_config' | ||
2 | 3 | ||
3 | # ActionTracker plugin stuff | 4 | # ActionTracker plugin stuff |
4 | 5 | ||
@@ -6,25 +7,25 @@ require 'noosfero/i18n' | @@ -6,25 +7,25 @@ require 'noosfero/i18n' | ||
6 | 7 | ||
7 | ActionTrackerConfig.verbs = { | 8 | ActionTrackerConfig.verbs = { |
8 | 9 | ||
9 | - :create_article => { | 10 | + :create_article => { |
10 | :description => proc { _('published an article: %{title}') % { :title => '{{link_to(truncate(ta.get_name), ta.get_url)}}' } } | 11 | :description => proc { _('published an article: %{title}') % { :title => '{{link_to(truncate(ta.get_name), ta.get_url)}}' } } |
11 | }, | 12 | }, |
12 | 13 | ||
13 | - :new_friendship => { | 14 | + :new_friendship => { |
14 | :description => proc { n_('has made 1 new friend:<br />%{name}', 'has made %{num} new friends:<br />%{name}', get_friend_name.size) % { :num => get_friend_name.size, :name => '{{ta.collect_group_with_index(:friend_name){ |n,i| link_to(image_tag(ta.get_friend_profile_custom_icon[i] || default_or_themed_icon("/images/icons-app/person-icon.png")), ta.get_friend_url[i], :title => n)}.join}}' } }, | 15 | :description => proc { n_('has made 1 new friend:<br />%{name}', 'has made %{num} new friends:<br />%{name}', get_friend_name.size) % { :num => get_friend_name.size, :name => '{{ta.collect_group_with_index(:friend_name){ |n,i| link_to(image_tag(ta.get_friend_profile_custom_icon[i] || default_or_themed_icon("/images/icons-app/person-icon.png")), ta.get_friend_url[i], :title => n)}.join}}' } }, |
15 | :type => :groupable | 16 | :type => :groupable |
16 | }, | 17 | }, |
17 | 18 | ||
18 | - :join_community => { | 19 | + :join_community => { |
19 | :description => proc { n_('has joined 1 community:<br />%{name}', 'has joined %{num} communities:<br />%{name}', get_resource_name.size) % { :num => get_resource_name.size, :name => '{{ta.collect_group_with_index(:resource_name){ |n,i| link_to(image_tag(ta.get_resource_profile_custom_icon[i] || default_or_themed_icon("/images/icons-app/community-icon.png")), ta.get_resource_url[i], :title => n)}.join}}' } }, | 20 | :description => proc { n_('has joined 1 community:<br />%{name}', 'has joined %{num} communities:<br />%{name}', get_resource_name.size) % { :num => get_resource_name.size, :name => '{{ta.collect_group_with_index(:resource_name){ |n,i| link_to(image_tag(ta.get_resource_profile_custom_icon[i] || default_or_themed_icon("/images/icons-app/community-icon.png")), ta.get_resource_url[i], :title => n)}.join}}' } }, |
20 | :type => :groupable | 21 | :type => :groupable |
21 | }, | 22 | }, |
22 | 23 | ||
23 | - :add_member_in_community => { | 24 | + :add_member_in_community => { |
24 | :description => proc { _('has joined the community.') }, | 25 | :description => proc { _('has joined the community.') }, |
25 | }, | 26 | }, |
26 | 27 | ||
27 | - :upload_image => { | 28 | + :upload_image => { |
28 | :description => proc do | 29 | :description => proc do |
29 | total = get_view_url.size | 30 | total = get_view_url.size |
30 | n_('uploaded 1 image', 'uploaded %d images', total) % total + | 31 | n_('uploaded 1 image', 'uploaded %d images', total) % total + |
config/initializers/dependencies.rb
1 | +# third-party libraries | ||
2 | +require 'will_paginate' | ||
3 | +require 'will_paginate/array' | ||
4 | +require 'nokogiri' | ||
5 | + | ||
6 | +# dependencies at vendor, firstly loaded on Gemfile | ||
7 | +vendor = (Dir.glob('vendor/{,plugins/}*') - ['vendor/plugins']) | ||
8 | +vendor.each do |dir| | ||
9 | + init_rb = "#{Rails.root}/#{dir}/init.rb" | ||
10 | + require init_rb if File.file? init_rb | ||
11 | +end | ||
12 | + | ||
1 | # locally-developed modules | 13 | # locally-developed modules |
2 | require 'acts_as_filesystem' | 14 | require 'acts_as_filesystem' |
3 | require 'acts_as_having_settings' | 15 | require 'acts_as_having_settings' |
@@ -10,8 +22,3 @@ require 'set_profile_region_from_city_state' | @@ -10,8 +22,3 @@ require 'set_profile_region_from_city_state' | ||
10 | require 'authenticated_system' | 22 | require 'authenticated_system' |
11 | require 'needs_profile' | 23 | require 'needs_profile' |
12 | require 'white_list_filter' | 24 | require 'white_list_filter' |
13 | - | ||
14 | -# third-party libraries | ||
15 | -require 'will_paginate' | ||
16 | -require 'will_paginate/array' | ||
17 | -require 'nokogiri' |
vendor/plugins/ruby_bosh/ruby_bosh.gemspec
@@ -24,15 +24,12 @@ Gem::Specification.new do |s| | @@ -24,15 +24,12 @@ Gem::Specification.new do |s| | ||
24 | if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then | 24 | if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then |
25 | s.add_runtime_dependency(%q<builder>, [">= 0"]) | 25 | s.add_runtime_dependency(%q<builder>, [">= 0"]) |
26 | s.add_runtime_dependency(%q<adamwiggins-rest-client>, [">= 0"]) | 26 | s.add_runtime_dependency(%q<adamwiggins-rest-client>, [">= 0"]) |
27 | - s.add_runtime_dependency(%q<SystemTimer>, [">= 0"]) | ||
28 | else | 27 | else |
29 | s.add_dependency(%q<builder>, [">= 0"]) | 28 | s.add_dependency(%q<builder>, [">= 0"]) |
30 | s.add_dependency(%q<adamwiggins-rest-client>, [">= 0"]) | 29 | s.add_dependency(%q<adamwiggins-rest-client>, [">= 0"]) |
31 | - s.add_dependency(%q<SystemTimer>, [">= 0"]) | ||
32 | end | 30 | end |
33 | else | 31 | else |
34 | s.add_dependency(%q<builder>, [">= 0"]) | 32 | s.add_dependency(%q<builder>, [">= 0"]) |
35 | s.add_dependency(%q<adamwiggins-rest-client>, [">= 0"]) | 33 | s.add_dependency(%q<adamwiggins-rest-client>, [">= 0"]) |
36 | - s.add_dependency(%q<SystemTimer>, [">= 0"]) | ||
37 | end | 34 | end |
38 | end | 35 | end |