Browse Source

Move acts_as_xapian out of vendor/plugins

This includes making making sure that xapiandbs directory is moved
with this version of the code.
release/0.16
Mark Longair 8 years ago
parent
commit
da7f853550
  1. 2
      LICENSE.txt
  2. 2
      config/deploy.rb
  3. 25
      config/initializers/acts_as_xapian.rb
  4. 0
      lib/acts_as_xapian/.gitignore
  5. 0
      lib/acts_as_xapian/LICENSE.txt
  6. 0
      lib/acts_as_xapian/README.txt
  7. 2
      lib/acts_as_xapian/acts_as_xapian.rb
  8. 0
      lib/acts_as_xapian/generators/acts_as_xapian/USAGE
  9. 0
      lib/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb
  10. 0
      lib/acts_as_xapian/generators/acts_as_xapian/templates/migration.rb
  11. 0
      lib/acts_as_xapian/tasks/xapian.rake
  12. 2
      script/compact-xapian-database
  13. 2
      spec/models/xapian_spec.rb
  14. 1
      spec/spec_helper.rb
  15. 2
      vendor/plugins/acts_as_xapian/.cvsignore
  16. 7
      vendor/plugins/acts_as_xapian/init.rb

2
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
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

25
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'

0
vendor/plugins/acts_as_xapian/.gitignore → lib/acts_as_xapian/.gitignore

0
vendor/plugins/acts_as_xapian/LICENSE.txt → lib/acts_as_xapian/LICENSE.txt

0
vendor/plugins/acts_as_xapian/README.txt → lib/acts_as_xapian/README.txt

2
vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb → 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

0
vendor/plugins/acts_as_xapian/generators/acts_as_xapian/USAGE → lib/acts_as_xapian/generators/acts_as_xapian/USAGE

0
vendor/plugins/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb → lib/acts_as_xapian/generators/acts_as_xapian/acts_as_xapian_generator.rb

0
vendor/plugins/acts_as_xapian/generators/acts_as_xapian/templates/migration.rb → lib/acts_as_xapian/generators/acts_as_xapian/templates/migration.rb

0
vendor/plugins/acts_as_xapian/lib/tasks/xapian.rake → lib/acts_as_xapian/tasks/xapian.rake

2
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

2
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

1
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

2
vendor/plugins/acts_as_xapian/.cvsignore

@ -1,2 +0,0 @@
xapiandbs
.git

7
vendor/plugins/acts_as_xapian/init.rb

@ -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'
Loading…
Cancel
Save