Skip to content

Commit

Permalink
Merge pull request #23 from paulgoetze/feature/use-jar-dependencies
Browse files Browse the repository at this point in the history
Use jar-dependencies instead of lock_jar gem
  • Loading branch information
paulgoetze authored Oct 13, 2017
2 parents 3204e0a + 21025c1 commit d32978f
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 63 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/spec/reports/
/tmp/
jars
/lib/*_jars.rb
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ AllCops:
- '*.gemspec'
- 'Gemfile'
- 'Gemfile.lock'
- 'lib/weka_jars.rb'

Style/Copyright:
Enabled: false
Expand Down
14 changes: 3 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ sudo: false
language: ruby

rvm:
- jruby-9000

cache:
- bundler

before_install:
- rvm get head
- rvm use jruby-9.0.1.0 --install
- gem install bundler

script: bundle exec rake spec
- jruby-9.0.0.0
- jruby-9.1.0.0
- jruby-head
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Load Jars with jar-dependencies instead of lock_jar gem


## [0.5.0] – 2017-06-17
Expand Down
1 change: 0 additions & 1 deletion Jarfile

This file was deleted.

17 changes: 0 additions & 17 deletions Jarfile.lock

This file was deleted.

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ detailed information about how to use weka with JRuby and some examplary code sn

## Development

After checking out the repo, run `bin/setup` to install dependencies.
To install this gem onto your local machine, run `bundle exec rake install`.
1. Check out the repo with `git clone git@github.com:paulgoetze/weka-jruby.git`.
2. Set a local environment variable `export JARS_VENDOR=false`.
This will prevent
compiling the jars into your repo’s /lib directory and will load them from your local maven repository instead.
See the [jar-dependencies README](https://github.com/mkristian/jar-dependencies#for-development-you-do-not-need-to-vendor-the-jars-at-all) for more information.
3. Run `bin/setup` or `bundle install` to install the dependencies.

Then, run `rake spec` to run the tests. You can also run `bin/console` or `rake irb` for an interactive prompt that will allow you to experiment.

Expand Down
12 changes: 1 addition & 11 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,7 @@ require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

task default: :prepare
task install: :prepare

desc 'Install weka jars & dependencies'
task :prepare do
require 'lock_jar'
lib_path = File.expand_path('.', File.dirname(__FILE__))
jars_dir = File.join(lib_path, 'jars')

LockJar.install('Jarfile.lock', local_repo: jars_dir)
end
task default: :spec

desc 'Start an irb session with the gem loaded'
task :irb do
Expand Down
4 changes: 1 addition & 3 deletions lib/weka.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
require 'java'
require 'weka/jars'
require 'weka/version'
require 'weka/exceptions'
require Dir[File.join(File.dirname(__FILE__), '*_jars.rb')].first

module Weka
include Jars

class << self
def require_all(type)
files = Dir[File.expand_path("../weka/#{type}/**/*.rb", __FILE__)]
Expand Down
16 changes: 0 additions & 16 deletions lib/weka/jars.rb

This file was deleted.

5 changes: 3 additions & 2 deletions weka.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_runtime_dependency 'lock_jar', '~> 0.13'

spec.add_development_dependency 'bundler', '~> 1.6'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'shoulda-matchers', '~> 3.0'

spec.add_runtime_dependency 'jar-dependencies', '~> 0.3.11'
spec.requirements << 'jar nz.ac.waikato.cms.weka, weka-dev, 3.7.13'
end

0 comments on commit d32978f

Please sign in to comment.