Ignore:
Timestamp:
Jan 21, 2018, 12:10:09 AM (6 years ago)
Author:
coas-nagasima
Message:

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

Location:
EcnlProtoTool/trunk/mruby-1.3.0
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/mruby-1.3.0/mrbgems/mruby-array-ext/mrblib/array.rb

    r321 r331  
    11class Array
     2  ##
     3  # call-seq:
     4  #    Array.try_convert(obj) -> array or nil
     5  #
     6  # Tries to convert +obj+ into an array, using +to_ary+ method.
     7  # converted array or +nil+ if +obj+ cannot be converted for any reason.
     8  # This method can be used to check if an argument is an array.
     9  #
     10  #    Array.try_convert([1])   #=> [1]
     11  #    Array.try_convert("1")   #=> nil
     12  #
     13  #    if tmp = Array.try_convert(arg)
     14  #      # the argument is an array
     15  #    elsif tmp = String.try_convert(arg)
     16  #      # the argument is a string
     17  #    end
     18  #
     19  def self.try_convert(obj)
     20    if obj.respond_to?(:to_ary)
     21      obj.to_ary
     22    else
     23      nil
     24    end
     25  end
     26
    227  ##
    328  # call-seq:
     
    251276  #
    252277  #  Alternatively, if a block is given it will only be executed when an
    253   #  invalid +index+ is referenced.  Negative values of +index+ count from the
    254   #  end of the array.
     278  #  invalid +index+ is referenced.
     279  #
     280  #  Negative values of +index+ count from the end of the array.
    255281  #
    256282  #     a = [ 11, 22, 33, 44 ]
     
    710736    nil
    711737  end
     738
     739  ##
     740  #  call-seq:
     741  #     ary.to_ary -> ary
     742  #
     743  #  Returns +self+.
     744  #
     745  def to_ary
     746    self
     747  end
     748
     749  ##
     750  # call-seq:
     751  #   ary.dig(idx, ...)                 -> object
     752  #
     753  # Extracts the nested value specified by the sequence of <i>idx</i>
     754  # objects by calling +dig+ at each step, returning +nil+ if any
     755  # intermediate step is +nil+.
     756  #
     757  def dig(idx,*args)
     758    n = self[idx]
     759    if args.size > 0
     760      n&.dig(*args)
     761    else
     762      n
     763    end
     764  end
    712765end
Note: See TracChangeset for help on using the changeset viewer.