diff options
Diffstat (limited to 'mrblib')
| -rw-r--r-- | mrblib/error.rb | 10 | ||||
| -rw-r--r-- | mrblib/mrblib.rake | 2 | ||||
| -rw-r--r-- | mrblib/numeric.rb | 32 |
3 files changed, 43 insertions, 1 deletions
diff --git a/mrblib/error.rb b/mrblib/error.rb index 32b50da92..9e5a3daeb 100644 --- a/mrblib/error.rb +++ b/mrblib/error.rb @@ -38,6 +38,16 @@ end # ISO 15.2.31 class NameError < StandardError + attr_accessor :name + + def new(message="NameError", name=nil) + initialize(message, name) + end + + def initialize(message=nil, name=nil) + @name = name + super(message) + end end # ISO 15.2.32 diff --git a/mrblib/mrblib.rake b/mrblib/mrblib.rake index 3cd66d0d5..db70842bf 100644 --- a/mrblib/mrblib.rake +++ b/mrblib/mrblib.rake @@ -6,7 +6,7 @@ MRuby.each_target do self.libmruby << objfile("#{current_build_dir}/mrblib") file objfile("#{current_build_dir}/mrblib") => "#{current_build_dir}/mrblib.c" - file "#{current_build_dir}/mrblib.c" => [mrbcfile] + Dir.glob("#{current_dir}/*.rb") do |t| + file "#{current_build_dir}/mrblib.c" => [mrbcfile] + Dir.glob("#{current_dir}/*.rb").sort do |t| mrbc_, *rbfiles = t.prerequisites FileUtils.mkdir_p File.dirname(t.name) open(t.name, 'w') do |f| diff --git a/mrblib/numeric.rb b/mrblib/numeric.rb index 1d701b1fc..daa35c5d6 100644 --- a/mrblib/numeric.rb +++ b/mrblib/numeric.rb @@ -5,6 +5,14 @@ class Integer ## + # Returns the receiver simply. + # + # ISO 15.2.8.3.14 + def ceil + self + end + + ## # Calls the given block once for each Integer # from +self+ downto +num+. # @@ -19,6 +27,14 @@ class Integer end ## + # Returns the receiver simply. + # + # ISO 15.2.8.3.17 + def floor + self + end + + ## # Calls the given block +self+ times. # # ISO 15.2.8.3.22 @@ -32,6 +48,22 @@ class Integer end ## + # Returns the receiver simply. + # + # ISO 15.2.8.3.24 + def round + self + end + + ## + # Returns the receiver simply. + # + # ISO 15.2.8.3.26 + def truncate + self + end + + ## # Calls the given block once for each Integer # from +self+ upto +num+. # |
