Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move Sunspot gem tasks into top-level directory

  • Loading branch information...
commit bb6edf7d86acd071414b0dd81f4649de9578e63d 1 parent 343c19d
Mat Brown authored
View
7 README.rdoc
@@ -66,8 +66,11 @@ You can change the URL at which Sunspot accesses Solr with:
== Rails Integration
-The {Sunspot::Rails}[http://github.com/outoftime/sunspot_rails] plugin makes
-integrating Sunspot into Rails drop-in easy.
+The Sunspot::Rails plugin makes integrating Sunspot into Rails drop-in easy.
+
+ gem install sunspot_rails
+
+See the README for that gem or the Sunspot Wiki for more information.
== Using Sunspot
View
1  sunspot/.gitignore
@@ -7,3 +7,4 @@ pkg
.yardoc
sunspot.gemspec
+README.rdoc
View
2  sunspot/Rakefile
@@ -4,6 +4,8 @@ task :environment do
require File.dirname(__FILE__) + '/lib/sunspot'
end
+require File.join(File.dirname(__FILE__), 'lib', 'sunspot', 'version')
+
Dir['tasks/**/*.rake'].each { |t| load t }
task :default => 'spec:api'
View
2  sunspot/lib/sunspot/version.rb
@@ -1,3 +1,3 @@
module Sunspot
- VERSION = '1.0.0pre1'
+ VERSION = '1.0.0'
end
View
1  sunspot/pkg/.gitignore
@@ -0,0 +1 @@
+*
View
12 sunspot/tasks/gemspec.rake
@@ -1,6 +1,6 @@
-require File.join(File.dirname(__FILE__), '..', 'lib', 'sunspot', 'gem_tasks')
+require File.join(File.dirname(__FILE__), '..', '..', 'tools', 'gem_tasks')
-Sunspot::GemTasks.new do |s|
+Sunspot::GemTasks.new(:build => :copy_rdoc) do |s|
s.name = 'sunspot'
s.version = Sunspot::VERSION
s.executables = ['sunspot-solr', 'sunspot-configure-solr']
@@ -22,3 +22,11 @@ TEXT
'--main' << 'README.rdoc'
end
+
+task :copy_rdoc do
+ sunspot_root = File.join(File.dirname(__FILE__), '..')
+ FileUtils.cp(
+ File.join(sunspot_root, '..', 'README.rdoc'),
+ sunspot_root
+ )
+end
View
2  sunspot/tasks/rdoc.rake
@@ -10,8 +10,6 @@ rescue LoadError
# It's OK if hanna isn't installed.
end
-require File.join(File.dirname(__FILE__), '..', 'sunspot', 'version')
-
Rake::RDocTask.new(:doc) do |rdoc|
version = Sunspot::VERSION
rdoc.title = "Sunspot #{version} - Solr-powered search for Ruby objects - API Documentation"
View
13 sunspot/lib/sunspot/gem_tasks.rb → tools/gem_tasks.rb
@@ -1,11 +1,11 @@
require 'rubygems/specification'
-require File.join(File.dirname(__FILE__), 'version')
module Sunspot
class GemTasks
PROJECT_ROOT = File.dirname(Rake.application.rakefile_location)
- def initialize(&block)
+ def initialize(dependencies = {}, &block)
+ @dependencies = dependencies
@gemspec_block = block
task(:gemspec, "Write gemspec")
@@ -15,6 +15,7 @@ def initialize(&block)
end
def build
+ run_dependencies(:build)
filename = Gem::Builder.new(spec).build
FileUtils.mv(filename, File.join(PROJECT_ROOT, 'pkg'))
File.join('pkg', filename)
@@ -56,5 +57,13 @@ def task(name, description)
Rake.application.last_description = description
Rake::Task.define_task(name) { send(name) }
end
+
+ def run_dependencies(task)
+ if @dependencies[task]
+ Array(@dependencies[task]).each do |dependency|
+ Rake::Task[dependency].invoke
+ end
+ end
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.