From 91275eb478ceb58083426099b6da3f4c7e189f19 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 04:50:01 +0200 Subject: Merging debian version 1.9.4-1. Signed-off-by: Daniel Baumann --- .../mruby/mrbgems/mruby-symbol-ext/mrbgem.rake | 5 -- .../mrbgems/mruby-symbol-ext/mrblib/symbol.rb | 65 ---------------------- .../mruby/mrbgems/mruby-symbol-ext/src/symbol.c | 64 --------------------- .../mruby/mrbgems/mruby-symbol-ext/test/symbol.rb | 48 ---------------- 4 files changed, 182 deletions(-) delete mode 100644 debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/mrbgem.rake delete mode 100644 debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb delete mode 100644 debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/src/symbol.c delete mode 100644 debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb (limited to 'debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext') diff --git a/debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/mrbgem.rake b/debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/mrbgem.rake deleted file mode 100644 index 4f3fa43..0000000 --- a/debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/mrbgem.rake +++ /dev/null @@ -1,5 +0,0 @@ -MRuby::Gem::Specification.new('mruby-symbol-ext') do |spec| - spec.license = 'MIT' - spec.author = 'mruby developers' - spec.summary = 'Symbol class extension' -end diff --git a/debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb b/debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb deleted file mode 100644 index 1e3d24b..0000000 --- a/debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb +++ /dev/null @@ -1,65 +0,0 @@ -class Symbol - include Comparable - - alias intern to_sym - - def to_proc - ->(obj,*args,&block) do - obj.__send__(self, *args, &block) - end - end - - ## - # call-seq: - # sym.capitalize -> symbol - # - # Same as sym.to_s.capitalize.intern. - - def capitalize - (self.to_s.capitalize! || self).to_sym - end - - ## - # call-seq: - # sym.downcase -> symbol - # - # Same as sym.to_s.downcase.intern. - - def downcase - (self.to_s.downcase! || self).to_sym - end - - ## - # call-seq: - # sym.upcase -> symbol - # - # Same as sym.to_s.upcase.intern. - - def upcase - (self.to_s.upcase! || self).to_sym - end - - ## - # call-seq: - # sym.casecmp(other) -> -1, 0, +1 or nil - # - # Case-insensitive version of Symbol#<=>. - - def casecmp(other) - return nil unless other.kind_of?(Symbol) - lhs = self.to_s; lhs.upcase! - rhs = other.to_s; rhs.upcase! - lhs <=> rhs - end - - # - # call-seq: - # sym.empty? -> true or false - # - # Returns that _sym_ is :"" or not. - - def empty? - self.length == 0 - end - -end diff --git a/debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/src/symbol.c b/debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/src/symbol.c deleted file mode 100644 index a992dbf..0000000 --- a/debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include -#include - -typedef struct symbol_name { - size_t len; - const char *name; -} symbol_name; - -/* - * call-seq: - * Symbol.all_symbols => array - * - * Returns an array of all the symbols currently in Ruby's symbol - * table. - * - * Symbol.all_symbols.size #=> 903 - * Symbol.all_symbols[1,20] #=> [:floor, :ARGV, :Binding, :symlink, - * :chown, :EOFError, :$;, :String, - * :LOCK_SH, :"setuid?", :$<, - * :default_proc, :compact, :extend, - * :Tms, :getwd, :$=, :ThreadGroup, - * :wait2, :$>] - */ -static mrb_value -mrb_sym_all_symbols(mrb_state *mrb, mrb_value self) -{ - mrb_sym i, lim; - mrb_value ary = mrb_ary_new_capa(mrb, mrb->symidx); - - for (i=1, lim=mrb->symidx+1; i integer - * - * Same as sym.to_s.length. - */ -static mrb_value -mrb_sym_length(mrb_state *mrb, mrb_value self) -{ - mrb_int len; - mrb_sym2name_len(mrb, mrb_symbol(self), &len); - return mrb_fixnum_value(len); -} - -void -mrb_mruby_symbol_ext_gem_init(mrb_state* mrb) -{ - struct RClass *s = mrb->symbol_class; - mrb_define_class_method(mrb, s, "all_symbols", mrb_sym_all_symbols, MRB_ARGS_NONE()); - mrb_define_method(mrb, s, "length", mrb_sym_length, MRB_ARGS_NONE()); - mrb_define_method(mrb, s, "size", mrb_sym_length, MRB_ARGS_NONE()); -} - -void -mrb_mruby_symbol_ext_gem_final(mrb_state* mrb) -{ -} diff --git a/debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb b/debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb deleted file mode 100644 index 6070d14..0000000 --- a/debian/vendor-h2o/deps/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +++ /dev/null @@ -1,48 +0,0 @@ -## -# Symbol(Ext) Test - -assert('Symbol#to_proc') do - assert_equal 5, :abs.to_proc[-5] -end - -assert('Symbol.all_symbols') do - foo = [:__symbol_test_1, :__symbol_test_2, :__symbol_test_3].sort - symbols = Symbol.all_symbols.select{|sym|sym.to_s.include? '__symbol_test'}.sort - assert_equal foo, symbols -end - -assert("Symbol#length") do - assert_equal 5, :hello.size - assert_equal 5, :mruby.length -end - -assert("Symbol#capitalize") do - assert_equal :Hello, :hello.capitalize - assert_equal :Hello, :HELLO.capitalize - assert_equal :Hello, :Hello.capitalize -end - -assert("Symbol#downcase") do - assert_equal :hello, :hEllO.downcase - assert_equal :hello, :hello.downcase -end - -assert("Symbol#upcase") do - assert_equal :HELLO, :hEllO.upcase - assert_equal :HELLO, :HELLO.upcase -end - -assert("Symbol#casecmp") do - assert_equal 0, :HELLO.casecmp(:hEllO) - assert_equal 1, :HELLO.casecmp(:hEllN) - assert_equal(-1, :HELLO.casecmp(:hEllP)) - assert_nil :HELLO.casecmp("hEllO") -end - -assert("Symbol#empty?") do - assert_true :''.empty? -end - -assert('Symbol#intern') do - assert_equal :test, :test.intern -end -- cgit v1.2.3