From b58e6b91461c244f94a259a0c843565ea0e92e26 Mon Sep 17 00:00:00 2001 From: Masaki Muranaka Date: Sun, 2 Mar 2014 12:07:15 +0900 Subject: Add ssh protocol support for bitbucket. --- tasks/mruby_build_gem.rake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasks/mruby_build_gem.rake b/tasks/mruby_build_gem.rake index c9bf794e3..5e4566f8d 100644 --- a/tasks/mruby_build_gem.rake +++ b/tasks/mruby_build_gem.rake @@ -43,7 +43,11 @@ module MRuby if params[:github] params[:git] = "https://github.com/#{params[:github]}.git" elsif params[:bitbucket] - params[:git] = "https://bitbucket.org/#{params[:bitbucket]}.git" + if params[:method] == "ssh" + params[:git] = "git@bitbucket.org:#{params[:bitbucket]}.git" + else + params[:git] = "https://bitbucket.org/#{params[:bitbucket]}.git" + end end if params[:core] -- cgit v1.2.3 From 8d6ce6bacea5cba18d6b2b6d5cbe581ad0f7e306 Mon Sep 17 00:00:00 2001 From: Akira Kuroda Date: Sun, 2 Mar 2014 12:19:57 +0900 Subject: add tests for String#* add test cases for 0 and -1 --- test/t/string.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/t/string.rb b/test/t/string.rb index 3219f98c3..2ebaad1b7 100644 --- a/test/t/string.rb +++ b/test/t/string.rb @@ -36,6 +36,10 @@ end assert('String#*', '15.2.10.5.5') do assert_equal 'aaaaa', 'a' * 5 + assert_equal '', 'a' * 0 + assert_raise(ArgumentError) do + 'a' * -1 + end end assert('String#[]', '15.2.10.5.6') do -- cgit v1.2.3 From d496ba7e25e4bf16f1be3185364feba3bcc39300 Mon Sep 17 00:00:00 2001 From: Tatsuya Matsumoto Date: Sun, 2 Mar 2014 22:18:02 +0900 Subject: fix a memory leak in mruby-random. --- mrbgems/mruby-random/src/random.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mrbgems/mruby-random/src/random.c b/mrbgems/mruby-random/src/random.c index a708923d3..9fb5bbfd8 100644 --- a/mrbgems/mruby-random/src/random.c +++ b/mrbgems/mruby-random/src/random.c @@ -115,15 +115,15 @@ mrb_random_init(mrb_state *mrb, mrb_value self) mrb_value seed; mt_state *t; - DATA_TYPE(self) = &mt_state_type; - DATA_PTR(self) = NULL; - /* avoid memory leaks */ t = (mt_state*)DATA_PTR(self); if (t) { mrb_free(mrb, t); } + DATA_TYPE(self) = &mt_state_type; + DATA_PTR(self) = NULL; + t = (mt_state *)mrb_malloc(mrb, sizeof(mt_state)); t->mti = N + 1; -- cgit v1.2.3 From 71319ac3350344d945567d2f3ae4b43266f6b857 Mon Sep 17 00:00:00 2001 From: Tatsuya Matsumoto Date: Mon, 3 Mar 2014 00:46:39 +0900 Subject: fix include guard style. --- include/mruby/compile.h | 2 +- include/mruby/data.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mruby/compile.h b/include/mruby/compile.h index c22f8079a..4f9c49191 100644 --- a/include/mruby/compile.h +++ b/include/mruby/compile.h @@ -5,7 +5,7 @@ */ #ifndef MRUBY_COMPILE_H -#define MRUBY_COMPILE_H 1 +#define MRUBY_COMPILE_H #if defined(__cplusplus) extern "C" { diff --git a/include/mruby/data.h b/include/mruby/data.h index f0420a0c6..8b1b5edb7 100644 --- a/include/mruby/data.h +++ b/include/mruby/data.h @@ -5,7 +5,7 @@ */ #ifndef MRUBY_DATA_H -#define MRUBY_DATA_H 1 +#define MRUBY_DATA_H #if defined(__cplusplus) extern "C" { -- cgit v1.2.3