quicksort_c 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +20 -0
- data/ext/quicksort_c_impl/Makefile +267 -0
- data/ext/quicksort_c_impl/extconf.rb +8 -0
- data/ext/quicksort_c_impl/quicksort_c_impl.c +16 -0
- data/ext/quicksort_c_impl/quicksort_c_impl.h +10 -0
- data/lib/quicksort_c/version.rb +5 -0
- data/lib/quicksort_c.rb +10 -0
- data/lib/quicksort_c_impl/quicksort_c_impl.bundle +0 -0
- metadata +87 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a0d97c8e001fe09399082500abc29356a4930dbde4f67a1fff0f2accac7d1585
|
4
|
+
data.tar.gz: ef2fcf281ac010691f07f3c7a8edcd226563ff1a76bbfd0b57d37e2f8be1d267
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 836fb36e8da1d214b7da459d5ef042ee0767230379944b4ec65595a80882e7c9a537e9c551a527a4a49b5ad1f97aa74dd4fc0d61da7fb94fab568f93fed06484
|
7
|
+
data.tar.gz: 40badb055b29072311428efd573c61c151f7dad043e60928198ff9288619807d91ee18b8a8e7c5c360291161b989cdb500827780e6758d69e1239da5d1f09afa
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2022 Leon Kielstra
|
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
|
+
# QuicksortC
|
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/quicksort_c`. 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 'quicksort_c'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install quicksort_c
|
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 `rake test` to run the tests. You can also 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`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/quicksort_c.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
10
|
+
end
|
11
|
+
|
12
|
+
require "rubocop/rake_task"
|
13
|
+
|
14
|
+
RuboCop::RakeTask.new
|
15
|
+
|
16
|
+
require "rake/extensiontask"
|
17
|
+
|
18
|
+
Rake::ExtensionTask.new("quicksort_c_impl") do |ext|
|
19
|
+
ext.lib_dir = "lib/quicksort_c_impl"
|
20
|
+
end
|
@@ -0,0 +1,267 @@
|
|
1
|
+
|
2
|
+
SHELL = /bin/sh
|
3
|
+
|
4
|
+
# V=0 quiet, V=1 verbose. other values don't work.
|
5
|
+
V = 0
|
6
|
+
Q1 = $(V:1=)
|
7
|
+
Q = $(Q1:0=@)
|
8
|
+
ECHO1 = $(V:1=@ :)
|
9
|
+
ECHO = $(ECHO1:0=@ echo)
|
10
|
+
NULLCMD = :
|
11
|
+
|
12
|
+
#### Start of system configuration section. ####
|
13
|
+
|
14
|
+
srcdir = .
|
15
|
+
topdir = /Users/leon.kielstra/.asdf/installs/ruby/3.0.3/include/ruby-3.0.0
|
16
|
+
hdrdir = $(topdir)
|
17
|
+
arch_hdrdir = /Users/leon.kielstra/.asdf/installs/ruby/3.0.3/include/ruby-3.0.0/x86_64-darwin20
|
18
|
+
PATH_SEPARATOR = :
|
19
|
+
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
20
|
+
prefix = $(DESTDIR)/Users/leon.kielstra/.asdf/installs/ruby/3.0.3
|
21
|
+
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
|
22
|
+
rubyarchprefix = $(rubylibprefix)/$(arch)
|
23
|
+
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
24
|
+
exec_prefix = $(prefix)
|
25
|
+
vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
|
26
|
+
sitearchhdrdir = $(sitehdrdir)/$(sitearch)
|
27
|
+
rubyarchhdrdir = $(rubyhdrdir)/$(arch)
|
28
|
+
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
29
|
+
sitehdrdir = $(rubyhdrdir)/site_ruby
|
30
|
+
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
|
31
|
+
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
32
|
+
vendorlibdir = $(vendordir)/$(ruby_version)
|
33
|
+
vendordir = $(rubylibprefix)/vendor_ruby
|
34
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
35
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
36
|
+
sitedir = $(rubylibprefix)/site_ruby
|
37
|
+
rubyarchdir = $(rubylibdir)/$(arch)
|
38
|
+
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
39
|
+
sitearchincludedir = $(includedir)/$(sitearch)
|
40
|
+
archincludedir = $(includedir)/$(arch)
|
41
|
+
sitearchlibdir = $(libdir)/$(sitearch)
|
42
|
+
archlibdir = $(libdir)/$(arch)
|
43
|
+
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
44
|
+
mandir = $(datarootdir)/man
|
45
|
+
localedir = $(datarootdir)/locale
|
46
|
+
libdir = $(exec_prefix)/lib
|
47
|
+
psdir = $(docdir)
|
48
|
+
pdfdir = $(docdir)
|
49
|
+
dvidir = $(docdir)
|
50
|
+
htmldir = $(docdir)
|
51
|
+
infodir = $(datarootdir)/info
|
52
|
+
docdir = $(datarootdir)/doc/$(PACKAGE)
|
53
|
+
oldincludedir = $(SDKROOT)/usr/include
|
54
|
+
includedir = $(prefix)/include
|
55
|
+
runstatedir = $(localstatedir)/run
|
56
|
+
localstatedir = $(prefix)/var
|
57
|
+
sharedstatedir = $(prefix)/com
|
58
|
+
sysconfdir = $(prefix)/etc
|
59
|
+
datadir = $(datarootdir)
|
60
|
+
datarootdir = $(prefix)/share
|
61
|
+
libexecdir = $(exec_prefix)/libexec
|
62
|
+
sbindir = $(exec_prefix)/sbin
|
63
|
+
bindir = $(exec_prefix)/bin
|
64
|
+
archdir = $(rubyarchdir)
|
65
|
+
|
66
|
+
|
67
|
+
CC_WRAPPER =
|
68
|
+
CC = clang -fdeclspec
|
69
|
+
CXX = clang++ -fdeclspec
|
70
|
+
LIBRUBY = $(LIBRUBY_SO)
|
71
|
+
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
72
|
+
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
|
73
|
+
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework Security -framework Foundation $(MAINLIBS)
|
74
|
+
empty =
|
75
|
+
OUTFLAG = -o $(empty)
|
76
|
+
COUTFLAG = -o $(empty)
|
77
|
+
CSRCFLAG = $(empty)
|
78
|
+
|
79
|
+
RUBY_EXTCONF_H =
|
80
|
+
cflags = $(optflags) $(debugflags) $(warnflags)
|
81
|
+
cxxflags =
|
82
|
+
optflags = -O3
|
83
|
+
debugflags = -ggdb3
|
84
|
+
warnflags = -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens
|
85
|
+
cppflags =
|
86
|
+
CCDLFLAGS = -fno-common
|
87
|
+
CFLAGS = $(CCDLFLAGS) $(cflags) -fno-common -pipe $(ARCH_FLAG)
|
88
|
+
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
89
|
+
DEFS =
|
90
|
+
CPPFLAGS = -I/Users/leon.kielstra/.asdf/installs/ruby/3.0.3/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
|
91
|
+
CXXFLAGS = $(CCDLFLAGS) $(ARCH_FLAG)
|
92
|
+
ldflags = -L. -L/Users/leon.kielstra/.asdf/installs/ruby/3.0.3/lib -fstack-protector-strong -L/usr/local/lib
|
93
|
+
dldflags = -L/Users/leon.kielstra/.asdf/installs/ruby/3.0.3/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress
|
94
|
+
ARCH_FLAG =
|
95
|
+
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
96
|
+
LDSHARED = $(CC) -dynamic -bundle
|
97
|
+
LDSHAREDXX = $(CXX) -dynamic -bundle
|
98
|
+
AR = ar
|
99
|
+
EXEEXT =
|
100
|
+
|
101
|
+
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
102
|
+
RUBY_SO_NAME = ruby.3.0
|
103
|
+
RUBYW_INSTALL_NAME =
|
104
|
+
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
|
105
|
+
RUBYW_BASE_NAME = rubyw
|
106
|
+
RUBY_BASE_NAME = ruby
|
107
|
+
|
108
|
+
arch = x86_64-darwin20
|
109
|
+
sitearch = $(arch)
|
110
|
+
ruby_version = 3.0.0
|
111
|
+
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
112
|
+
RUBY = $(ruby)
|
113
|
+
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
|
114
|
+
|
115
|
+
RM = rm -f
|
116
|
+
RM_RF = $(RUBY) -run -e rm -- -rf
|
117
|
+
RMDIRS = rmdir -p
|
118
|
+
MAKEDIRS = /usr/local/bin/gmkdir -p
|
119
|
+
INSTALL = /usr/local/bin/ginstall -c
|
120
|
+
INSTALL_PROG = $(INSTALL) -m 0755
|
121
|
+
INSTALL_DATA = $(INSTALL) -m 644
|
122
|
+
COPY = cp
|
123
|
+
TOUCH = exit >
|
124
|
+
|
125
|
+
#### End of system configuration section. ####
|
126
|
+
|
127
|
+
preload =
|
128
|
+
libpath = . $(libdir)
|
129
|
+
LIBPATH = -L. -L$(libdir)
|
130
|
+
DEFFILE =
|
131
|
+
|
132
|
+
CLEANFILES = mkmf.log
|
133
|
+
DISTCLEANFILES =
|
134
|
+
DISTCLEANDIRS =
|
135
|
+
|
136
|
+
extout =
|
137
|
+
extout_prefix =
|
138
|
+
target_prefix =
|
139
|
+
LOCAL_LIBS =
|
140
|
+
LIBS = $(LIBRUBYARG_SHARED)
|
141
|
+
ORIG_SRCS = quicksort_c.c
|
142
|
+
SRCS = $(ORIG_SRCS)
|
143
|
+
OBJS = quicksort_c.o
|
144
|
+
HDRS = $(srcdir)/quicksort_c.h
|
145
|
+
LOCAL_HDRS =
|
146
|
+
TARGET = quicksort_c
|
147
|
+
TARGET_NAME = quicksort_c
|
148
|
+
TARGET_ENTRY = Init_$(TARGET_NAME)
|
149
|
+
DLLIB = $(TARGET).bundle
|
150
|
+
EXTSTATIC =
|
151
|
+
STATIC_LIB =
|
152
|
+
|
153
|
+
TIMESTAMP_DIR = .
|
154
|
+
BINDIR = $(bindir)
|
155
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
156
|
+
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
157
|
+
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
158
|
+
HDRDIR = $(sitehdrdir)$(target_prefix)
|
159
|
+
ARCHHDRDIR = $(sitearchhdrdir)$(target_prefix)
|
160
|
+
TARGET_SO_DIR =
|
161
|
+
TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
|
162
|
+
CLEANLIBS = $(TARGET_SO)
|
163
|
+
CLEANOBJS = *.o *.bak
|
164
|
+
|
165
|
+
all: $(DLLIB)
|
166
|
+
static: $(STATIC_LIB)
|
167
|
+
.PHONY: all install static install-so install-rb
|
168
|
+
.PHONY: clean clean-so clean-static clean-rb
|
169
|
+
|
170
|
+
clean-static::
|
171
|
+
clean-rb-default::
|
172
|
+
clean-rb::
|
173
|
+
clean-so::
|
174
|
+
clean: clean-so clean-static clean-rb-default clean-rb
|
175
|
+
-$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
|
176
|
+
|
177
|
+
distclean-rb-default::
|
178
|
+
distclean-rb::
|
179
|
+
distclean-so::
|
180
|
+
distclean-static::
|
181
|
+
distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
|
182
|
+
-$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
183
|
+
-$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
184
|
+
-$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
|
185
|
+
|
186
|
+
realclean: distclean
|
187
|
+
install: install-so install-rb
|
188
|
+
|
189
|
+
install-so: $(DLLIB) $(TIMESTAMP_DIR)/.sitearchdir.time
|
190
|
+
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
191
|
+
clean-static::
|
192
|
+
-$(Q)$(RM) $(STATIC_LIB)
|
193
|
+
install-rb: pre-install-rb do-install-rb install-rb-default
|
194
|
+
install-rb-default: pre-install-rb-default do-install-rb-default
|
195
|
+
pre-install-rb: Makefile
|
196
|
+
pre-install-rb-default: Makefile
|
197
|
+
do-install-rb:
|
198
|
+
do-install-rb-default:
|
199
|
+
pre-install-rb-default:
|
200
|
+
@$(NULLCMD)
|
201
|
+
$(TIMESTAMP_DIR)/.sitearchdir.time:
|
202
|
+
$(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
|
203
|
+
$(Q) $(TOUCH) $@
|
204
|
+
|
205
|
+
site-install: site-install-so site-install-rb
|
206
|
+
site-install-so: install-so
|
207
|
+
site-install-rb: install-rb
|
208
|
+
|
209
|
+
.SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
|
210
|
+
|
211
|
+
.cc.o:
|
212
|
+
$(ECHO) compiling $(<)
|
213
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
214
|
+
|
215
|
+
.cc.S:
|
216
|
+
$(ECHO) translating $(<)
|
217
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
218
|
+
|
219
|
+
.mm.o:
|
220
|
+
$(ECHO) compiling $(<)
|
221
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
222
|
+
|
223
|
+
.mm.S:
|
224
|
+
$(ECHO) translating $(<)
|
225
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
226
|
+
|
227
|
+
.cxx.o:
|
228
|
+
$(ECHO) compiling $(<)
|
229
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
230
|
+
|
231
|
+
.cxx.S:
|
232
|
+
$(ECHO) translating $(<)
|
233
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
234
|
+
|
235
|
+
.cpp.o:
|
236
|
+
$(ECHO) compiling $(<)
|
237
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
238
|
+
|
239
|
+
.cpp.S:
|
240
|
+
$(ECHO) translating $(<)
|
241
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
242
|
+
|
243
|
+
.c.o:
|
244
|
+
$(ECHO) compiling $(<)
|
245
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
246
|
+
|
247
|
+
.c.S:
|
248
|
+
$(ECHO) translating $(<)
|
249
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
250
|
+
|
251
|
+
.m.o:
|
252
|
+
$(ECHO) compiling $(<)
|
253
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
254
|
+
|
255
|
+
.m.S:
|
256
|
+
$(ECHO) translating $(<)
|
257
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
258
|
+
|
259
|
+
$(TARGET_SO): $(OBJS) Makefile
|
260
|
+
$(ECHO) linking shared-object $(DLLIB)
|
261
|
+
-$(Q)$(RM) $(@)
|
262
|
+
$(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
263
|
+
$(Q) $(POSTLINK)
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
$(OBJS): $(HDRS) $(ruby_headers)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#include "ruby.h"
|
2
|
+
#include "quicksort_c_impl.h"
|
3
|
+
|
4
|
+
VALUE QUICKSORT_C_MODULE = Qnil;
|
5
|
+
|
6
|
+
void Init_quicksort_c_impl() {
|
7
|
+
// Module definition
|
8
|
+
QUICKSORT_C_MODULE = rb_define_module("QuicksortCImpl");
|
9
|
+
|
10
|
+
// Function definitions
|
11
|
+
rb_define_module_function(QUICKSORT_C_MODULE, "sort", rb_quicksort, 1);
|
12
|
+
}
|
13
|
+
|
14
|
+
VALUE rb_quicksort(VALUE klass, VALUE r_array) {
|
15
|
+
return rb_ary_to_s(r_array);
|
16
|
+
}
|
data/lib/quicksort_c.rb
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: quicksort_c
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Leon Kielstra
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-02-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '13.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '13.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake-compiler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: This gem introduces a quicksort implementation in C. It also introduces
|
42
|
+
a reference implementation in Ruby. Just for some benchmarking fun.
|
43
|
+
email:
|
44
|
+
- leonkielstra@gmail.com
|
45
|
+
executables: []
|
46
|
+
extensions:
|
47
|
+
- ext/quicksort_c_impl/extconf.rb
|
48
|
+
extra_rdoc_files: []
|
49
|
+
files:
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- ext/quicksort_c_impl/Makefile
|
54
|
+
- ext/quicksort_c_impl/extconf.rb
|
55
|
+
- ext/quicksort_c_impl/quicksort_c_impl.c
|
56
|
+
- ext/quicksort_c_impl/quicksort_c_impl.h
|
57
|
+
- lib/quicksort_c.rb
|
58
|
+
- lib/quicksort_c/version.rb
|
59
|
+
- lib/quicksort_c_impl/quicksort_c_impl.bundle
|
60
|
+
homepage: https://github.com/leonkielstra/quicksort_c#readme
|
61
|
+
licenses:
|
62
|
+
- MIT
|
63
|
+
metadata:
|
64
|
+
allowed_push_host: https://rubygems.org
|
65
|
+
homepage_uri: https://github.com/leonkielstra/quicksort_c#readme
|
66
|
+
source_code_uri: https://github.com/leonkielstra/quicksort_c
|
67
|
+
changelog_uri: https://github.com/leonkielstra/haps/blob/0.0.1/CHANGELOG.md
|
68
|
+
post_install_message:
|
69
|
+
rdoc_options: []
|
70
|
+
require_paths:
|
71
|
+
- lib
|
72
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 3.0.0
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
requirements: []
|
83
|
+
rubygems_version: 3.2.32
|
84
|
+
signing_key:
|
85
|
+
specification_version: 4
|
86
|
+
summary: This gem introduces a quicksort implementation in C.
|
87
|
+
test_files: []
|