diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | LICENSE.txt | 2 | ||||
-rw-r--r-- | Rakefile | 1 | ||||
-rw-r--r-- | config/deploy.rb | 2 | ||||
-rw-r--r-- | config/environment.rb | 2 | ||||
-rw-r--r-- | config/initializers/acts_as_xapian.rb | 25 | ||||
-rw-r--r-- | config/initializers/has_tag_string.rb | 2 | ||||
-rw-r--r-- | config/initializers/strip_attributes.rb | 2 | ||||
-rw-r--r-- | config/initializers/theme_loader.rb | 4 | ||||
-rw-r--r-- | doc/TRANSLATE.md | 2 | ||||
-rw-r--r-- | lib/acts_as_xapian/.gitignore (renamed from vendor/plugins/acts_as_xapian/.gitignore) | 0 | ||||
-rw-r--r-- | lib/acts_as_xapian/LICENSE.txt (renamed from vendor/plugins/acts_as_xapian/LICENSE.txt) | 0 | ||||
-rw-r--r-- | lib/acts_as_xapian/README.txt (renamed from vendor/plugins/acts_as_xapian/README.txt) | 0 | ||||
-rw-r--r-- | lib/acts_as_xapian/acts_as_xapian.rb (renamed from vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb) | 2 | ||||
-rw-r--r-- | lib/acts_as_xapian/tasks/xapian.rake (renamed from vendor/plugins/acts_as_xapian/lib/tasks/xapian.rake) | 0 | ||||
-rw-r--r-- | lib/generators/acts_as_xapian/USAGE (renamed from vendor/plugins/acts_as_xapian/generators/acts_as_xapian/USAGE) | 0 | ||||
-rw-r--r-- | lib/generators/acts_as_xapian/acts_as_xapian_generator.rb | 10 | ||||
-rw-r--r-- | lib/generators/acts_as_xapian/templates/migration.rb (renamed from vendor/plugins/acts_as_xapian/generators/acts_as_xapian/templates/migration.rb) | 0 | ||||
-rw-r--r-- | lib/has_tag_string/README.txt (renamed from vendor/plugins/has_tag_string/README.txt) | 0 | ||||
-rw-r--r-- | lib/has_tag_string/has_tag_string.rb (renamed from vendor/plugins/has_tag_string/lib/has_tag_string.rb) | 0 | ||||
-rw-r--r-- | lib/strip_attributes/README.rdoc (renamed from vendor/plugins/strip_attributes/README.rdoc) | 0 | ||||
-rw-r--r-- | lib/strip_attributes/Rakefile (renamed from vendor/plugins/strip_attributes/Rakefile) | 0 | ||||
-rw-r--r-- | lib/strip_attributes/strip_attributes.rb (renamed from vendor/plugins/strip_attributes/lib/strip_attributes.rb) | 0 | ||||
-rw-r--r-- | lib/strip_attributes/test/strip_attributes_test.rb (renamed from vendor/plugins/strip_attributes/test/strip_attributes_test.rb) | 0 | ||||
-rw-r--r-- | lib/strip_attributes/test/test_helper.rb (renamed from vendor/plugins/strip_attributes/test/test_helper.rb) | 0 | ||||
-rw-r--r-- | lib/tasks/gettext.rake | 4 | ||||
-rw-r--r-- | lib/tasks/themes.rake | 2 | ||||
-rwxr-xr-x | script/compact-xapian-database | 2 | ||||
-rwxr-xr-x | script/switch-theme.rb | 2 | ||||
-rw-r--r-- | spec/models/xapian_spec.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 4 | ||||
-rw-r--r-- | vendor/plugins/acts_as_xapian/.cvsignore | 2 | ||||
-rw-r--r-- | vendor/plugins/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb | 13 | ||||
-rw-r--r-- | vendor/plugins/acts_as_xapian/init.rb | 7 | ||||
-rw-r--r-- | vendor/plugins/has_tag_string/init.rb | 2 | ||||
-rw-r--r-- | vendor/plugins/strip_attributes/.gitignore | 1 | ||||
-rw-r--r-- | vendor/plugins/strip_attributes/init.rb | 2 |
37 files changed, 57 insertions, 42 deletions
diff --git a/.gitignore b/.gitignore index 87c55ce97..9e9a4b9f7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ .autotest *#*# TAGS -/vendor/plugins/*theme +/lib/themes /locale/model_attributes.rb /files/ /public/download diff --git a/LICENSE.txt b/LICENSE.txt index 23976d86e..21e66eedb 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -10,7 +10,7 @@ by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Note in particular, -- acts_as_xapian in vendor/plugins/ is licensed with an MIT license. +- acts_as_xapian in lib/acts_as_xapian is licensed with an MIT license. Can you explain briefly what the GNU Affero GPL is? We offer the source code of our websites to our users. The GNU Affero GPL has the @@ -2,7 +2,6 @@ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) -ActiveSupport::Deprecation.silenced = true require 'rake' Alaveteli::Application.load_tasks if Rails.env == 'test' diff --git a/config/deploy.rb b/config/deploy.rb index 8ab67bc98..a0189c855 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -58,7 +58,7 @@ namespace :deploy do "#{release_path}/public/favicon.ico" => "#{shared_path}/favicon.ico", "#{release_path}/files" => "#{shared_path}/files", "#{release_path}/cache" => "#{shared_path}/cache", - "#{release_path}/vendor/plugins/acts_as_xapian/xapiandbs" => "#{shared_path}/xapiandbs", + "#{release_path}/lib/acts_as_xapian/xapiandbs" => "#{shared_path}/xapiandbs", } # "ln -sf <a> <b>" creates a symbolic link but deletes <b> if it already exists diff --git a/config/environment.rb b/config/environment.rb index 05f25a29e..196680b23 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,7 +1,5 @@ - # Load the rails application require File.expand_path('../application', __FILE__) -ActiveSupport::Deprecation.silenced = true # Initialize the rails application Alaveteli::Application.initialize! diff --git a/config/initializers/acts_as_xapian.rb b/config/initializers/acts_as_xapian.rb new file mode 100644 index 000000000..f82193c85 --- /dev/null +++ b/config/initializers/acts_as_xapian.rb @@ -0,0 +1,25 @@ +# acts_as_xapian/init.rb: +# +# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ + +# We're moving plugins out of vendor/plugins, since keeping them there +# is deprecated as of Rails 3.2, and the xapiandbs directory should be +# moved out of there along with the plugin itself. + +old_xapiandbs_path = Rails.root.join('vendor', + 'plugins', + 'acts_as_xapian', + 'xapiandbs') + +current_xapiandbs_path = Rails.root.join('lib', + 'acts_as_xapian', + 'xapiandbs') + +if File.exists? old_xapiandbs_path + unless File.exists? current_xapiandbs_path + File.rename old_xapiandbs_path, current_xapiandbs_path + end +end + +require 'acts_as_xapian/acts_as_xapian' diff --git a/config/initializers/has_tag_string.rb b/config/initializers/has_tag_string.rb new file mode 100644 index 000000000..5fa33cc70 --- /dev/null +++ b/config/initializers/has_tag_string.rb @@ -0,0 +1,2 @@ +require 'has_tag_string/has_tag_string' + diff --git a/config/initializers/strip_attributes.rb b/config/initializers/strip_attributes.rb new file mode 100644 index 000000000..25f70b2f3 --- /dev/null +++ b/config/initializers/strip_attributes.rb @@ -0,0 +1,2 @@ +require 'strip_attributes/strip_attributes' +ActiveRecord::Base.extend(StripAttributes) diff --git a/config/initializers/theme_loader.rb b/config/initializers/theme_loader.rb index b3ae11e1e..9c79e513c 100644 --- a/config/initializers/theme_loader.rb +++ b/config/initializers/theme_loader.rb @@ -3,7 +3,9 @@ $alaveteli_route_extensions = [] def require_theme(theme_name) - theme_main_include = File.expand_path "../../../vendor/plugins/#{theme_name}/lib/alavetelitheme.rb", __FILE__ + theme_lib = Rails.root.join 'lib', 'themes', theme_name, 'lib' + $LOAD_PATH.unshift theme_lib.to_s + theme_main_include = Rails.root.join theme_lib, "alavetelitheme.rb" if File.exists? theme_main_include require theme_main_include end diff --git a/doc/TRANSLATE.md b/doc/TRANSLATE.md index 2a8b0269e..aef2cfdc9 100644 --- a/doc/TRANSLATE.md +++ b/doc/TRANSLATE.md @@ -79,7 +79,7 @@ must: language, using `bundle exec rake gettext:store_model_attributes`, followed by `bundle exec rake gettext:find` - * careful of including msgids from themes in `vendor/plugin`; + * careful of including msgids from themes in `lib/themes`; you might want to move them out of the way before running the above commands * this updates the PO template, but also merges it with the diff --git a/vendor/plugins/acts_as_xapian/.gitignore b/lib/acts_as_xapian/.gitignore index 60e95666f..60e95666f 100644 --- a/vendor/plugins/acts_as_xapian/.gitignore +++ b/lib/acts_as_xapian/.gitignore diff --git a/vendor/plugins/acts_as_xapian/LICENSE.txt b/lib/acts_as_xapian/LICENSE.txt index 72d93c4be..72d93c4be 100644 --- a/vendor/plugins/acts_as_xapian/LICENSE.txt +++ b/lib/acts_as_xapian/LICENSE.txt diff --git a/vendor/plugins/acts_as_xapian/README.txt b/lib/acts_as_xapian/README.txt index a1d22ef3f..a1d22ef3f 100644 --- a/vendor/plugins/acts_as_xapian/README.txt +++ b/lib/acts_as_xapian/README.txt diff --git a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index 2e486f328..b30bb4d10 100644 --- a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -100,7 +100,7 @@ module ActsAsXapian if config['base_db_path'] db_parent_path = Rails.root.join(config['base_db_path']) else - db_parent_path = File.join(File.dirname(__FILE__), '../xapiandbs/') + db_parent_path = File.join(File.dirname(__FILE__), 'xapiandbs') end # make the directory for the xapian databases to go in diff --git a/vendor/plugins/acts_as_xapian/lib/tasks/xapian.rake b/lib/acts_as_xapian/tasks/xapian.rake index c1986ce1e..c1986ce1e 100644 --- a/vendor/plugins/acts_as_xapian/lib/tasks/xapian.rake +++ b/lib/acts_as_xapian/tasks/xapian.rake diff --git a/vendor/plugins/acts_as_xapian/generators/acts_as_xapian/USAGE b/lib/generators/acts_as_xapian/USAGE index 2d027c46f..2d027c46f 100644 --- a/vendor/plugins/acts_as_xapian/generators/acts_as_xapian/USAGE +++ b/lib/generators/acts_as_xapian/USAGE diff --git a/lib/generators/acts_as_xapian/acts_as_xapian_generator.rb b/lib/generators/acts_as_xapian/acts_as_xapian_generator.rb new file mode 100644 index 000000000..434c02cb5 --- /dev/null +++ b/lib/generators/acts_as_xapian/acts_as_xapian_generator.rb @@ -0,0 +1,10 @@ +require 'rails/generators/active_record/migration' + +class ActsAsXapianGenerator < Rails::Generators::Base + include Rails::Generators::Migration + extend ActiveRecord::Generators::Migration + source_root File.expand_path("../templates", __FILE__) + def create_migration_file + migration_template "migration.rb", "db/migrate/add_acts_as_xapian_jobs.rb" + end +end diff --git a/vendor/plugins/acts_as_xapian/generators/acts_as_xapian/templates/migration.rb b/lib/generators/acts_as_xapian/templates/migration.rb index 84a9dd766..84a9dd766 100644 --- a/vendor/plugins/acts_as_xapian/generators/acts_as_xapian/templates/migration.rb +++ b/lib/generators/acts_as_xapian/templates/migration.rb diff --git a/vendor/plugins/has_tag_string/README.txt b/lib/has_tag_string/README.txt index 0d3a38229..0d3a38229 100644 --- a/vendor/plugins/has_tag_string/README.txt +++ b/lib/has_tag_string/README.txt diff --git a/vendor/plugins/has_tag_string/lib/has_tag_string.rb b/lib/has_tag_string/has_tag_string.rb index 4022faaac..4022faaac 100644 --- a/vendor/plugins/has_tag_string/lib/has_tag_string.rb +++ b/lib/has_tag_string/has_tag_string.rb diff --git a/vendor/plugins/strip_attributes/README.rdoc b/lib/strip_attributes/README.rdoc index bd55c0c1c..bd55c0c1c 100644 --- a/vendor/plugins/strip_attributes/README.rdoc +++ b/lib/strip_attributes/README.rdoc diff --git a/vendor/plugins/strip_attributes/Rakefile b/lib/strip_attributes/Rakefile index 05b0c14ad..05b0c14ad 100644 --- a/vendor/plugins/strip_attributes/Rakefile +++ b/lib/strip_attributes/Rakefile diff --git a/vendor/plugins/strip_attributes/lib/strip_attributes.rb b/lib/strip_attributes/strip_attributes.rb index 130d10185..130d10185 100644 --- a/vendor/plugins/strip_attributes/lib/strip_attributes.rb +++ b/lib/strip_attributes/strip_attributes.rb diff --git a/vendor/plugins/strip_attributes/test/strip_attributes_test.rb b/lib/strip_attributes/test/strip_attributes_test.rb index 8158dc664..8158dc664 100644 --- a/vendor/plugins/strip_attributes/test/strip_attributes_test.rb +++ b/lib/strip_attributes/test/strip_attributes_test.rb diff --git a/vendor/plugins/strip_attributes/test/test_helper.rb b/lib/strip_attributes/test/test_helper.rb index 7d06c40db..7d06c40db 100644 --- a/vendor/plugins/strip_attributes/test/test_helper.rb +++ b/lib/strip_attributes/test/test_helper.rb diff --git a/lib/tasks/gettext.rake b/lib/tasks/gettext.rake index 366dfbe88..3f357213f 100644 --- a/lib/tasks/gettext.rake +++ b/lib/tasks/gettext.rake @@ -29,11 +29,11 @@ namespace :gettext do end def theme_files_to_translate(theme) - Dir.glob("{vendor/plugins/#{theme}/lib}/**/*.{rb,erb}") + Dir.glob("{lib/themes/#{theme}/lib}/**/*.{rb,erb}") end def theme_locale_path(theme) - File.join(Rails.root, "vendor", "plugins", theme, "locale-theme") + Rails.root.join "lib", "themes", theme, "locale-theme" end end diff --git a/lib/tasks/themes.rake b/lib/tasks/themes.rake index 1eed92f1e..78ffe73be 100644 --- a/lib/tasks/themes.rake +++ b/lib/tasks/themes.rake @@ -2,7 +2,7 @@ namespace :themes do def plugin_dir - File.join(Rails.root,"vendor","plugins") + File.join(Rails.root,"lib","themes") end def theme_dir(theme_name) diff --git a/script/compact-xapian-database b/script/compact-xapian-database index f1a6058b0..982c0e878 100755 --- a/script/compact-xapian-database +++ b/script/compact-xapian-database @@ -4,7 +4,7 @@ export RAILS_ENV=$1 set -e if [ -x /usr/bin/xapian-compact ]; then - XAPIAN_DB_DIR=$( cd "$( dirname "$0" )" && pwd )/../vendor/plugins/acts_as_xapian/xapiandbs + XAPIAN_DB_DIR=$( cd "$( dirname "$0" )" && pwd )/../lib/acts_as_xapian/xapiandbs if [ -e "$XAPIAN_DB_DIR/$RAILS_ENV.new" ]; then echo >&2 "Didn't compact Xapian database because there was an existing database at $XAPIAN_DB_DIR/$RAILS_ENV.new" exit 1 diff --git a/script/switch-theme.rb b/script/switch-theme.rb index 03d59a2f9..e6afcebb9 100755 --- a/script/switch-theme.rb +++ b/script/switch-theme.rb @@ -113,7 +113,7 @@ symlink(File.join(full_theme_path, 'public'), 'alavetelitheme') symlink(full_theme_path, - File.join(alaveteli_directory, 'vendor', 'plugins'), + File.join(alaveteli_directory, 'lib', 'themes'), requested_theme) STDERR.puts """Switched to #{requested_theme}! diff --git a/spec/models/xapian_spec.rb b/spec/models/xapian_spec.rb index 3c9fff784..a1e060d8e 100644 --- a/spec/models/xapian_spec.rb +++ b/spec/models/xapian_spec.rb @@ -370,7 +370,7 @@ describe PublicBody, " when only indexing selected things on a rebuild" do end end -# I would expect ActsAsXapian to have some tests under vendor/plugins/acts_as_xapian, but +# I would expect ActsAsXapian to have some tests under lib/acts_as_xapian, but # it looks like this is not the case. Putting a test here instead. describe ActsAsXapian::Search, "#words_to_highlight" do before(:each) do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d22f3c0ff..1eeb8603b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,6 +13,10 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ SimpleCov.start('rails') do add_filter 'commonlib' add_filter 'vendor/plugins' + add_filter 'lib/strip_attributes' + add_filter 'lib/has_tag_string' + add_filter 'lib/acts_as_xapian' + add_filter 'lib/themes' end Spork.prefork do diff --git a/vendor/plugins/acts_as_xapian/.cvsignore b/vendor/plugins/acts_as_xapian/.cvsignore deleted file mode 100644 index 6379fb207..000000000 --- a/vendor/plugins/acts_as_xapian/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -xapiandbs -.git diff --git a/vendor/plugins/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb b/vendor/plugins/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb deleted file mode 100644 index a1cd1801d..000000000 --- a/vendor/plugins/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb +++ /dev/null @@ -1,13 +0,0 @@ -class ActsAsXapianGenerator < Rails::Generator::Base - def manifest - record do |m| - m.migration_template 'migration.rb', 'db/migrate', - :migration_file_name => "create_acts_as_xapian" - end - end - - protected - def banner - "Usage: #{$0} acts_as_xapian" - end -end diff --git a/vendor/plugins/acts_as_xapian/init.rb b/vendor/plugins/acts_as_xapian/init.rb deleted file mode 100644 index 1e5b8557b..000000000 --- a/vendor/plugins/acts_as_xapian/init.rb +++ /dev/null @@ -1,7 +0,0 @@ -# acts_as_xapian/init.rb: -# -# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. -# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ - -require 'acts_as_xapian' - diff --git a/vendor/plugins/has_tag_string/init.rb b/vendor/plugins/has_tag_string/init.rb deleted file mode 100644 index 4a07073a7..000000000 --- a/vendor/plugins/has_tag_string/init.rb +++ /dev/null @@ -1,2 +0,0 @@ -require 'has_tag_string' - diff --git a/vendor/plugins/strip_attributes/.gitignore b/vendor/plugins/strip_attributes/.gitignore deleted file mode 100644 index 1a240903a..000000000 --- a/vendor/plugins/strip_attributes/.gitignore +++ /dev/null @@ -1 +0,0 @@ -rdoc
\ No newline at end of file diff --git a/vendor/plugins/strip_attributes/init.rb b/vendor/plugins/strip_attributes/init.rb deleted file mode 100644 index 2c71b29bc..000000000 --- a/vendor/plugins/strip_attributes/init.rb +++ /dev/null @@ -1,2 +0,0 @@ -require 'strip_attributes' -ActiveRecord::Base.extend(StripAttributes) |