ruby: MessagePack::VERSION constant

This commit is contained in:
frsyuki 2010-06-29 15:12:52 +09:00
parent 34a29cd0a5
commit 123ae024c6
6 changed files with 15 additions and 4 deletions

View File

@ -1,4 +1,5 @@
require 'mkmf'
$CFLAGS << " -I.. -Wall -O4"
require './version.rb'
$CFLAGS << %[ -I.. -Wall -O4 -DMESSAGEPACK_VERSION=\\"#{MessagePack::VERSION}\\"]
create_makefile('msgpack')

View File

@ -1,7 +1,8 @@
require './version.rb'
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = "msgpack"
s.version = "0.4.2"
s.version = MessagePack::VERSION
s.summary = "MessagePack, a binary-based efficient data interchange format."
s.author = "FURUHASHI Sadayuki"
s.email = "frsyuki@users.sourceforge.jp"

View File

@ -43,7 +43,9 @@ static VALUE mMessagePack;
void Init_msgpack(void)
{
mMessagePack = rb_define_module("MessagePack");
rb_define_const(mMessagePack, "VERSION", rb_str_new2(MESSAGEPACK_VERSION));
Init_msgpack_unpack(mMessagePack);
Init_msgpack_pack(mMessagePack);
}

View File

@ -5,4 +5,4 @@ rescue LoadError
require File.dirname(__FILE__) + '/../lib/msgpack'
end
GC.stress = true
#GC.stress = true

View File

@ -276,6 +276,10 @@ class MessagePackTestPackUnpack < Test::Unit::TestCase
assert_equal(parsed, num)
end
it "MessagePack::VERSION constant" do
p MessagePack::VERSION
end
private
def check(len, obj)
v = obj.to_msgpack

3
ruby/version.rb Normal file
View File

@ -0,0 +1,3 @@
module MessagePack
VERSION = "0.4.3"
end