Commit Graph

407 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 1bba236cb2 Merge pull request #1812 from cremno/time-3
mruby-time: add gettimeofday(2) for Windows
2014-03-06 01:43:06 +09:00
cremno 890ef11fde mruby-time: add gettimeofday(2) for Windows 2014-03-05 17:13:13 +01:00
cremno 69b231ece5 mruby-time: fix indentation in mrb_time_asctime 2014-03-05 17:08:51 +01:00
cremno 96d3bc2811 mruby-time: store timezone name directly 2014-03-05 17:08:51 +01:00
cremno 9b3033bb53 mruby-time: timezone_names should be const 2014-03-05 17:08:50 +01:00
cremno e34b69f582 mruby-time: store strings directly instead of pointers to them 2014-03-05 17:08:44 +01:00
cremno 333840ba61 mruby-time: mrb_time_type should be const 2014-03-05 16:53:42 +01:00
cremno f9c88e9c68 mruby-time: fix two tiny typos in comments 2014-03-05 16:53:41 +01:00
cremno c088797107 mruby-time: rearrange header order 2014-03-05 16:53:41 +01:00
cremno bf48f5ec87 mruby-time: remove trailing whitespace 2014-03-05 16:53:40 +01:00
takkaw d7d8b09580 small refactor 2014-03-05 23:35:34 +09:00
Yukihiro "Matz" Matsumoto adc5b56c15 use mrb_int instead of size_t since string length is represented by mrb_int; close #1810 2014-03-05 21:51:44 +09:00
Yukihiro "Matz" Matsumoto 640efb3015 Merge pull request #1808 from cubicdaiya/issues/unused_variable
remove unused variable
2014-03-05 17:44:12 +09:00
Yukihiro "Matz" Matsumoto 1c4d58b882 Merge pull request #1807 from tmash06/fix_exit_status_code
fix mruby command returning EXIT_SUCCESS when program file can't be opened.
2014-03-05 17:26:25 +09:00
cubicdaiya 80d8170959 remove unused variable
GLOBAL_RAND_SEED_KEY is no longer used.
2014-03-05 17:19:26 +09:00
Tatsuya Matsumoto 43944a0d3a fix mruby command returning EXIT_SUCCESS when program file can't be
opened.
2014-03-05 16:51:57 +09:00
Tatsuya Matsumoto 2d5a7371bc fix argument spec setting of Kernel.exit method.
this method requires 1 optional argument.
2014-03-05 15:54:03 +09:00
Yukihiro "Matz" Matsumoto d03c72ad53 Merge branch 'master' of github.com:mruby/mruby 2014-03-05 15:38:27 +09:00
Yukihiro "Matz" Matsumoto 865b850b76 should check crossing C boudary from resume 2014-03-05 15:38:13 +09:00
mattn 7510d9adee s/\\"/"/g in mruby-config 2014-03-05 13:50:14 +09:00
Yukihiro "Matz" Matsumoto f911b23599 Merge pull request #1801 from mattn/mruby-config
Add mruby-bin-mruby-config
2014-03-05 13:18:39 +09:00
mattn 67b8f6ec60 Don't echo empty string. (Remove workaround for windows) 2014-03-05 12:56:27 +09:00
mattn 48616a85af chmod 755 2014-03-05 12:51:15 +09:00
Tatsuya Matsumoto 23cb0bb64b mruby command should not execute program on "syntax only option(-c)". 2014-03-05 12:49:58 +09:00
mattn fb621ef411 Add mruby-bin-mruby-config 2014-03-05 12:46:07 +09:00
mattn d59b738b43 Fix #1793 2014-03-04 22:25:25 +09:00
Tomoyuki Sahara 4ad0896bda add Integer#div and Float#div. 2014-03-04 12:45:11 +09:00
take_cheeze 24e3e33cb6 use tempfile module 2014-03-03 17:01:47 +09:00
take_cheeze fa5c3d4f51 add test to check striped binary works correctly 2014-03-03 16:58:27 +09:00
Tatsuya Matsumoto d496ba7e25 fix a memory leak in mruby-random. 2014-03-02 22:18:02 +09:00
cubicdaiya 67de10bfcb use C style comments instead of C++ style comments
According to CONTRIBUTING.md,

Don't use C++ style comments

 /* This is the prefered comment style */

Use C++ style comments only for temporary comment e.g. commenting out some code lines.
2014-03-01 03:31:45 +09:00
Yukihiro "Matz" Matsumoto 2c7204fc93 mrb_fiber_yield() is available now; you have to link mruby-fiber mrbgem to use the function; there's no function available to create new fiber from C (countapart of Lua's lua_newthread), but that's because you cannot create a new fiber from C due to mruby C API design limitation. define your method to create fibers in Ruby; close #1269 2014-03-01 00:48:08 +09:00
Yukihiro "Matz" Matsumoto 1f134d723c cancel 313f6b; add fallthrough comment 2014-02-28 18:55:30 +09:00
Yukihiro "Matz" Matsumoto cb7f82ac45 Merge pull request #1756 from chasonr/sprintf-utf8
Implement sprintf("%c") for UTF-8.
2014-02-28 18:45:31 +09:00
chasonr d60944ef3a Test for UTF-8 as mattn suggests.
The string is "Hello world" in Japanese.  (hat tip:  Google Translate.)
2014-02-27 23:42:07 -05:00
take_cheeze 1266ab6500 add mruby-strip tool to strip irep's debug info 2014-02-28 00:36:08 +09:00
chasonr b752b01a56 Update the Fixnum#chr test for UTF-8. 2014-02-26 20:53:23 -05:00
chasonr 5e5ee841a1 Implement sprintf("%c") for UTF-8.
* sprintf("%c") is changed to accept a string for which String#size returns
  1, even if it is longer than one byte, and to convert a Fixnum via
  Fixnum#chr (possibly returning more than one byte).  Thus, if the UTF-8
  gem is in use, a character will be understood as a single UTF-8 character.

* The change to sprintf depends on the implementation of Fixnum#chr added
  to mrbgems/mruby-string-utf8/src/string.c.

This should work with any other gem that implements a multibyte encoding, as
long as it implements String#size and Fixnum#chr as appropriate.
2014-02-26 20:18:26 -05:00
Yukihiro "Matz" Matsumoto 313f6b5997 forget to break in the switch statement 2014-02-27 08:23:32 +09:00
Yukihiro "Matz" Matsumoto c93f873ac0 Merge pull request #1744 from cubicdaiya/feature/introduce_mrb_str_cat_lit
Introduce mrb_str_cat_lit
2014-02-26 21:54:05 +09:00
cubicdaiya a860735d0c use mrb_str_cat_lit() more widely 2014-02-26 03:03:47 +09:00
cubicdaiya 94c5a5ee73 use mrb_str_new_lit instead of mrb_str_new for C string literals 2014-02-26 02:23:50 +09:00
Yukihiro "Matz" Matsumoto feeaea8dcd Merge pull request #1737 from chasonr/Random-static-data
Implement default Random instance.
2014-02-25 19:16:01 +09:00
cubicdaiya 96c24b0a37 small-optimization2 for mrb_time_zone
mrb_str_new_static is more efficient than mrb_str_new in this case.
2014-02-25 15:24:02 +09:00
cubicdaiya 985e4892cf small-optimization for mrb_time_zone
Using mrb_str_new instead of mrb_str_new_cstr
2014-02-25 15:03:35 +09:00
chasonr 7c9ff7c8ff Implement default Random instance.
Previously, the default random number generator was implemented using static
storage.  This storage is common to all instances of mruby in a process, and
use of the default random number generator in one instance will perturb the
default random number generator in other instances.  It is also not thread
safe.

With this change, the default random number generator is defined as
Random::DEFAULT, as it is in CRuby.
2014-02-25 00:06:31 -05:00
Yukihiro "Matz" Matsumoto ddf9504558 Merge pull request #1721 from take-cheeze/d_format_spec
add 'd' format specifier in mrb_get_args and mruby-random gem improvement
2014-02-25 00:22:27 +09:00
kyab 1cf619d3b4 Fix unused function warning when readline enabled (mirb) 2014-02-23 20:43:43 +09:00
take_cheeze 658b4f4ea7 add test(requires MRB_GC_FIXED_ARENA enabled) 2014-02-22 00:28:38 +09:00
take_cheeze a9af8c9c07 fix possible arena overflow 2014-02-22 00:05:05 +09:00