Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use jar dependencies #6

Merged
merged 2 commits into from
Apr 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

A thin wrapper around the VoltDB Java client.

## Versions

We've decided that vendoring the `voltdbclient-x.x.jar` in the Gem as a
dependency is the right way to do it. We are using VoltDB 6.8 and for that
reason that's the one that's vendored. We are open on doing a different thing if
it's the right solution.

If required we could do multiple releases with different vendored clients. Just
open an issue.

## Installation

Add this line to your application's Gemfile:
Expand All @@ -16,19 +26,6 @@ Or install it yourself as:

$ gem install voltdbjruby

Use `jbundler`, `lock_jar` or a similar to download and load the `voltdbclient`
jar in the CLASSPATH. For example using `jbundler`:

echo "jar \"org.voltdb:voltdbclient\", \"6.8\"" > Jarfile

Install out java dependencies

jruby -S jbundle install

Then require `jbundler` in your code to load it in the CLASSPATH

require "jbundler"

## Usage

### Basic example
Expand Down
1 change: 0 additions & 1 deletion bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ require "pry"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

Pry.start
5 changes: 0 additions & 5 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@ IFS=$'\n\t'
set -vx

bundle install

# Create the Jarfile with the voltdbclient
echo "jar \"org.voltdb:voltdbclient\", \"6.8\"" > Jarfile
# Install our java dependencies
jruby -S jbundle install
Binary file not shown.
1 change: 1 addition & 0 deletions lib/voltdb.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require "voltdbjruby_jars"
require "forwardable"
require "date"

Expand Down
10 changes: 10 additions & 0 deletions lib/voltdbjruby_jars.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# this is a generated file, to avoid over-writing it just delete this comment
begin
require 'jar_dependencies'
rescue LoadError
require 'org/voltdb/voltdbclient/6.8/voltdbclient-6.8.jar'
end

if defined? Jars
require_jar( 'org.voltdb', 'voltdbclient', '6.8' )
end
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require "jbundler"
require "voltdb"
require "pry"

Expand Down
7 changes: 6 additions & 1 deletion voltdb.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/full360/voltdb-client-jruby"
spec.license = "MIT"

# This is important to get the jars installed
spec.platform = "java"

spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.requirements << "jar org.voltdb, voltdbclient, 6.8"

spec.add_development_dependency "jar-dependencies", "~> 0.3"
spec.add_development_dependency "bundler", "~> 1.14"
spec.add_development_dependency "rake", "~> 12"
spec.add_development_dependency "pry", "~> 0.10"
spec.add_development_dependency "rspec", "~> 3.5"
spec.add_development_dependency "jbundler", "~> 0.9"
end