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 +4 -4
- data/.travis.yml +11 -3
- data/Gemfile +4 -5
- data/README.md +2 -0
- data/Rakefile +19 -1
- data/ext/r2ree/extconf.rb +4 -3
- data/ext/r2ree/r2ree.cc +0 -8
- data/lib/r2ree/version.rb +3 -0
- data/r2ree.gemspec +6 -2
- metadata +21 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1880fd4e308c99714e1ea13e5c796eb9afc50ad1
|
4
|
+
data.tar.gz: d6d536b0ff188ea98d48453f4ae2a94779d6d765
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
6
|
-
|
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
data/README.md
CHANGED
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
|
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
|
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);
|
data/r2ree.gemspec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
require File.expand_path('
|
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.
|
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-
|
12
|
-
dependencies:
|
13
|
-
|
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
|