tomz-libsvm-ruby-swig 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.txt CHANGED
@@ -21,6 +21,9 @@ you should run make under the libsvm-2.88 and libsvm-2.88/ruby
21
21
  directories to regenerate the executables for your environment.
22
22
 
23
23
  == INSTALL:
24
+ Currently the gem is available on linux only(tested on Ubuntu 8 and Fedora 9/10,
25
+ and on OS X by danielsdeleo), and you will need g++ installed to compile the
26
+ native code.
24
27
 
25
28
  sudo gem sources -a http://gems.github.com (you only have to do this once)
26
29
  sudo gem install tomz-libsvm-ruby-swig
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ task :default => ["sync_files","make_gem"]
5
5
 
6
6
  EXT = "ext/svm?.#{Hoe::DLEXT}"
7
7
 
8
- Hoe.new('libsvm-ruby-swig', '0.2.3') do |p|
8
+ Hoe.new('libsvm-ruby-swig', '0.2.4') do |p|
9
9
  p.author = 'Tom Zeng'
10
10
  p.email = 'tom.z.zeng@gmail.com'
11
11
  p.url = 'http://www.tomzconsulting.com'
data/ext/extconf.rb CHANGED
@@ -4,4 +4,4 @@ $CFLAGS = "#{ENV['CFLAGS']} -Wall -O3 "
4
4
  if CONFIG["MAJOR"].to_i >= 1 && CONFIG["MINOR"].to_i >= 8
5
5
  $CFLAGS << " -DHAVE_DEFINE_ALLOC_FUNCTION"
6
6
  end
7
- create_makefile('svmc')
7
+ create_makefile('libsvm-ruby-swig/libsvm')
data/ext/svmc_wrap.cxx CHANGED
@@ -4435,11 +4435,11 @@ SWIG_PropagateClientData(void) {
4435
4435
  #ifdef __cplusplus
4436
4436
  extern "C"
4437
4437
  #endif
4438
- SWIGEXPORT void Init_svmc(void) {
4438
+ SWIGEXPORT void Init_libsvm(void) {
4439
4439
  size_t i;
4440
4440
 
4441
4441
  SWIG_InitRuntime();
4442
- mSvmc = rb_define_module("Svmc");
4442
+ mSvmc = rb_define_module("LibSVM");
4443
4443
 
4444
4444
  SWIG_InitializeModule(0);
4445
4445
  for (i = 0; i < swig_module.size; i++) {
data/lib/svm.rb CHANGED
@@ -1,5 +1,5 @@
1
- require 'svmc'
2
- include Svmc
1
+ require 'libsvm-ruby-swig/libsvm'
2
+ include LibSVM
3
3
 
4
4
  def _int_array(seq)
5
5
  size = seq.size
@@ -196,7 +196,7 @@ class Model
196
196
  param.gamma = 1.0/prob.maxlen
197
197
  end
198
198
  msg = svm_check_parameter(prob.prob,param.param)
199
- raise "ValueError", msg if msg
199
+ raise ::ArgumentError, msg if msg
200
200
  @model = svm_train(prob.prob,param.param)
201
201
  end
202
202
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tomz-libsvm-ruby-swig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Zeng