diff options
29 files changed, 45 insertions, 37 deletions
diff --git a/doc/mrbgems/README.md b/doc/mrbgems/README.md index 1062adc6b..07f7002fb 100644 --- a/doc/mrbgems/README.md +++ b/doc/mrbgems/README.md @@ -99,7 +99,7 @@ GEM directory. A typical GEM specification could look like this for example: MRuby::Gem::Specification.new('c_and_ruby_extension_example') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end The mrbgems build process will use this specification to compile Object and Ruby @@ -124,7 +124,7 @@ In case your GEM is depending on other GEMs please use MRuby::Gem::Specification.new('c_and_ruby_extension_example') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' # add GEM dependency mruby-parser. # Version has to be between 1.0.0 and 1.5.2 diff --git a/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake b/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake index 35dbe5e18..a1f964b36 100644 --- a/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake +++ b/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake @@ -1,6 +1,6 @@ MRuby::Gem::Specification.new('c_and_ruby_extension_example') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' # Add compile flags # spec.cc.flags << '' diff --git a/examples/mrbgems/c_extension_example/mrbgem.rake b/examples/mrbgems/c_extension_example/mrbgem.rake index 8c132b233..3524e22f4 100644 --- a/examples/mrbgems/c_extension_example/mrbgem.rake +++ b/examples/mrbgems/c_extension_example/mrbgem.rake @@ -1,6 +1,6 @@ MRuby::Gem::Specification.new('c_extension_example') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' # Add compile flags # spec.cc.flags << '-g' diff --git a/examples/mrbgems/ruby_extension_example/mrbgem.rake b/examples/mrbgems/ruby_extension_example/mrbgem.rake index 3a80b5cd7..5624c33e9 100644 --- a/examples/mrbgems/ruby_extension_example/mrbgem.rake +++ b/examples/mrbgems/ruby_extension_example/mrbgem.rake @@ -1,6 +1,6 @@ MRuby::Gem::Specification.new('ruby_extension_example') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' # Add compile flags # spec.cc.flags << '' diff --git a/mrbgems/mruby-array-ext/mrbgem.rake b/mrbgems/mruby-array-ext/mrbgem.rake index 38e0ad267..18f92ad65 100644 --- a/mrbgems/mruby-array-ext/mrbgem.rake +++ b/mrbgems/mruby-array-ext/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-array-ext') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-bin-mirb/mrbgem.rake b/mrbgems/mruby-bin-mirb/mrbgem.rake index fd0b20254..846a3b077 100644 --- a/mrbgems/mruby-bin-mirb/mrbgem.rake +++ b/mrbgems/mruby-bin-mirb/mrbgem.rake @@ -1,5 +1,8 @@ MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' + + spec.linker.libraries << 'readline' if spec.cc.defines.include? "ENABLE_READLINE" + spec.bins = %w(mirb) end diff --git a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c index e9bbb5420..50556e092 100644 --- a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +++ b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c @@ -244,6 +244,8 @@ main(int argc, char **argv) #ifndef ENABLE_READLINE int last_char; int char_index; +#else + char *home = NULL; #endif mrbc_context *cxt; struct mrb_parser_state *parser; @@ -253,7 +255,6 @@ main(int argc, char **argv) int n; int code_block_open = FALSE; int ai; - char *home = NULL; /* new interpreter instance */ mrb = mrb_open(); diff --git a/mrbgems/mruby-bin-mruby/mrbgem.rake b/mrbgems/mruby-bin-mruby/mrbgem.rake index 2e173a291..08ba89855 100644 --- a/mrbgems/mruby-bin-mruby/mrbgem.rake +++ b/mrbgems/mruby-bin-mruby/mrbgem.rake @@ -1,5 +1,5 @@ MRuby::Gem::Specification.new('mruby-bin-mruby') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' spec.bins = %w(mruby) end diff --git a/mrbgems/mruby-enum-ext/mrbgem.rake b/mrbgems/mruby-enum-ext/mrbgem.rake index 758d298dc..e054f4318 100644 --- a/mrbgems/mruby-enum-ext/mrbgem.rake +++ b/mrbgems/mruby-enum-ext/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-enum-ext') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-eval/mrbgem.rake b/mrbgems/mruby-eval/mrbgem.rake index f80cf1b9e..217a9e604 100644 --- a/mrbgems/mruby-eval/mrbgem.rake +++ b/mrbgems/mruby-eval/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-eval') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-fiber/mrbgem.rake b/mrbgems/mruby-fiber/mrbgem.rake index cb258adcb..25009c47f 100644 --- a/mrbgems/mruby-fiber/mrbgem.rake +++ b/mrbgems/mruby-fiber/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-fiber') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-hash-ext/mrbgem.rake b/mrbgems/mruby-hash-ext/mrbgem.rake index 3163c8c88..25d4f8e61 100644 --- a/mrbgems/mruby-hash-ext/mrbgem.rake +++ b/mrbgems/mruby-hash-ext/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-hash-ext') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-math/mrbgem.rake b/mrbgems/mruby-math/mrbgem.rake index 4b0fa40fd..75d3d1fff 100644 --- a/mrbgems/mruby-math/mrbgem.rake +++ b/mrbgems/mruby-math/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-math') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-numeric-ext/mrbgem.rake b/mrbgems/mruby-numeric-ext/mrbgem.rake index 69c4fde4c..010804058 100644 --- a/mrbgems/mruby-numeric-ext/mrbgem.rake +++ b/mrbgems/mruby-numeric-ext/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-numeric-ext') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-object-ext/mrbgem.rake b/mrbgems/mruby-object-ext/mrbgem.rake index 1f232949e..980f1667a 100644 --- a/mrbgems/mruby-object-ext/mrbgem.rake +++ b/mrbgems/mruby-object-ext/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-object-ext') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-objectspace/mrbgem.rake b/mrbgems/mruby-objectspace/mrbgem.rake index 100df4cdc..6a6a3e778 100644 --- a/mrbgems/mruby-objectspace/mrbgem.rake +++ b/mrbgems/mruby-objectspace/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-objectspace') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-print/mrbgem.rake b/mrbgems/mruby-print/mrbgem.rake index dc7831280..768fc2e18 100644 --- a/mrbgems/mruby-print/mrbgem.rake +++ b/mrbgems/mruby-print/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-print') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-proc-ext/mrbgem.rake b/mrbgems/mruby-proc-ext/mrbgem.rake index 7f979431d..b75fceda3 100644 --- a/mrbgems/mruby-proc-ext/mrbgem.rake +++ b/mrbgems/mruby-proc-ext/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-proc-ext') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-random/mrbgem.rake b/mrbgems/mruby-random/mrbgem.rake index 38e93e4b1..7ad3c855c 100644 --- a/mrbgems/mruby-random/mrbgem.rake +++ b/mrbgems/mruby-random/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-random') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-range-ext/mrbgem.rake b/mrbgems/mruby-range-ext/mrbgem.rake index 5ed521a44..a7970aa51 100644 --- a/mrbgems/mruby-range-ext/mrbgem.rake +++ b/mrbgems/mruby-range-ext/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-range-ext') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-sprintf/mrbgem.rake b/mrbgems/mruby-sprintf/mrbgem.rake index 8772a5174..3e15ee7a9 100644 --- a/mrbgems/mruby-sprintf/mrbgem.rake +++ b/mrbgems/mruby-sprintf/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-sprintf') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-string-ext/mrbgem.rake b/mrbgems/mruby-string-ext/mrbgem.rake index 83db97eb4..4a3369998 100644 --- a/mrbgems/mruby-string-ext/mrbgem.rake +++ b/mrbgems/mruby-string-ext/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-string-ext') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-struct/mrbgem.rake b/mrbgems/mruby-struct/mrbgem.rake index 476e990da..3e9eab8d7 100644 --- a/mrbgems/mruby-struct/mrbgem.rake +++ b/mrbgems/mruby-struct/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-struct') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-symbol-ext/mrbgem.rake b/mrbgems/mruby-symbol-ext/mrbgem.rake index 8e40c743b..6294e7a46 100644 --- a/mrbgems/mruby-symbol-ext/mrbgem.rake +++ b/mrbgems/mruby-symbol-ext/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-symbol-ext') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-time/mrbgem.rake b/mrbgems/mruby-time/mrbgem.rake index 0f0b4899d..edf2aa3fc 100644 --- a/mrbgems/mruby-time/mrbgem.rake +++ b/mrbgems/mruby-time/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-time') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrbgems/mruby-toplevel-ext/mrbgem.rake b/mrbgems/mruby-toplevel-ext/mrbgem.rake index 457047e8d..78eb73a26 100644 --- a/mrbgems/mruby-toplevel-ext/mrbgem.rake +++ b/mrbgems/mruby-toplevel-ext/mrbgem.rake @@ -1,4 +1,4 @@ MRuby::Gem::Specification.new('mruby-toplevel-ext') do |spec| spec.license = 'MIT' - spec.authors = 'mruby developers' + spec.author = 'mruby developers' end diff --git a/mrblib/string.rb b/mrblib/string.rb index 131d30446..49f87be8b 100644 --- a/mrblib/string.rb +++ b/mrblib/string.rb @@ -133,6 +133,18 @@ class String a = self[pos+1..-1] self.replace([b, value, a].join('')) end + + ## + # ISO 15.2.10.5.5 + def =~(re) + re =~ self + end + + ## + # ISO 15.2.10.5.27 + def match(re, &block) + re.match(self, &block) + end end ## diff --git a/src/string.c b/src/string.c index 975f6cdb9..0c142958c 100644 --- a/src/string.c +++ b/src/string.c @@ -2534,7 +2534,6 @@ mrb_init_string(mrb_state *mrb) mrb_define_method(mrb, s, "*", mrb_str_times, MRB_ARGS_REQ(1)); /* 15.2.10.5.1 */ mrb_define_method(mrb, s, "<=>", mrb_str_cmp_m, MRB_ARGS_REQ(1)); /* 15.2.10.5.3 */ mrb_define_method(mrb, s, "==", mrb_str_equal_m, MRB_ARGS_REQ(1)); /* 15.2.10.5.4 */ - mrb_define_method(mrb, s, "=~", noregexp, MRB_ARGS_REQ(1)); /* 15.2.10.5.5 */ mrb_define_method(mrb, s, "[]", mrb_str_aref_m, MRB_ARGS_ANY()); /* 15.2.10.5.6 */ mrb_define_method(mrb, s, "capitalize", mrb_str_capitalize, MRB_ARGS_NONE()); /* 15.2.10.5.7 */ mrb_define_method(mrb, s, "capitalize!", mrb_str_capitalize_bang, MRB_ARGS_REQ(1)); /* 15.2.10.5.8 */ @@ -2547,26 +2546,18 @@ mrb_init_string(mrb_state *mrb) mrb_define_method(mrb, s, "empty?", mrb_str_empty_p, MRB_ARGS_NONE()); /* 15.2.10.5.16 */ mrb_define_method(mrb, s, "eql?", mrb_str_eql, MRB_ARGS_REQ(1)); /* 15.2.10.5.17 */ - // NOTE: Regexp not implemented - mrb_define_method(mrb, s, "gsub", noregexp, MRB_ARGS_REQ(1)); /* 15.2.10.5.18 */ - mrb_define_method(mrb, s, "gsub!", noregexp, MRB_ARGS_REQ(1)); /* 15.2.10.5.19 */ - mrb_define_method(mrb, s, "hash", mrb_str_hash_m, MRB_ARGS_REQ(1)); /* 15.2.10.5.20 */ mrb_define_method(mrb, s, "include?", mrb_str_include, MRB_ARGS_REQ(1)); /* 15.2.10.5.21 */ mrb_define_method(mrb, s, "index", mrb_str_index_m, MRB_ARGS_ANY()); /* 15.2.10.5.22 */ mrb_define_method(mrb, s, "initialize", mrb_str_init, MRB_ARGS_REQ(1)); /* 15.2.10.5.23 */ mrb_define_method(mrb, s, "initialize_copy", mrb_str_replace, MRB_ARGS_REQ(1)); /* 15.2.10.5.24 */ mrb_define_method(mrb, s, "intern", mrb_str_intern, MRB_ARGS_NONE()); /* 15.2.10.5.25 */ - mrb_define_method(mrb, s, "match", noregexp, MRB_ARGS_REQ(1)); /* 15.2.10.5.27 */ mrb_define_method(mrb, s, "replace", mrb_str_replace, MRB_ARGS_REQ(1)); /* 15.2.10.5.28 */ mrb_define_method(mrb, s, "reverse", mrb_str_reverse, MRB_ARGS_NONE()); /* 15.2.10.5.29 */ mrb_define_method(mrb, s, "reverse!", mrb_str_reverse_bang, MRB_ARGS_NONE()); /* 15.2.10.5.30 */ mrb_define_method(mrb, s, "rindex", mrb_str_rindex_m, MRB_ARGS_ANY()); /* 15.2.10.5.31 */ - mrb_define_method(mrb, s, "scan", noregexp, MRB_ARGS_REQ(1)); /* 15.2.10.5.32 */ mrb_define_method(mrb, s, "slice", mrb_str_aref_m, MRB_ARGS_ANY()); /* 15.2.10.5.34 */ mrb_define_method(mrb, s, "split", mrb_str_split_m, MRB_ARGS_ANY()); /* 15.2.10.5.35 */ - mrb_define_method(mrb, s, "sub", noregexp, MRB_ARGS_REQ(1)); /* 15.2.10.5.36 */ - mrb_define_method(mrb, s, "sub!", noregexp, MRB_ARGS_REQ(1)); /* 15.2.10.5.37 */ mrb_define_method(mrb, s, "to_i", mrb_str_to_i, MRB_ARGS_ANY()); /* 15.2.10.5.38 */ mrb_define_method(mrb, s, "to_f", mrb_str_to_f, MRB_ARGS_NONE()); /* 15.2.10.5.39 */ diff --git a/tasks/mrbgems.rake b/tasks/mrbgems.rake index 5f156c45a..d8f56f88e 100644 --- a/tasks/mrbgems.rake +++ b/tasks/mrbgems.rake @@ -74,9 +74,10 @@ please check the following additional licenses too: GEMS_LEGAL gems.map do |g| + authors = [g.authors].flatten.sort.join(", ") f.puts f.puts "GEM: #{g.name}" - f.puts "Copyright (c) #{Time.now.year} #{g.authors}" + f.puts "Copyright (c) #{Time.now.year} #{authors}" f.puts "License: #{g.licenses}" end end |
