Skip to content

Commit

Permalink
round up for new gem-maven-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mkristian committed Jan 12, 2010
1 parent bdd6849 commit a84bda5
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 123 deletions.
8 changes: 8 additions & 0 deletions History.txt
@@ -1,3 +1,11 @@
=== 0.1.1 / 2009-XX-YY

* using new gem-maven-plugin

* allow rake instead of mvn (fix from myabc)

* added pom-install-lucene-as-gem.xml to allow easy install of lucene jar as gem

=== 0.1.0 / 2009-XX-YY

* creating, retrieving, deleting of resources works
Expand Down
20 changes: 17 additions & 3 deletions Manifest.txt
@@ -1,8 +1,22 @@
.autotest
.classpath
.project
.settings/org.eclipse.jdt.core.prefs
.settings/org.maven.ide.eclipse.prefs
History.txt
MIT-LICENSE
Manifest.txt
README.txt
Rakefile
bin/dm_lucene_adapter
lib/dm_lucene_adapter.rb
test/test_dm_lucene_adapter.rb
lib/dm-lucene-adapter.rb
lib/dm-lucene-adapter_ext.jar
lib/dm_lucene_adapter/dm_lucene_adapter.rb
lib/dm_lucene_adapter/version.rb
pom.xml
spec/dm_lucene_adapter_spec.rb
spec/spec.opts
spec/spec_helper.rb
src/main/java/de/saumya/lucene/LuceneDeleter.java
src/main/java/de/saumya/lucene/LuceneIndexer.java
src/main/java/de/saumya/lucene/LuceneReader.java
src/main/java/de/saumya/lucene/LuceneService.java
55 changes: 51 additions & 4 deletions README.txt
Expand Up @@ -10,31 +10,78 @@

== DESCRIPTION:

FIX (describe your package)
adapter to use lucene with datamapper (datamapper.org). you can search in a fuzzy manner with use of :like in the condition without any wildcards.

== FEATURES/PROBLEMS/LIMITATIONS:

* lucene is java library so the whole thing works ONLY with jruby !!!!

* can handle only resources with Serial

* handles all properties internally as Strings, i.e. all GT, GTE, LT, LTE, Range queries do not work

* limit and offset with sorting will retrieving the complete result set, sorts it and apply the limit and offset to it.

* the current maven rake-plugin is personal fork, so things are not very usable for others yet
* fuzzy search has only default fuzzyness (0.5) and the fuzzy search is always ON when using :like without any wildcards

== SYNOPSIS:

FIX (code sample of usage)

== REQUIREMENTS:

* lucene-core-2.9.0.jar in classpath
* lucene-core-3.0.0.jar in classpath or install it as gem with maven

== INSTALL:

* jgem install dm-lucene-adapter

== LICENSE:
= WORKING WITH THE SOURCES

== the ruby way

* gem install rake-compiler

* first install lucene jar (needs maven) : mvn initialize

* install lucene library as gem (optional): mvn -P install-lucene-as-gem
will be used by dm-lucene-adapter when installed

* building the source: jruby -S rake compile

* running the specs : jruby -S rake spec

* install the gem : jruby -S rake install

== maven way

the maven setup allows to use a local setup of gems for the project only. when you add the 'localgems' profile (add -P localgems or comma separate the profiles like -P maven3,localgems) then you will get a rubygems repository in the directory 'target/rubygems'. it is also possible to define a rubygems repository for all uses of maven via the settings.xml (more details under http://github.com/mkristian/jruby-maven-plugins/ )

=== maven2

* first you need to make sure you have the 'dm-core' gem installed

* building the source and running the specs : mvn install

* building the source without running the specs: mvn install -DskipSpecs=true

=== maven3

* maven will install all the needed gems like dm-core, etc

* building the source and running the specs : mvn -P maven3 install

* building the source without running the specs: mvn -P maven3 install -DskipSpecs=true

=== maven2 + maven3

* install the gem, after a prior run of install: mvn gem:install

* install lucene library as gem : mvn -P install-lucene-as-gem
will be used by dm-lucene-adapter when installed


= LICENSE:

(The MIT License)

Expand Down
8 changes: 7 additions & 1 deletion Rakefile
Expand Up @@ -6,7 +6,7 @@ require 'hoe'
LUCENE_VERSION = '3.0.0'
HOE = Hoe.spec 'dm-lucene-adapter' do |p|
p.developer('mkristian', 'm.kristian@web.de')
p.extra_deps = [['dm-core', '~>0.10.1']]
p.extra_deps = [['dm-core', '~>0.10.2']]
p.url = "http://github.com/mkristian/dm-lucene-adapter"
end

Expand All @@ -27,4 +27,10 @@ rescue LoadError
warn 'To compile, install rake-compiler (gem install rake-compiler) or use Maven (mvn)'
end

desc 'Install the package as a gem.'
task :install => [:package] do
gem = Dir['pkg/*.gem'].first
sh "gem install --local #{gem} --no-ri --no-rdoc"
end

# vim: syntax=ruby
19 changes: 14 additions & 5 deletions lib/dm-lucene-adapter.rb
@@ -1,13 +1,22 @@
require 'java'
begin
LUCENE_VERSION = '3.0.0'

require "#{File.expand_path('~/')}/.m2/repository/org/apache/lucene/lucene-core/#{LUCENE_VERSION}/lucene-core-#{LUCENE_VERSION}.jar"
require 'dm-lucene-adapter_ext'
include_class "de.saumya.lucene.LuceneService"
puts "using lucene from classpath"
rescue NameError => e

begin
require 'org.apache.lucene.lucene-core'
puts "using lucene from gem"
rescue LoadError => ee
LUCENE_VERSION = '3.0.0'

require "#{File.expand_path('~/')}/.m2/repository/org/apache/lucene/lucene-core/#{LUCENE_VERSION}/lucene-core-#{LUCENE_VERSION}.jar"
puts "using lucene from jar"
end

puts "load"
include_class "de.saumya.lucene.LuceneService"
rescue => e
STDERR.puts e.message
end

require 'dm_lucene_adapter/dm_lucene_adapter'
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -165,6 +165,6 @@
</profile>
</profiles>
<properties>
<jruby.maven.plugins>0.7.0</jruby.maven.plugins>
<jruby.maven.plugins>0.8.0-SNAPSHOT</jruby.maven.plugins>
</properties>
</project>
108 changes: 0 additions & 108 deletions pom3.xml

This file was deleted.

2 changes: 1 addition & 1 deletion spec/spec_helper.rb
@@ -1,6 +1,6 @@
require 'rubygems'

gem 'dm-core', ">0.10.0"
#gem 'dm-core', ">0.10.0"
require 'pathname'
$LOAD_PATH << Pathname(__FILE__).dirname.parent.expand_path + 'lib'

Expand Down

0 comments on commit a84bda5

Please sign in to comment.