diff options
-rw-r--r-- | LICENSE.txt | 2 | ||||
-rw-r--r-- | config/deploy.rb | 2 | ||||
-rw-r--r-- | config/initializers/acts_as_xapian.rb | 25 | ||||
-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/generators/acts_as_xapian/USAGE (renamed from vendor/plugins/acts_as_xapian/generators/acts_as_xapian/USAGE) | 0 | ||||
-rw-r--r-- | lib/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb (renamed from vendor/plugins/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb) | 0 | ||||
-rw-r--r-- | lib/acts_as_xapian/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/acts_as_xapian/tasks/xapian.rake (renamed from vendor/plugins/acts_as_xapian/lib/tasks/xapian.rake) | 0 | ||||
-rwxr-xr-x | script/compact-xapian-database | 2 | ||||
-rw-r--r-- | spec/models/xapian_spec.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 1 | ||||
-rw-r--r-- | vendor/plugins/acts_as_xapian/.cvsignore | 2 | ||||
-rw-r--r-- | vendor/plugins/acts_as_xapian/init.rb | 7 |
16 files changed, 31 insertions, 14 deletions
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 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/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/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/generators/acts_as_xapian/USAGE b/lib/acts_as_xapian/generators/acts_as_xapian/USAGE index 2d027c46f..2d027c46f 100644 --- a/vendor/plugins/acts_as_xapian/generators/acts_as_xapian/USAGE +++ b/lib/acts_as_xapian/generators/acts_as_xapian/USAGE diff --git a/vendor/plugins/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb b/lib/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb index a1cd1801d..a1cd1801d 100644 --- a/vendor/plugins/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb +++ b/lib/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb diff --git a/vendor/plugins/acts_as_xapian/generators/acts_as_xapian/templates/migration.rb b/lib/acts_as_xapian/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/acts_as_xapian/generators/acts_as_xapian/templates/migration.rb 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/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/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 d3cf7c9af..57d58e276 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -15,6 +15,7 @@ SimpleCov.start('rails') do add_filter 'vendor/plugins' add_filter 'lib/strip_attributes' add_filter 'lib/has_tag_string' + add_filter 'lib/acts_as_xapian' 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/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' - |