r2ree 0.0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92e4940115abf3167b0f3789add6c1e2409bf16a
4
- data.tar.gz: e75b0fd689d3f08caa23326a4d4c4976ba21a749
3
+ metadata.gz: 1880fd4e308c99714e1ea13e5c796eb9afc50ad1
4
+ data.tar.gz: d6d536b0ff188ea98d48453f4ae2a94779d6d765
5
5
  SHA512:
6
- metadata.gz: 6bbadaa7576826f70536a006168216ff981fad5993a1cfc558ee4797afb19b11bdab828a1ee2f9d2ff52645f03dd66ccce3e984b18feefccfc0df4afc70277a8
7
- data.tar.gz: f087b59bc48b93d189eed595e2e83b7363bb995206dd8f200db1dd7ff52fd7e5434b86b60b202444bf50b5d310f8a0e80647b560b5a18039a67c45085ff8cabe
6
+ metadata.gz: 2d5e9858d46d1c6e97e79b7b54e958ce07e5c97f661f0bb56cccad5580fc5b5e046fdc34c989bd54acebc3e5d35301024643d17c71a6f87c6a39d532691be6a5
7
+ data.tar.gz: b277343834e0096d6ad7df512b7873a3dbc328283ac866f93e1f8b9dce7f8dfbfab2fc42d944626106d9410f1934da04bbf1b1e000818d91cea8c3de4022f040
data/.travis.yml CHANGED
@@ -1,6 +1,14 @@
1
- sudo: false
2
1
  language: ruby
2
+ sudo: required
3
+ dist: trusty
3
4
  rvm:
4
5
  - 2.3.1
5
- before_install: gem install bundler -v 1.12.5
6
- before_script: bundle exec rake build
6
+ before_install:
7
+ - gem install bundler -v 1.12.5
8
+ - export CXX="g++-4.8"
9
+ addons:
10
+ apt:
11
+ sources:
12
+ - ubuntu-toolchain-r-test
13
+ packages:
14
+ - g++-4.8
data/Gemfile CHANGED
@@ -1,7 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in r2ree.gemspec
4
-
5
- gem 'bundler', '~> 1.12'
6
- gem 'rake', '~> 10.0'
7
- gem 'test-unit'
3
+ gem 'bundler', '~> 1.12'
4
+ gem 'rake', '~> 10.0'
5
+ gem 'test-unit'
6
+ gemspec
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # R2ree
2
2
 
3
+ [![Build Status](https://travis-ci.org/namusyaka/r2ree-ruby.svg?branch=master)](https://travis-ci.org/namusyaka/r2ree-ruby)
4
+
3
5
  [r2ree](https://github.com/namusyaka/r2ree) bindings for Ruby
4
6
 
5
7
  ## Installation
data/Rakefile CHANGED
@@ -1,5 +1,23 @@
1
1
  require 'rake/testtask'
2
2
 
3
+ begin
4
+ require 'rake/extensiontask'
5
+ rescue LoadError
6
+ abort 'rake-compiler is missing'
7
+ end
8
+
9
+ gemspec = Gem::Specification::load(File.expand_path('../r2ree.gemspec', __FILE__))
10
+
11
+ Rake::ExtensionTask.new('r2ree', gemspec) do |r|
12
+ r.lib_dir = 'lib/'
13
+ end
14
+
15
+ task :checkout do
16
+ sh 'git submodule update --init'
17
+ end
18
+
19
+ Rake::Task[:compile].prerequisites.insert(0, :checkout)
20
+
3
21
  Rake::TestTask.new do |t|
4
22
  t.libs << 'test'
5
23
  t.test_files = Dir['test/**/test_*.rb']
@@ -10,4 +28,4 @@ task :build do |t|
10
28
  sh 'cd ext/r2ree && ruby extconf.rb && make'
11
29
  end
12
30
 
13
- task default: :test
31
+ task default: [:compile, :test]
data/ext/r2ree/extconf.rb CHANGED
@@ -8,10 +8,11 @@ Dir.chdir(R2REE_DIR) do
8
8
  FileUtils.cp File.join('src', 'r2ree.cc'), File.join('..', '..', 'ext', 'r2ree', 'libr2ree.cc')
9
9
  end
10
10
 
11
+ base_flags = " -std=c++11 -Wall -Wextra -I#{R2REE_DIR}/include"
12
+
11
13
  $CXXFLAGS +=
12
14
  case cc_command
13
- when /clang\+\+/ then " -std=c++11 -Wall -Wextra -I#{R2REE_DIR}/include"
14
- when /g++/ then " -std=c++0x -Wall -Wextra -I#{R2REE_DIR}/include"
15
+ when /clang\+\+/, /g++/ then base_flags
15
16
  end
16
17
 
17
- create_makefile('r2ree/r2ree')
18
+ create_makefile('r2ree')
data/ext/r2ree/r2ree.cc CHANGED
@@ -3,8 +3,6 @@
3
3
  #include "iostream"
4
4
  #include "ruby.h"
5
5
 
6
- #define R2REE_VERSION "0.0.1"
7
-
8
6
  using std::ignore;
9
7
  using std::tie;
10
8
 
@@ -88,14 +86,8 @@ static VALUE r2ree_find(int argc, VALUE *argv, VALUE self) {
88
86
  };
89
87
 
90
88
  extern "C" void Init_r2ree() {
91
- VALUE tmp;
92
-
93
89
  rb_r2ree = rb_define_class("R2ree", rb_cObject);
94
90
 
95
- tmp = rb_str_new2(R2REE_VERSION);
96
- rb_obj_freeze(tmp);
97
- rb_const_set(rb_r2ree, rb_intern("VERSION"), tmp);
98
-
99
91
  rb_define_singleton_method(rb_r2ree, "new", RUBY_METHOD_FUNC(r2ree_s_new), -1);
100
92
  rb_define_method(rb_r2ree, "exist?", RUBY_METHOD_FUNC(r2ree_exist), -1);
101
93
  rb_define_method(rb_r2ree, "find", RUBY_METHOD_FUNC(r2ree_find), -1);
@@ -0,0 +1,3 @@
1
+ class R2ree
2
+ VERSION = '0.1.1'.freeze
3
+ end
data/r2ree.gemspec CHANGED
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
- require File.expand_path('ext/r2ree/r2ree', __dir__)
2
+ require File.expand_path('lib/r2ree/version', __dir__)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "r2ree"
@@ -8,7 +8,6 @@ Gem::Specification.new do |spec|
8
8
  spec.email = ["namusyaka@gmail.com"]
9
9
 
10
10
  spec.summary = %q{r2ree radix tree implementation for ruby}
11
- spec.description = spec.summary
12
11
  spec.homepage = "https://github.com/namusyaka/r2ree-ruby"
13
12
  spec.license = "MIT"
14
13
  spec.extensions = %w[ext/r2ree/extconf.rb]
@@ -17,4 +16,9 @@ Gem::Specification.new do |spec|
17
16
  spec.bindir = "exe"
18
17
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
18
  spec.require_paths = ["lib"]
19
+ spec.description = <<-DESC
20
+ r2ree is a ruby bindings to the r2ree linkable C++ radix tree library.
21
+ DESC
22
+
23
+ spec.add_development_dependency "rake-compiler", ">= 0.9.0"
20
24
  end
metadata CHANGED
@@ -1,16 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r2ree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - namusyaka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-09 00:00:00.000000000 Z
12
- dependencies: []
13
- description: r2ree radix tree implementation for ruby
11
+ date: 2016-11-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake-compiler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.9.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.9.0
27
+ description: 'r2ree is a ruby bindings to the r2ree linkable C++ radix tree library.
28
+
29
+ '
14
30
  email:
15
31
  - namusyaka@gmail.com
16
32
  executables: []
@@ -26,6 +42,7 @@ files:
26
42
  - Rakefile
27
43
  - ext/r2ree/extconf.rb
28
44
  - ext/r2ree/r2ree.cc
45
+ - lib/r2ree/version.rb
29
46
  - r2ree.gemspec
30
47
  - vendor/r2ree/.travis.yml
31
48
  - vendor/r2ree/CMakeLists.txt