fast_trie 0.3.6 → 0.3.7
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/VERSION.yml +1 -1
- data/ext/trie/trie.c +6 -3
- data/spec/trie_spec.rb +2 -4
- metadata +17 -8
- data/ext/trie/Makefile +0 -149
- data/lib/trie.rb +0 -1
data/VERSION.yml
CHANGED
data/ext/trie/trie.c
CHANGED
@@ -305,8 +305,11 @@ static VALUE rb_trie_node_alloc(VALUE klass) {
|
|
305
305
|
static VALUE rb_trie_node_initialize_copy(VALUE self, VALUE from) {
|
306
306
|
RDATA(self)->data = trie_state_clone(RDATA(from)->data);
|
307
307
|
|
308
|
-
|
309
|
-
rb_iv_set(self, "@
|
308
|
+
VALUE state = rb_iv_get(from, "@state");
|
309
|
+
rb_iv_set(self, "@state", state == Qnil ? Qnil : rb_str_dup(state));
|
310
|
+
|
311
|
+
VALUE full_state = rb_iv_get(from, "@full_state");
|
312
|
+
rb_iv_set(self, "@full_state", full_state == Qnil ? Qnil : rb_str_dup(full_state));
|
310
313
|
|
311
314
|
return self;
|
312
315
|
}
|
@@ -388,7 +391,7 @@ static VALUE rb_trie_node_walk(VALUE self, VALUE rchar) {
|
|
388
391
|
VALUE full_state = rb_iv_get(new_node, "@full_state");
|
389
392
|
rb_str_append(full_state, rchar);
|
390
393
|
rb_iv_set(new_node, "@full_state", full_state);
|
391
|
-
return
|
394
|
+
return new_node;
|
392
395
|
} else
|
393
396
|
return Qnil;
|
394
397
|
}
|
data/spec/trie_spec.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
require 'rubygems'
|
3
|
-
require 'trie'
|
1
|
+
require File.dirname(__FILE__) + '/../lib/trie'
|
4
2
|
|
5
3
|
describe Trie do
|
6
4
|
before :each do
|
@@ -204,7 +202,7 @@ describe TrieNode do
|
|
204
202
|
describe :walk do
|
205
203
|
it 'returns a new node object when the walk succeeds' do
|
206
204
|
other = @node.walk('r')
|
207
|
-
other.
|
205
|
+
other.should_not == @node
|
208
206
|
end
|
209
207
|
|
210
208
|
it 'returns nil when the walk fails' do
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_trie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
- 7
|
10
|
+
version: 0.3.7
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Tyler McMullen
|
@@ -9,7 +15,7 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
18
|
+
date: 2010-07-19 00:00:00 -07:00
|
13
19
|
default_executable:
|
14
20
|
dependencies: []
|
15
21
|
|
@@ -25,7 +31,6 @@ extra_rdoc_files:
|
|
25
31
|
files:
|
26
32
|
- README.textile
|
27
33
|
- VERSION.yml
|
28
|
-
- ext/trie/Makefile
|
29
34
|
- ext/trie/darray.c
|
30
35
|
- ext/trie/darray.h
|
31
36
|
- ext/trie/extconf.rb
|
@@ -39,7 +44,6 @@ files:
|
|
39
44
|
- ext/trie/trie.h
|
40
45
|
- ext/trie/triedefs.h
|
41
46
|
- ext/trie/typedefs.h
|
42
|
-
- lib/trie.rb
|
43
47
|
- spec/trie_spec.rb
|
44
48
|
- LICENSE
|
45
49
|
has_rdoc: true
|
@@ -58,23 +62,28 @@ rdoc_options:
|
|
58
62
|
- README
|
59
63
|
require_paths:
|
60
64
|
- ext
|
61
|
-
- lib
|
62
65
|
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
63
67
|
requirements:
|
64
68
|
- - ">="
|
65
69
|
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
66
73
|
version: "0"
|
67
|
-
version:
|
68
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
69
76
|
requirements:
|
70
77
|
- - ">="
|
71
78
|
- !ruby/object:Gem::Version
|
79
|
+
hash: 3
|
80
|
+
segments:
|
81
|
+
- 0
|
72
82
|
version: "0"
|
73
|
-
version:
|
74
83
|
requirements: []
|
75
84
|
|
76
85
|
rubyforge_project:
|
77
|
-
rubygems_version: 1.3.
|
86
|
+
rubygems_version: 1.3.7
|
78
87
|
signing_key:
|
79
88
|
specification_version: 3
|
80
89
|
summary: Ruby Trie based on libdatrie.
|
data/ext/trie/Makefile
DELETED
@@ -1,149 +0,0 @@
|
|
1
|
-
|
2
|
-
SHELL = /bin/sh
|
3
|
-
|
4
|
-
#### Start of system configuration section. ####
|
5
|
-
|
6
|
-
srcdir = .
|
7
|
-
topdir = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
|
8
|
-
hdrdir = $(topdir)
|
9
|
-
VPATH = $(srcdir):$(topdir):$(hdrdir)
|
10
|
-
prefix = $(DESTDIR)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr
|
11
|
-
exec_prefix = $(prefix)
|
12
|
-
sitedir = $(DESTDIR)/Library/Ruby/Site
|
13
|
-
rubylibdir = $(libdir)/ruby/$(ruby_version)
|
14
|
-
docdir = $(datarootdir)/doc/$(PACKAGE)
|
15
|
-
dvidir = $(docdir)
|
16
|
-
datarootdir = $(prefix)/share
|
17
|
-
archdir = $(rubylibdir)/$(arch)
|
18
|
-
sbindir = $(exec_prefix)/sbin
|
19
|
-
psdir = $(docdir)
|
20
|
-
localedir = $(datarootdir)/locale
|
21
|
-
htmldir = $(docdir)
|
22
|
-
datadir = $(datarootdir)
|
23
|
-
includedir = $(prefix)/include
|
24
|
-
infodir = $(DESTDIR)/usr/share/info
|
25
|
-
sysconfdir = $(prefix)/etc
|
26
|
-
mandir = $(DESTDIR)/usr/share/man
|
27
|
-
libdir = $(exec_prefix)/lib
|
28
|
-
sharedstatedir = $(prefix)/com
|
29
|
-
oldincludedir = $(DESTDIR)/usr/include
|
30
|
-
pdfdir = $(docdir)
|
31
|
-
sitearchdir = $(sitelibdir)/$(sitearch)
|
32
|
-
bindir = $(exec_prefix)/bin
|
33
|
-
localstatedir = $(prefix)/var
|
34
|
-
sitelibdir = $(sitedir)/$(ruby_version)
|
35
|
-
libexecdir = $(exec_prefix)/libexec
|
36
|
-
|
37
|
-
CC = gcc
|
38
|
-
LIBRUBY = $(LIBRUBY_SO)
|
39
|
-
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
40
|
-
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
|
41
|
-
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)
|
42
|
-
|
43
|
-
RUBY_EXTCONF_H =
|
44
|
-
CFLAGS = -fno-common -arch ppc -arch i386 -Os -pipe -fno-common
|
45
|
-
INCFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)
|
46
|
-
CPPFLAGS =
|
47
|
-
CXXFLAGS = $(CFLAGS)
|
48
|
-
DLDFLAGS = -L. -arch ppc -arch i386
|
49
|
-
LDSHARED = cc -arch ppc -arch i386 -pipe -bundle -undefined dynamic_lookup
|
50
|
-
AR = ar
|
51
|
-
EXEEXT =
|
52
|
-
|
53
|
-
RUBY_INSTALL_NAME = ruby
|
54
|
-
RUBY_SO_NAME = ruby
|
55
|
-
arch = universal-darwin9.0
|
56
|
-
sitearch = universal-darwin9.0
|
57
|
-
ruby_version = 1.8
|
58
|
-
ruby = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
|
59
|
-
RUBY = $(ruby)
|
60
|
-
RM = rm -f
|
61
|
-
MAKEDIRS = mkdir -p
|
62
|
-
INSTALL = /usr/bin/install -c
|
63
|
-
INSTALL_PROG = $(INSTALL) -m 0755
|
64
|
-
INSTALL_DATA = $(INSTALL) -m 644
|
65
|
-
COPY = cp
|
66
|
-
|
67
|
-
#### End of system configuration section. ####
|
68
|
-
|
69
|
-
preload =
|
70
|
-
|
71
|
-
libpath = . $(libdir)
|
72
|
-
LIBPATH = -L"." -L"$(libdir)"
|
73
|
-
DEFFILE =
|
74
|
-
|
75
|
-
CLEANFILES = mkmf.log
|
76
|
-
DISTCLEANFILES =
|
77
|
-
|
78
|
-
extout =
|
79
|
-
extout_prefix =
|
80
|
-
target_prefix =
|
81
|
-
LOCAL_LIBS =
|
82
|
-
LIBS = $(LIBRUBYARG_SHARED) -lpthread -ldl -lm
|
83
|
-
SRCS = darray.c fileutils.c tail.c trie-private.c trie.c
|
84
|
-
OBJS = darray.o fileutils.o tail.o trie-private.o trie.o
|
85
|
-
TARGET = trie
|
86
|
-
DLLIB = $(TARGET).bundle
|
87
|
-
EXTSTATIC =
|
88
|
-
STATIC_LIB =
|
89
|
-
|
90
|
-
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
91
|
-
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
92
|
-
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
93
|
-
|
94
|
-
TARGET_SO = $(DLLIB)
|
95
|
-
CLEANLIBS = $(TARGET).bundle $(TARGET).il? $(TARGET).tds $(TARGET).map
|
96
|
-
CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
|
97
|
-
|
98
|
-
all: $(DLLIB)
|
99
|
-
static: $(STATIC_LIB)
|
100
|
-
|
101
|
-
clean:
|
102
|
-
@-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
|
103
|
-
|
104
|
-
distclean: clean
|
105
|
-
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
106
|
-
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
107
|
-
|
108
|
-
realclean: distclean
|
109
|
-
install: install-so install-rb
|
110
|
-
|
111
|
-
install-so: $(RUBYARCHDIR)
|
112
|
-
install-so: $(RUBYARCHDIR)/$(DLLIB)
|
113
|
-
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
|
114
|
-
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
115
|
-
install-rb: pre-install-rb install-rb-default
|
116
|
-
install-rb-default: pre-install-rb-default
|
117
|
-
pre-install-rb: Makefile
|
118
|
-
pre-install-rb-default: Makefile
|
119
|
-
$(RUBYARCHDIR):
|
120
|
-
$(MAKEDIRS) $@
|
121
|
-
|
122
|
-
site-install: site-install-so site-install-rb
|
123
|
-
site-install-so: install-so
|
124
|
-
site-install-rb: install-rb
|
125
|
-
|
126
|
-
.SUFFIXES: .c .m .cc .cxx .cpp .C .o
|
127
|
-
|
128
|
-
.cc.o:
|
129
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
130
|
-
|
131
|
-
.cxx.o:
|
132
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
133
|
-
|
134
|
-
.cpp.o:
|
135
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
136
|
-
|
137
|
-
.C.o:
|
138
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
139
|
-
|
140
|
-
.c.o:
|
141
|
-
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
|
142
|
-
|
143
|
-
$(DLLIB): $(OBJS)
|
144
|
-
@-$(RM) $@
|
145
|
-
$(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
$(OBJS): ruby.h defines.h
|
data/lib/trie.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
#require File.dirname(__FILE__) + '/../ext/trie'
|