Skip to content

Commit

Permalink
Updates to 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasronge committed Dec 14, 2011
1 parent 5c5c5e0 commit d029a86
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 10 deletions.
62 changes: 61 additions & 1 deletion source/configuration.textile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
When used from rails the thread context is automtically clean after each request
h2. Multitenancy, Upgrade, Configuration and Backup

endprologue.
Expand Down Expand Up @@ -137,3 +136,64 @@ end
h3. JRuby Configuration

See "PerformanceTuning":http://kenai.com/projects/jruby/pages/PerformanceTuning

h3. Development and Testing configuration

h4. Travis

Neo4j.rb is using the "travis CI":http://travis-ci.org/#!/andreasronge/neo4j/


h4. Faster RSpecs

h5. Linux

You can create a RAM disk with 500MB like this: (the mount command needs to be issued as root)

<pre>
mkdir -p /tmp/neo4j_testing
mount -t tmpfs -o size=500M tmpfs /tmp/neo4j_testing
</pre>

h5. Mac

You can create a 550MB RAM disk like this:

<pre>
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://1165430`
</pre>

This will create a RAM disk under /Volumes/ramdisk

For both of these, in your spec_helper, you'll have to change the Neo4j config to use the RAM disk.
<pre>
Neo4j::Config[:storage_path] = /path/to/ram/disk
</pre>
You can use umount to unmount the ram disk on both platforms.

For more info, check "this":http://groups.google.com/group/neo4jrb/browse_thread/thread/b22fdebdc3a4b5ea

h4. Using RSpec and Guard

The flow for testing with this PR would be:

# Start the guard: bundle exec guard
# It'll run all specs.
# Got to you spec and start adding/changing.
# Save spec/related implementation file.
# The spec will be executed automatically.

If you want to concentrate on a single spec/example group, just add the <tt>:focus</tt> tag and only this spec will be executed by guard:

<ruby>
it "should do something", :focus do
do_something
end
</ruby>

Additionally the following are included:

default <tt>.rspec</tt> config is added to make it easier to see the spec results with colours.
Growl 1.3 notifications (Mac only for now).

For more info, check "this pull request":https://github.com/andreasronge/neo4j/pull/85
6 changes: 5 additions & 1 deletion source/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h2>Overview of Neo4j.rb 1.3.0</h2>
<h2>Overview of Neo4j.rb 1.3.1</h2>

Neo4j.rb is a graph database for JRuby
It uses the powerful and mature Java libraries:
Expand Down Expand Up @@ -53,6 +53,10 @@ Notice that you can always access the lower layers if you want to do some more a
<code>gem install neo4j</code><br/>
To install JRuby I recommend using <a href="http://rvm.beginrescueend.com/">RVM</a>.

<h2>Development</h2>

<li><a href="configuration.html#development-and-testing-configuration">Travis, RSpec, Guards etc</a></li>

<h2>Examples</h2>

Here are some examples of what you can do:
Expand Down
28 changes: 20 additions & 8 deletions source/lucene.textile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ The full lucene query syntax is available, see "here":http://lucene.apache.org/j
Person.find('name: andreas').first #=> andreas
</ruby>

TIP: You can only query the index after the transaction commits, unless you manage the indexing yourself, see below.

h4. Neo4j::RelationshipMixin

Works as indexing on Neo4j::NodeMixin
Expand All @@ -55,6 +57,8 @@ Example:

h3. Indexing Related Nodes (Shared Index)

This feature is experimental, use it with care !

Two or more classes can share the same index. For example, let say we have two classes Person and Phone and
each person can have several phone number nodes.

Expand Down Expand Up @@ -110,6 +114,7 @@ Person.find('name: *smith AND phone: "040*")

# You can only index incoming relationship
# You must declare both direction with to and from in a has_n or has_one.
# This is experimental, use it with care !

h3. Reuse an Indexer (Shared Index)

Expand Down Expand Up @@ -193,13 +198,20 @@ Person.find(:born => Date.today - 5 .. Date.today)

h3. Compound Queries

Example:
<ruby>
Person.find(:name => 'foo').and(:age).between(10,20)
# same as
Person.find(:name => 'foo', :age => 10..20)
Person.find(:name => 'foo').and(:age).between(10,20)
# same as
Person.find(:name => 'foo', :age => 10..20)
</ruby>

Only @and@ queries are currently supported.
Another example:

<ruby>
Vehicle.find(:wheels => 2).or(:wheels => 4).not(:name => 'old bike')
</ruby>

Only @and@ @not@ and @or@ queries are currently supported.

h3. Date Queries

Expand Down Expand Up @@ -230,11 +242,11 @@ You can add your own lucene indexing configuration in the Neo4j::Config and use

<ruby>

Neo4j::Config[:lucene][:my_index_type] = ...
Neo4j::Config[:lucene][:my_index_type] = ...

class Person
index :name, :type => :my_index_type
end
class Person
index :name, :type => :my_index_type
end
</ruby>


Expand Down

0 comments on commit d029a86

Please sign in to comment.