ruby_da 0.0.2-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f8fac801f0e53addc5a8b7aef01b66a6253f53c6
4
+ data.tar.gz: 87157f257303dbd31d1230a5d77b694de5ef6b6c
5
+ SHA512:
6
+ metadata.gz: bb974ad9ff1cb301a336b36e688bd70e944705761e377bb0e0670389a27a4a16d23bc7f14aab1ef78f7b0b58e0fd56b2628a72fc70b3a7172755e2a3bc7a4e41
7
+ data.tar.gz: 401e57136767a425a2aef99f673191da4549c20e6292a6f9eb75d207bcbd8d7b9eab61c0885b30713032a9553e5ad82ec2a07fe4b622cf1128d85ed487e86d08
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ Gemfile.lock
data/.gitmodules ADDED
@@ -0,0 +1,6 @@
1
+ [submodule "libda"]
2
+ path = libda
3
+ url = git://github.com/shnya/libda.git
4
+ [submodule "java_da"]
5
+ path = java_da
6
+ url = git@github.com:shnya/java_da.git
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ruby_da.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Masahiko Higashiyama
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # RubyDa
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ruby_da`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'ruby_da'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install ruby_da
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ 1. Fork it ( https://github.com/[my-github-username]/ruby_da/fork )
36
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
37
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
38
+ 4. Push to the branch (`git push origin my-new-feature`)
39
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,38 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ end
7
+
8
+ task :default => :test
9
+ task :build => :compile
10
+
11
+ if RUBY_PLATFORM =~ /java/
12
+ BUILD_FILE = File.join(File.dirname(__FILE__), 'java_da', 'build.xml')
13
+ JAR_SRC_FILE = File.join(File.dirname(__FILE__), 'java_da', 'target', 'java-da.jar')
14
+ JAR_DEST_FILE = File.join(File.dirname(__FILE__), 'lib', 'java-da.jar')
15
+
16
+
17
+ task :pre_compile do
18
+ `ant -f #{BUILD_FILE} jar`
19
+ rm_f(JAR_DEST_FILE)
20
+ mv(JAR_SRC_FILE, JAR_DEST_FILE)
21
+ `ant -f #{BUILD_FILE} clean`
22
+ end
23
+ task :compile => :pre_compile
24
+ require "rake/javaextensiontask"
25
+ Rake::JavaExtensionTask.new('ruby_da') do |ext|
26
+ ext.ext_dir = "ext/ruby_da"
27
+ ext.classpath = [JAR_DEST_FILE]
28
+ ext.source_version = '1.8'
29
+ ext.target_version = '1.8'
30
+ end
31
+ CLEAN << File.join(File.dirname(__FILE__), 'java_da', 'target')
32
+ CLOBBER << JAR_DEST_FILE
33
+ else
34
+ require "rake/extensiontask"
35
+ Rake::ExtensionTask.new("ruby_da") do |ext|
36
+ ext.lib_dir = "lib/ruby_da"
37
+ end
38
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "ruby_da"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,153 @@
1
+ import org.jcodings.Encoding;
2
+ import org.jruby.*;
3
+ import org.jruby.anno.JRubyClass;
4
+ import org.jruby.anno.JRubyMethod;
5
+ import org.jruby.runtime.ObjectAllocator;
6
+ import org.jruby.runtime.ThreadContext;
7
+ import org.jruby.runtime.builtin.IRubyObject;
8
+ import org.jruby.runtime.load.BasicLibraryService;
9
+ import jp.scaleout.DoubleArray;
10
+
11
+ import java.io.IOException;
12
+ import java.util.ArrayList;
13
+ import java.util.List;
14
+
15
+
16
+ public class RubyDaService implements BasicLibraryService {
17
+ private Ruby runtime;
18
+
19
+ @Override
20
+ public boolean basicLoad(Ruby runtime) throws IOException {
21
+ this.runtime = runtime;
22
+ RubyModule rbModule = runtime.defineModule("RubyDa");
23
+
24
+ RubyClass rbClass = rbModule.defineClassUnder("Trie", this.runtime.getObject(), new ObjectAllocator() {
25
+ public IRubyObject allocate(Ruby runtime, RubyClass rubyClass) {
26
+ return new Trie(runtime, rubyClass);
27
+ }
28
+ });
29
+ rbClass.defineAnnotatedMethods(Trie.class);
30
+ return true;
31
+ }
32
+
33
+ @JRubyClass(name="Trie")
34
+ public class Trie extends RubyObject {
35
+ private DoubleArray da = null;
36
+
37
+ public Trie(Ruby runtime, RubyClass metaClass) {
38
+ super(runtime, metaClass);
39
+ }
40
+
41
+ @JRubyMethod
42
+ public IRubyObject initialize(ThreadContext context){
43
+ this.da = new DoubleArray();
44
+ return this;
45
+ }
46
+
47
+
48
+ private IRubyObject convToArray(List<String> from){
49
+ RubyArray res = this.getRuntime().newArray(from.size());
50
+ for(String entry : from){
51
+ RubyString resStr = this.getRuntime().newString(entry);
52
+ resStr.associateEncoding(Encoding.load("UTF8"));
53
+ res.add(resStr);
54
+ }
55
+ return res;
56
+ }
57
+
58
+ private IRubyObject convToBoolean(boolean arg){
59
+ return arg ? this.getRuntime().getTrue() : this.getRuntime().getFalse();
60
+ }
61
+
62
+ @JRubyMethod(name = "enumerate")
63
+ public IRubyObject enumerate(ThreadContext context, IRubyObject arg){
64
+ String str = ((RubyString)arg).decodeString();
65
+ List<String> resStrs = new ArrayList<String>();
66
+ List<Integer> resIds = new ArrayList<Integer>();
67
+ da.enumerate(str, resStrs, resIds);
68
+ RubyArray res = this.getRuntime().newArray(resStrs.size());
69
+ for(int i = 0; i < resStrs.size(); i++){
70
+ RubyArray elem = this.getRuntime().newArray(2);
71
+ RubyString resStr = this.getRuntime().newString(resStrs.get(i));
72
+ resStr.associateEncoding(Encoding.load("UTF8"));
73
+ elem.add(resStr);
74
+ elem.add(RubyNumeric.int2fix(this.getRuntime(), resIds.get(i)));
75
+ res.add(elem);
76
+ }
77
+ return res;
78
+ }
79
+
80
+ @JRubyMethod(name = {"exact_match", "exactMatch"})
81
+ public IRubyObject exactMatch(ThreadContext context, IRubyObject str){
82
+ return RubyNumeric.int2fix(this.getRuntime(), da.exactMatch(((RubyString) str).decodeString()));
83
+ }
84
+
85
+ @JRubyMethod(name = {"common_prefix_search", "commonPrefixSearch"})
86
+ public IRubyObject commonPrefixSearch(ThreadContext context, IRubyObject str){
87
+ return convToArray(da.commonPrefixSearch(((RubyString) str).decodeString()));
88
+ }
89
+
90
+ @JRubyMethod(name = "contains")
91
+ public IRubyObject contains(ThreadContext context, IRubyObject str){
92
+ return convToBoolean(da.contains(((RubyString) str).decodeString()));
93
+ }
94
+
95
+ @JRubyMethod(name = {"extract_all_matched", "extractAllMatched"})
96
+ public IRubyObject extractAllMatched(ThreadContext context, IRubyObject str){
97
+ return convToArray(da.extractAllMatched(str.asJavaString()));
98
+ }
99
+
100
+ @JRubyMethod(name = "insert", required=1, optional=1)
101
+ public IRubyObject insert(ThreadContext context, IRubyObject[] args){
102
+ String str = ((RubyString)args[0]).decodeString();
103
+ if(args.length > 1){
104
+ int id = RubyInteger.num2int(args[1]);
105
+ return convToBoolean(da.insert(str, id));
106
+ }else{
107
+ return convToBoolean(da.insert(str));
108
+ }
109
+ }
110
+
111
+ @JRubyMethod(name = "erase")
112
+ public IRubyObject erase(ThreadContext context, IRubyObject arg){
113
+ String str = ((RubyString)arg).decodeString();
114
+ return convToBoolean(da.erase(str));
115
+ }
116
+
117
+ @JRubyMethod(name = "build")
118
+ public IRubyObject build(ThreadContext context, IRubyObject arg) {
119
+ RubyArray array = (RubyArray) arg;
120
+ List<String> words = new ArrayList<String>();
121
+ for (Object elem : array) {
122
+ if(elem instanceof RubyString){
123
+ words.add(((RubyString) elem).decodeString());
124
+ }else{
125
+ words.add((String)elem);
126
+ }
127
+ }
128
+ return convToBoolean(da.build(words));
129
+ }
130
+
131
+ @JRubyMethod(name = "save")
132
+ public IRubyObject save(ThreadContext context, IRubyObject arg) {
133
+ String filename = ((RubyString)arg).decodeString();
134
+ try{
135
+ da.save(filename);
136
+ }catch(IOException e){
137
+ return this.getRuntime().getFalse();
138
+ }
139
+ return this.getRuntime().getTrue();
140
+ }
141
+
142
+ @JRubyMethod(name = "load")
143
+ public IRubyObject load(ThreadContext context, IRubyObject arg) {
144
+ String filename = ((RubyString)arg).decodeString();
145
+ try{
146
+ da.load(filename);
147
+ }catch(IOException e){
148
+ return this.getRuntime().getFalse();
149
+ }
150
+ return this.getRuntime().getTrue();
151
+ }
152
+ }
153
+ }
@@ -0,0 +1,9 @@
1
+ require "mkmf"
2
+ RbConfig::CONFIG["CPP"] = "g++ -E"
3
+ $LDFLAGS += " -lstdc++"
4
+
5
+ dir_config('da')
6
+ find_header('double_array.hpp', File.dirname(__FILE__) + "/../../libda/include")
7
+ if have_header('double_array.hpp')
8
+ create_makefile("ruby_da/ruby_da")
9
+ end
@@ -0,0 +1,171 @@
1
+ #include "ruby_da.h"
2
+ #include <ruby/encoding.h>
3
+ #include "double_array.hpp"
4
+ using namespace std;
5
+
6
+ static int UTF8_ENCODE_ID = rb_enc_find_index("UTF-8");
7
+ static int ASCII_ENCODE_ID = rb_enc_find_index("US-ASCII");
8
+
9
+ static void wrap_RubyDa_free(DoubleArray* ptr){
10
+ ptr->~DoubleArray();
11
+ ruby_xfree(ptr);
12
+ }
13
+
14
+
15
+ static VALUE wrap_RubyDa_allocate(VALUE self) {
16
+ void* p = ruby_xmalloc(sizeof(DoubleArray));
17
+ return Data_Wrap_Struct(self, NULL, wrap_RubyDa_free, p);
18
+ }
19
+
20
+
21
+ static VALUE wrap_RubyDa_initialize(VALUE self) {
22
+ DoubleArray* p;
23
+ Data_Get_Struct(self, DoubleArray, p);
24
+ new (p) DoubleArray();
25
+
26
+ return Qnil;
27
+ }
28
+
29
+ static VALUE vector_to_array(vector<string> vec) {
30
+ VALUE rb_ary = rb_ary_new();
31
+ for(vector<string>::iterator itr = vec.begin(); itr != vec.end(); ++itr){
32
+ VALUE rstr = rb_str_new2(itr->c_str());
33
+ rb_enc_associate_index(rstr, UTF8_ENCODE_ID);
34
+ rb_ary_push(rb_ary, rstr);
35
+ }
36
+ return rb_ary;
37
+ }
38
+
39
+ static DoubleArray* get_ptr(VALUE self){
40
+ DoubleArray* p;
41
+ Data_Get_Struct(self, DoubleArray, p);
42
+ return p;
43
+ }
44
+
45
+ static void check_utf8_encoding(VALUE str){
46
+ int encoding = rb_enc_get_index(str);
47
+ if(encoding != UTF8_ENCODE_ID && encoding != ASCII_ENCODE_ID){
48
+ rb_raise(rb_eRuntimeError, "invalid parameter, input string is not utf-8");
49
+ }
50
+ }
51
+
52
+ static VALUE wrap_RubyDa_enumerate(VALUE self, VALUE str) {
53
+ check_utf8_encoding(str);
54
+ DoubleArray* p = get_ptr(self);
55
+ vector<pair<string, int> > result;
56
+ p->enumerate(StringValueCStr(str), result);
57
+ VALUE rb_ary = rb_ary_new();
58
+ for(vector<pair<string, int> >::iterator itr = result.begin(); itr != result.end(); ++itr){
59
+ VALUE rb_ary_elems = rb_ary_new();
60
+ VALUE rstr = rb_str_new2(itr->first.c_str());
61
+ rb_enc_associate_index(rstr, UTF8_ENCODE_ID);
62
+ VALUE rid = INT2FIX(itr->second);
63
+ rb_ary_push(rb_ary_elems, rstr);
64
+ rb_ary_push(rb_ary_elems, rid);
65
+
66
+ rb_ary_push(rb_ary, rb_ary_elems);
67
+ }
68
+ return rb_ary;
69
+ }
70
+
71
+ static VALUE wrap_RubyDa_exact_match(VALUE self, VALUE str) {
72
+ check_utf8_encoding(str);
73
+ DoubleArray* p = get_ptr(self);
74
+ int id = p->exact_match(StringValueCStr(str));
75
+ return INT2FIX(id);
76
+ }
77
+
78
+
79
+ static VALUE wrap_RubyDa_common_prefix_search(VALUE self, VALUE str) {
80
+ check_utf8_encoding(str);
81
+ DoubleArray* p = get_ptr(self);
82
+ vector<string> result;
83
+ p->common_prefix_search(StringValueCStr(str), result);
84
+ return vector_to_array(result);
85
+ }
86
+
87
+ static VALUE wrap_RubyDa_contains(VALUE self, VALUE str) {
88
+ check_utf8_encoding(str);
89
+ DoubleArray* p = get_ptr(self);
90
+ vector<string> result;
91
+ bool is_contains = p->contains(StringValueCStr(str));
92
+ return is_contains ? Qtrue : Qfalse;
93
+ }
94
+
95
+ static VALUE wrap_RubyDa_extract_all_matched(VALUE self, VALUE str) {
96
+ check_utf8_encoding(str);
97
+ DoubleArray* p = get_ptr(self);
98
+ vector<string> result;
99
+ p->extract_all_matched(StringValueCStr(str), result);
100
+ return vector_to_array(result);
101
+ }
102
+
103
+
104
+ static VALUE wrap_RubyDa_insert(int argc, VALUE* argv, VALUE self) {
105
+ if(argc == 0){
106
+ rb_raise(rb_eRuntimeError, "insert need at least 1 argument");
107
+ }
108
+ VALUE str = argv[0];
109
+ check_utf8_encoding(str);
110
+ int id = -1;
111
+ if(argc == 2){
112
+ id = NUM2INT(argv[1]);
113
+ }
114
+ DoubleArray* p = get_ptr(self);
115
+ bool is_success = p->insert(StringValueCStr(str), id);
116
+ return is_success ? Qtrue : Qfalse;
117
+ }
118
+
119
+ static VALUE wrap_RubyDa_build(VALUE self, VALUE ary) {
120
+ DoubleArray* p = get_ptr(self);
121
+ unsigned long ary_len = RARRAY_LEN(ary);
122
+ vector<string> inputs;
123
+ for(unsigned long i = 0; i < ary_len; i++){
124
+ VALUE entry = rb_ary_entry(ary, i);
125
+ check_utf8_encoding(entry);
126
+ inputs.push_back(StringValueCStr(entry));
127
+ }
128
+ bool is_success = p->build(inputs);
129
+ return is_success ? Qtrue : Qfalse;
130
+ }
131
+
132
+ static VALUE wrap_RubyDa_erase(VALUE self, VALUE str) {
133
+ check_utf8_encoding(str);
134
+ DoubleArray* p = get_ptr(self);
135
+ bool is_success = p->erase(StringValueCStr(str));
136
+ return is_success ? Qtrue : Qfalse;
137
+ }
138
+
139
+ static VALUE wrap_RubyDa_save(VALUE self, VALUE filename) {
140
+ DoubleArray* p = get_ptr(self);
141
+ bool is_success = p->save(StringValueCStr(filename));
142
+ return is_success ? Qtrue : Qfalse;
143
+ }
144
+
145
+ static VALUE wrap_RubyDa_load(VALUE self, VALUE filename) {
146
+ DoubleArray* p = get_ptr(self);
147
+ bool is_success = p->save(StringValueCStr(filename));
148
+ return is_success ? Qtrue : Qfalse;
149
+ }
150
+
151
+
152
+
153
+ extern "C" {
154
+ void Init_ruby_da(void) {
155
+ VALUE rb_RubyDa = rb_define_module("RubyDa");
156
+ VALUE klass = rb_define_class_under(rb_RubyDa, "Trie", rb_cObject);
157
+
158
+ rb_define_alloc_func(klass, wrap_RubyDa_allocate);
159
+ rb_define_private_method(klass, "initialize", (VALUE(*)(...))wrap_RubyDa_initialize, 0);
160
+ rb_define_method(klass, "exact_match", (VALUE(*)(...))wrap_RubyDa_exact_match, 1);
161
+ rb_define_method(klass, "enumerate", (VALUE(*)(...))wrap_RubyDa_enumerate, 1);
162
+ rb_define_method(klass, "common_prefix_search", (VALUE(*)(...))wrap_RubyDa_common_prefix_search, 1);
163
+ rb_define_method(klass, "contains", (VALUE(*)(...))wrap_RubyDa_contains, 1);
164
+ rb_define_method(klass, "extract_all_matched", (VALUE(*)(...))wrap_RubyDa_extract_all_matched, 1);
165
+ rb_define_method(klass, "insert", (VALUE(*)(...))wrap_RubyDa_insert, -1);
166
+ rb_define_method(klass, "build", (VALUE(*)(...))wrap_RubyDa_build, 1);
167
+ rb_define_method(klass, "erase", (VALUE(*)(...))wrap_RubyDa_erase, 1);
168
+ rb_define_method(klass, "save", (VALUE(*)(...))wrap_RubyDa_save, 1);
169
+ rb_define_method(klass, "load", (VALUE(*)(...))wrap_RubyDa_load, 1);
170
+ }
171
+ }
@@ -0,0 +1,6 @@
1
+ #ifndef RUBY_DA_H
2
+ #define RUBY_DA_H 1
3
+
4
+ #include "ruby.h"
5
+
6
+ #endif /* RUBY_DA_H */
data/lib/java-da.jar ADDED
Binary file
@@ -0,0 +1,3 @@
1
+ module RubyDa
2
+ VERSION = "0.0.2"
3
+ end
data/lib/ruby_da.jar ADDED
Binary file
data/lib/ruby_da.rb ADDED
@@ -0,0 +1,12 @@
1
+ require "ruby_da/version"
2
+
3
+ module RubyDa
4
+ if RUBY_PLATFORM =~ /java/
5
+ require File.join(File.dirname(File.expand_path(__FILE__)), "java-da.jar")
6
+ require File.join(File.dirname(File.expand_path(__FILE__)), "ruby_da.jar")
7
+ require 'jruby'
8
+ Java::RubyDaService.new.basicLoad(JRuby.runtime)
9
+ else
10
+ require "ruby_da/ruby_da"
11
+ end
12
+ end
data/ruby_da.gemspec ADDED
@@ -0,0 +1,36 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ruby_da/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ruby_da"
8
+ spec.version = RubyDa::VERSION
9
+ spec.authors = ["Masahiko Higashiyama"]
10
+ spec.email = ["masahiko.higashiyama@gmail.com"]
11
+
12
+ spec.summary = %q{Double Array Implementation}
13
+ spec.description = %q{Double Array Implementation}
14
+ spec.homepage = "https://github.com/shnya/ruby_da"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+ if RUBY_PLATFORM =~ /java/
22
+ spec.platform = "java"
23
+ spec.files << "lib/java-da.jar"
24
+ spec.files << "lib/ruby_da.jar"
25
+ spec.files.concat(`find ./javada -print0`.split("\x0").reject{ |f| f.match(%r{(.git|.idea|test|target)}) })
26
+ else
27
+ spec.platform = Gem::Platform::CURRENT
28
+ spec.extensions = ["ext/ruby_da/extconf.rb"]
29
+ spec.files.concat(`find ./libda -print0 -name "*.hpp"`.split("\x0").reject{ |f| f.match(%r{(.git|test)}) })
30
+ end
31
+
32
+ spec.add_development_dependency "bundler", "~> 1.9"
33
+ spec.add_development_dependency "rake", "~> 10.0"
34
+ spec.add_development_dependency "rake-compiler"
35
+ spec.add_development_dependency "minitest"
36
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby_da
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: java
6
+ authors:
7
+ - Masahiko Higashiyama
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-04-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ~>
17
+ - !ruby/object:Gem::Version
18
+ version: '1.9'
19
+ name: bundler
20
+ prerelease: false
21
+ type: :development
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.9'
27
+ - !ruby/object:Gem::Dependency
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '10.0'
33
+ name: rake
34
+ prerelease: false
35
+ type: :development
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ name: rake-compiler
48
+ prerelease: false
49
+ type: :development
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ name: minitest
62
+ prerelease: false
63
+ type: :development
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Double Array Implementation
70
+ email:
71
+ - masahiko.higashiyama@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - .gitmodules
78
+ - CODE_OF_CONDUCT.md
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - bin/console
84
+ - bin/setup
85
+ - ext/ruby_da/RubyDaService.java
86
+ - ext/ruby_da/extconf.rb
87
+ - ext/ruby_da/ruby_da.cpp
88
+ - ext/ruby_da/ruby_da.h
89
+ - lib/ruby_da.rb
90
+ - lib/ruby_da/version.rb
91
+ - ruby_da.gemspec
92
+ - lib/java-da.jar
93
+ - lib/ruby_da.jar
94
+ homepage: https://github.com/shnya/ruby_da
95
+ licenses:
96
+ - MIT
97
+ metadata: {}
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubyforge_project:
114
+ rubygems_version: 2.1.9
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: Double Array Implementation
118
+ test_files: []