зеркало из https://github.com/github/memcached.git
ext: rename the native extension to `memcached`
The old `memcached_rb` name was not really descriptive. We can name the native extension with the same name as the Gem and require it explicitly in our initialization
This commit is contained in:
Родитель
4fff883508
Коммит
094d2904e7
2
Rakefile
2
Rakefile
|
@ -3,7 +3,7 @@ require 'rake/testtask'
|
|||
require 'rake/extensiontask'
|
||||
|
||||
spec = Gem::Specification.load('memcached.gemspec')
|
||||
Rake::ExtensionTask.new('memcached_rb', spec) do |ext|
|
||||
Rake::ExtensionTask.new('memcached', spec) do |ext|
|
||||
ext.lib_dir = 'lib'
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "memcached_rb.h"
|
||||
#include "memcached.h"
|
||||
|
||||
const char *MEMCACHED_BEHAVIOR_NAMES[] = {
|
||||
static const char *MEMCACHED_BEHAVIOR_NAMES[] = {
|
||||
"MEMCACHED_BEHAVIOR_NO_BLOCK",
|
||||
"MEMCACHED_BEHAVIOR_TCP_NODELAY",
|
||||
"MEMCACHED_BEHAVIOR_HASH",
|
||||
|
@ -43,7 +43,7 @@ const char *MEMCACHED_BEHAVIOR_NAMES[] = {
|
|||
};
|
||||
#define MEMCACHED_BEHAVIORS_COUNT (ARRAY_SIZE(MEMCACHED_BEHAVIOR_NAMES))
|
||||
|
||||
const char* MEMCACHED_HASH_NAMES[] = {
|
||||
static const char* MEMCACHED_HASH_NAMES[] = {
|
||||
"MEMCACHED_HASH_DEFAULT",
|
||||
"MEMCACHED_HASH_MD5",
|
||||
"MEMCACHED_HASH_CRC",
|
||||
|
@ -60,7 +60,7 @@ const char* MEMCACHED_HASH_NAMES[] = {
|
|||
};
|
||||
#define MEMCACHED_HASH_COUNT (ARRAY_SIZE(MEMCACHED_HASH_NAMES))
|
||||
|
||||
const char* MEMCACHED_DISTRIBUTION_NAMES[] = {
|
||||
static const char* MEMCACHED_DISTRIBUTION_NAMES[] = {
|
||||
"MEMCACHED_DISTRIBUTION_MODULA",
|
||||
"MEMCACHED_DISTRIBUTION_CONSISTENT",
|
||||
"MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA",
|
||||
|
@ -133,7 +133,7 @@ rb_connection_set_behavior(VALUE self, VALUE rb_behavior, VALUE rb_value)
|
|||
}
|
||||
|
||||
void
|
||||
Init_memcached_rb_behavior(void)
|
||||
Init_memcached_behavior(void)
|
||||
{
|
||||
size_t i;
|
||||
VALUE rb_mBehaviors = rb_define_module_under(rb_mMemcached, "Behaviors");
|
|
@ -69,4 +69,4 @@ unless have_library 'memcached' and have_header 'libmemcached/memcached.h'
|
|||
abort "ERROR: Failed to build libmemcached"
|
||||
end
|
||||
|
||||
create_makefile 'memcached_rb'
|
||||
create_makefile 'memcached'
|
|
@ -1,4 +1,4 @@
|
|||
#include "memcached_rb.h"
|
||||
#include "memcached.h"
|
||||
|
||||
VALUE rb_mMemcached;
|
||||
|
||||
|
@ -484,7 +484,7 @@ rb_connection_close(VALUE self)
|
|||
return Qnil;
|
||||
}
|
||||
|
||||
void Init_memcached_rb(void)
|
||||
void Init_memcached(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
|
@ -528,5 +528,5 @@ void Init_memcached_rb(void)
|
|||
id_tcp = rb_intern("tcp");
|
||||
id_socket = rb_intern("socket");
|
||||
|
||||
Init_memcached_rb_behavior();
|
||||
Init_memcached_behavior();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef _RUBY_MEMCACHED_RB
|
||||
#define _RUBY_MEMCACHED_RB
|
||||
#ifndef _RUBY_MEMCACHED_H
|
||||
#define _RUBY_MEMCACHED_H
|
||||
|
||||
#include <ruby.h>
|
||||
#include <libmemcached/memcached.h>
|
||||
|
@ -10,7 +10,7 @@
|
|||
extern VALUE rb_mMemcached;
|
||||
void rb_memcached_error_check(memcached_return_t rc);
|
||||
|
||||
void Init_memcached_rb_behavior(void);
|
||||
void Init_memcached_behavior(void);
|
||||
VALUE rb_connection_get_behavior(VALUE self, VALUE rb_behavior);
|
||||
VALUE rb_connection_set_behavior(VALUE self, VALUE rb_behavior, VALUE rb_value);
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
require 'memcached/server'
|
||||
require 'memcached_rb'
|
||||
require 'memcached.so'
|
||||
require 'memcached/client'
|
||||
|
|
|
@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|||
s.files = `git ls-files`.split("\n")
|
||||
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
||||
s.require_paths = ["lib", "ext"]
|
||||
s.extensions = ["ext/memcached_rb/extconf.rb"]
|
||||
s.extensions = ["ext/memcached/extconf.rb"]
|
||||
|
||||
s.licenses = ["Academic Free License 3.0 (AFL-3.0)"]
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче