Skip to content

Commit

Permalink
Renamed indices to indexes. Seems wrong, but that is the terminology …
Browse files Browse the repository at this point in the history
…used by MySQL.
  • Loading branch information
nelstrom committed Feb 9, 2009
1 parent a432013 commit 2541827
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions README.markdown
@@ -1,19 +1,19 @@
= Indices
= indexes

This extension adds indices to the database, which should speed up common queries and provide a more snappy response for page rendering.
This extension adds indexes to the database, which should speed up common queries and provide a more snappy response for page rendering.

The extension is targeted at sites running on Radiant up to version 0.6.9. These indices were added to the database in version 0.7 of Radiant, so this extension will be of no use if your site is running on version 0.7.0 or later.
The extension is targeted at sites running on Radiant up to version 0.6.9. These indexes were added to the database in version 0.7 of Radiant, so this extension will be of no use if your site is running on version 0.7.0 or later.

== To install

Place this extension in the vendor/extensions directory of your Radiant project. Then run the Rake task:

rake [production] radiant:extensions:indices:install
rake [production] radiant:extensions:indexes:install

== To uninstall

If you are planning on upgrading your site to run on Radiant 0.7.0 or later, it is advised that you first uninstall this extension. To do so, first run the rake task:

rake [production] radiant:extensions:indices:uninstall
rake [production] radiant:extensions:indexes:uninstall

Then delete this extension from your vendor extensions directory.
6 changes: 3 additions & 3 deletions Rakefile
Expand Up @@ -99,17 +99,17 @@ namespace :spec do
end
end

desc 'Generate documentation for the indices extension.'
desc 'Generate documentation for the indexes extension.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'IndicesExtension'
rdoc.title = 'IndexesExtension'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end

# For extensions that are in transition
desc 'Test the indices extension.'
desc 'Test the indexes extension.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
Expand Down
@@ -1,4 +1,4 @@
class AddIndices < ActiveRecord::Migration
class AddIndexes < ActiveRecord::Migration
def self.up
add_index :pages, :class_name, :name => :pages_class_name
add_index :pages, :parent_id, :name => :pages_parent_id
Expand Down
5 changes: 5 additions & 0 deletions indexes_extension.rb
@@ -0,0 +1,5 @@
class IndexesExtension < Radiant::Extension
version "1.0"
description "Add indexes to the database, for a speed boost on SQL queries."
url "http://github.com/nelstrom/radiant-indexes-extension"
end
5 changes: 0 additions & 5 deletions indices_extension.rb

This file was deleted.

@@ -1,31 +1,31 @@
namespace :radiant do
namespace :extensions do
namespace :indices do
namespace :indexes do

desc "Runs migrations, to add indices to database."
desc "Runs migrations, to add indexes to database."
task :install => :migrate

desc "Runs migrations, to remove indices to database."
desc "Runs migrations, to remove indexes to database."
task :uninstall => :environment do
require 'radiant/extension_migrator'
IndicesExtension.migrator.migrate(0)
indexesExtension.migrator.migrate(0)
end

desc "Runs the migration of the Indices extension"
desc "Runs the migration of the indexes extension"
task :migrate => :environment do
require 'radiant/extension_migrator'
if ENV["VERSION"]
IndicesExtension.migrator.migrate(ENV["VERSION"].to_i)
indexesExtension.migrator.migrate(ENV["VERSION"].to_i)
else
IndicesExtension.migrator.migrate
indexesExtension.migrator.migrate
end
end

desc "Copies public assets of the Indices to the instance public/ directory."
desc "Copies public assets of the indexes to the instance public/ directory."
task :update => :environment do
is_svn_or_dir = proc {|path| path =~ /\.svn/ || File.directory?(path) }
Dir[IndicesExtension.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file|
path = file.sub(IndicesExtension.root, '')
Dir[indexesExtension.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file|
path = file.sub(indexesExtension.root, '')
directory = File.dirname(path)
puts "Copying #{path}..."
mkdir_p RAILS_ROOT + directory
Expand Down

0 comments on commit 2541827

Please sign in to comment.