Skip to content
This repository

The Ruby Programming Language

branch: trunk

This branch is 0 commits ahead and 0 commits behind trunk

random.c: coerce before check negative

* random.c (rb_random_ulong_limited): coerce before check negative.
  [Fixes GH-379]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
latest commit 26feae3958
Nobuyoshi Nakada nobu authored August 13, 2013
Octocat-spinner-32 benchmark * benchmark/gc/gcbench.rb: fix summary of benchmark result notaton. June 21, 2013
Octocat-spinner-32 bin irb: dead code May 02, 2013
Octocat-spinner-32 bootstraptest parse.y: parse precisely August 02, 2013
Octocat-spinner-32 cygwin * cygwin/GNUmakefile.in (uncommon.mk): link *.res.o. November 05, 2012
Octocat-spinner-32 defs Set mode for GNU Makefile. June 20, 2013
Octocat-spinner-32 doc * doc/syntax/literals.rdoc: [DOC] String literal concat by @cknadler August 12, 2013
Octocat-spinner-32 enc Revert r41786 "broken utf-8" July 09, 2013
Octocat-spinner-32 ext * ext/dbm/extconf.rb: [DOC] Hide from RDoc August 12, 2013
Octocat-spinner-32 include * include/ruby/encoding.h: Reduce ENCODING_INLINE_MAX to 127 as this August 11, 2013
Octocat-spinner-32 lib * lib/yaml/dbm.rb: [DOC] Document call-seq for YAML::DBM August 12, 2013
Octocat-spinner-32 man * man/ri.1: Incorrect use of .Dd macro [Bug #8620] by Tristan Hill July 10, 2013
Octocat-spinner-32 misc * misc/ruby-electric.el (ruby-electric-delete-backward-char): Use May 19, 2013
Octocat-spinner-32 missing fix typos. Patch by k_takata. May 19, 2013
Octocat-spinner-32 nacl fix typos. Patch by k_takata. May 19, 2013
Octocat-spinner-32 sample * ext/curses/curses.c: [DOC] Update location of samples July 29, 2013
Octocat-spinner-32 spec * spec/default.mspec: expand relative path for ruby_exe which uses April 16, 2012
Octocat-spinner-32 symbian Added HAVE_LABS and HAVE_LLABS to config.h November 13, 2010
Octocat-spinner-32 template * template/encdb.h.tmpl: define encoding index macros to use the index July 01, 2013
Octocat-spinner-32 test random.c: coerce before check negative August 13, 2013
Octocat-spinner-32 tool * tool/make-snapshot: Fix order of priority for option parameter. August 09, 2013
Octocat-spinner-32 win32 win32.c: fix conversion August 06, 2013
Octocat-spinner-32 .document * .document: Removed extra space January 16, 2013
Octocat-spinner-32 .editorconfig .editorconfig: new September 15, 2012
Octocat-spinner-32 .gdbinit .gdbinit: initialize color sequences March 07, 2013
Octocat-spinner-32 .gitignore Ignore tool/config.guess and tool/config.sub June 16, 2013
Octocat-spinner-32 .indent.pro * .indent.pro: added for ruby-style. March 11, 2010
Octocat-spinner-32 .travis.yml update config files June 14, 2013
Octocat-spinner-32 BSDL * BSDL: update copyright notice for 2013. February 09, 2013
Octocat-spinner-32 COPYING * COPYING: change Ruby's License from a dual license with GPLv2 September 15, 2010
Octocat-spinner-32 COPYING.ja Change encoding from EUC-JP to UTF-8. [Feature #5128] September 04, 2011
Octocat-spinner-32 ChangeLog random.c: coerce before check negative August 13, 2013
Octocat-spinner-32 GPL * GPL: update text of GPLv2. [ruby-core:44488] [Bug #6328] June 03, 2012
Octocat-spinner-32 KNOWNBUGS.rb * test/ruby/test_method.rb (test_unlinked_method_entry_in_method_obje… March 25, 2013
Octocat-spinner-32 LEGAL * util.c, include/ruby/util.h (ruby_add_suffix): remove the function. August 03, 2011
Octocat-spinner-32 Makefile.in * Makefile.in (after-update): non-configure platforms don't need June 14, 2013
Octocat-spinner-32 NEWS * NEWS (REXML::Parsers::SAX2Parser): Add about this change. August 11, 2013
Octocat-spinner-32 README * README: Fix typo by Benjamin Winkler [Fixes GH-281] April 11, 2013
Octocat-spinner-32 README.EXT * README.EXT, README.EXT.ja: Mention rb_integer_pack and August 03, 2013
Octocat-spinner-32 README.EXT.ja * README.EXT, README.EXT.ja: Mention rb_integer_pack and August 03, 2013
Octocat-spinner-32 README.ja Fix the mail address of Matz; ruby-lang.jp does not exist. June 11, 2013
Octocat-spinner-32 addr2line.c * addr2line.c: use more generic type: April 06, 2013
Octocat-spinner-32 addr2line.h * addr2line.c: use USE_ELF instead of __ELF__ because Solaris July 08, 2011
Octocat-spinner-32 array.c * array.c (rb_ary_zip): performance implement by using August 04, 2013
Octocat-spinner-32 bignum.c * bignum.c (bitsize): Fix a conditional expression. August 10, 2013
Octocat-spinner-32 class.c * class.c (rb_prepend_module): make T_ICLASS object shady because August 12, 2013
Octocat-spinner-32 common.mk common.mk: install arch August 08, 2013
Octocat-spinner-32 compar.c * compar.c (Comparable#==): fix typo. May 06, 2013
Octocat-spinner-32 compile.c * compile.c (iseq_set_arguments): use RARRAY_RAWPTR() instead of July 24, 2013
Octocat-spinner-32 complex.c * gc.c: support RGENGC. [ruby-trunk - Feature #8339] May 13, 2013
Octocat-spinner-32 configure.in * process.c (rb_clock_gettime): New method. August 11, 2013
Octocat-spinner-32 constant.h * class.c, include/ruby/ruby.h: add write barriers for T_CLASS, June 14, 2013
Octocat-spinner-32 cont.c * cont.c (rb_fiber_start): use RARRAY_RAWPTR() instead of August 07, 2013
Octocat-spinner-32 debug.c * safe.c (rb_set_safe_level, safe_setter): raise an ArgumentError June 12, 2013
Octocat-spinner-32 dir.c dir.c: normalization August 10, 2013
Octocat-spinner-32 dln.c adjust style. December 01, 2012
Octocat-spinner-32 dln.h dln.c: extra arguments June 30, 2013
Octocat-spinner-32 dln_find.c dln.c: extra arguments June 30, 2013
Octocat-spinner-32 dmydln.c * encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "control April 13, 2012
Octocat-spinner-32 dmyext.c no K&R style May 19, 2012
Octocat-spinner-32 encoding.c encoding.c: is_obj_encoding July 25, 2013
Octocat-spinner-32 enum.c internal.h: STATIC_ASSERT July 10, 2013
Octocat-spinner-32 enumerator.c enumerator.c: fix non-single argument August 08, 2013
Octocat-spinner-32 error.c error.c: evaluate RARRAY_AREF once June 20, 2013
Octocat-spinner-32 eval.c * eval.c (rb_mod_refine, mod_using, top_using): don't show July 31, 2013
Octocat-spinner-32 eval_error.c * eval_error.c (warn_printf): use rb_vsprintf instead so ruby specific June 24, 2013
Octocat-spinner-32 eval_intern.h vm_core.h: move jmpbuf between tag and prev May 18, 2013
Octocat-spinner-32 eval_jump.c volatile errinfo March 18, 2012
Octocat-spinner-32 file.c file.c: OSX path encoding August 11, 2013
Octocat-spinner-32 gc.c * gc.c (gc_marks_test): inhibit gc for st's operation. August 12, 2013
Octocat-spinner-32 gc.h * gc.h (SET_MACHINE_STACK_END): Add !defined(_ILP32) to a defining May 10, 2013
Octocat-spinner-32 gem_prelude.rb * ruby.c (process_options): revert r30549. January 17, 2011
Octocat-spinner-32 golf_prelude.rb cancel subversion backfire. sorry March 07, 2011
Octocat-spinner-32 goruby.c goruby.c: IRB at end December 23, 2012
Octocat-spinner-32 hash.c * hash.c (rb_hash_compare_by_id): add function prototype. July 29, 2013
Octocat-spinner-32 ia64.s * removed trailing spaces. June 09, 2012
Octocat-spinner-32 inits.c sizes.c: RbConfig::SIZEOF July 29, 2013
Octocat-spinner-32 insns.def * vm_insnhelper.c (vm_push_frame): fix stack overflow check codes. August 06, 2013
Octocat-spinner-32 internal.h * file.c (rb_str_normalize_ospath): August 10, 2013
Octocat-spinner-32 io.c * io.c (io_getpartial): use rb_str_locktmp_ensure(). July 28, 2013
Octocat-spinner-32 iseq.c parse.y, vm_eval.c: file encoding in eval July 29, 2013
Octocat-spinner-32 iseq.h * include/ruby/ruby.h (struct rb_data_type_struct), gc.c: add June 19, 2013
Octocat-spinner-32 lex.c.blt * defs/keywords (reserved_word): made inline function static. May 16, 2009
Octocat-spinner-32 load.c load.c: search in OS path encoding July 26, 2013
Octocat-spinner-32 loadpath.c * loadpath.c (RUBY_REVISION): Defined to suppress revision.h June 17, 2013
Octocat-spinner-32 localeinit.c localeinit.c: split July 14, 2013
Octocat-spinner-32 main.c * include/ruby/debug.h: introdudced. November 20, 2012
Octocat-spinner-32 marshal.c * bignum.c (MSB): Removed. June 25, 2013
Octocat-spinner-32 math.c * internal.h (numberof): Gathered from various files. June 07, 2013
Octocat-spinner-32 method.h * class.c, include/ruby/ruby.h: add write barriers for T_CLASS, June 14, 2013
Octocat-spinner-32 miniinit.c localeinit.c: split July 14, 2013
Octocat-spinner-32 node.c * include/ruby/util.h: removed extra semicolon in definition of November 21, 2012
Octocat-spinner-32 node.h parse.y, vm_eval.c: file encoding in eval July 29, 2013
Octocat-spinner-32 numeric.c * numeric.c: [DOC] fix typo. August 10, 2013
Octocat-spinner-32 object.c object.c: undef Module#prepend_features on Class August 13, 2013
Octocat-spinner-32 pack.c * internal.h (ruby_digit36_to_number_table): Declared. July 03, 2013
Octocat-spinner-32 parse.y parse.y: CR in middle August 12, 2013
Octocat-spinner-32 prelude.rb * prelude.rb: Moved Mutex#synchronize to November 19, 2012
Octocat-spinner-32 probes.d gen_dummy_probes.rb March 11, 2013
Octocat-spinner-32 probes_helper.h probes_helper.h: RUBY_DTRACE_HOOK December 11, 2012
Octocat-spinner-32 proc.c * proc.c: [DOC] rdoc code formatting August 10, 2013
Octocat-spinner-32 process.c * process.c: [DOC] RDoc formatting of Process.clock_gettime August 12, 2013
Octocat-spinner-32 random.c random.c: coerce before check negative August 13, 2013
Octocat-spinner-32 range.c range.c: revert r42400 August 08, 2013
Octocat-spinner-32 rational.c * rational.c (rb_flt_rationalize_with_prec): new public C function August 01, 2013
Octocat-spinner-32 re.c re.c: suppress warning August 09, 2013
Octocat-spinner-32 regcomp.c * regcomp.c (): Merge Onigmo 5.13.5 23b523076d6f1161. July 04, 2013
Octocat-spinner-32 regenc.c Revert r41786 "broken utf-8" July 09, 2013
Octocat-spinner-32 regenc.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} April 05, 2013
Octocat-spinner-32 regerror.c * regcomp.c: Merge Onigmo 3d855b3. March 21, 2012
Octocat-spinner-32 regexec.c * Merge Onigmo 5.13.4 f22cf2e. April 13, 2013
Octocat-spinner-32 regint.h * Merge Onigmo 5.13.4 f22cf2e. April 13, 2013
Octocat-spinner-32 regparse.c * Merge Onigmo 5.13.4 f22cf2e. April 13, 2013
Octocat-spinner-32 regparse.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} April 05, 2013
Octocat-spinner-32 regsyntax.c * Merge Onigmo-5.13.1. [ruby-dev:45057] [Feature #5820] February 17, 2012
Octocat-spinner-32 ruby.c ruby.c: use String path version parser functions August 09, 2013
Octocat-spinner-32 ruby_atomic.h ruby_atomic.h: ATOMIC_CAS on VC6 July 03, 2013
Octocat-spinner-32 safe.c safe.c: ruby_safe_level_4_warning July 20, 2013
Octocat-spinner-32 signal.c signal.c: suppress a warning July 14, 2013
Octocat-spinner-32 siphash.c * regint.h: fix typo: _M_AMD86 -> _M_AMD64. April 10, 2013
Octocat-spinner-32 siphash.h * siphash.h: check configure macros before include newer headers. November 09, 2012
Octocat-spinner-32 sizes.c * sizes.c (Init_sizes): Define sizes only if the type actually exists. July 29, 2013
Octocat-spinner-32 sparc.c * sparc.c: Use __asm__ instead of asm for gcc. April 27, 2013
Octocat-spinner-32 sprintf.c sprintf.c: QUOTE flag July 30, 2013
Octocat-spinner-32 st.c * st.c (st_locale_insensitive_strcasecmp): Renamed from st_strcasecmp. July 16, 2013
Octocat-spinner-32 strftime.c * strftime.c (rb_strftime_with_timespec): Test yday range. April 06, 2013
Octocat-spinner-32 string.c * string.c (rb_str_format_m): use RARRAY_RAWPTR() instead of August 08, 2013
Octocat-spinner-32 struct.c struct.c: rb_struct_define_under August 03, 2013
Octocat-spinner-32 thread.c * thread.c (rb_threadptr_pending_interrupt_check_mask): August 08, 2013
Octocat-spinner-32 thread_native.h * thread_native.h: add rb_nativethread_self() which returns July 23, 2013
Octocat-spinner-32 thread_pthread.c * thread_(pthread|win32).h: rename rb_thread_cond_t to July 23, 2013
Octocat-spinner-32 thread_pthread.h * thread_(pthread|win32).h: rename rb_thread_cond_t to July 23, 2013
Octocat-spinner-32 thread_win32.c * thread_(pthread|win32).h: rename rb_thread_cond_t to July 23, 2013
Octocat-spinner-32 thread_win32.h * thread_(pthread|win32).h: rename rb_thread_cond_t to July 23, 2013
Octocat-spinner-32 time.c * time.c (get_timeval, get_new_timeval): use rb_obj_class() August 09, 2013
Octocat-spinner-32 timev.h timev.h: move time_t stuffs March 30, 2013
Octocat-spinner-32 transcode.c encoding.c: refill terminator at associating encoding July 12, 2013
Octocat-spinner-32 transcode_data.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} April 05, 2013
Octocat-spinner-32 util.c * internal.h (ruby_digit36_to_number_table): Declared. July 03, 2013
Octocat-spinner-32 variable.c * include/ruby/ruby.h (OBJ_WRITE): cast to (VALUE *) for second June 21, 2013
Octocat-spinner-32 version.c loadpath.c: split May 15, 2013
Octocat-spinner-32 version.h * 2013-08-13 August 12, 2013
Octocat-spinner-32 vm.c * proc.c: add Binding#local_variable_get/set/defined? August 09, 2013
Octocat-spinner-32 vm_backtrace.c * vm_backtrace.c: Update rdoc for Backtrace#label with @_ko1 June 17, 2013
Octocat-spinner-32 vm_core.h * proc.c: add Binding#local_variable_get/set/defined? August 09, 2013
Octocat-spinner-32 vm_debug.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} April 05, 2013
Octocat-spinner-32 vm_dump.c * vm_dump.c (rb_vm_bugreport): show name of class and module. May 22, 2013
Octocat-spinner-32 vm_eval.c * vm_insnhelper.c (vm_push_frame): fix stack overflow check codes. August 06, 2013
Octocat-spinner-32 vm_exec.c * vm_exec.c: Correct predefined macro name. This typo is introduced by March 18, 2013
Octocat-spinner-32 vm_exec.h vm_exec.h: fix CHECK_VM_STACK_OVERFLOW_FOR_INSN July 26, 2013
Octocat-spinner-32 vm_insnhelper.c * vm_insnhelper.c (vm_invoke_block): returning from lambda proc August 09, 2013
Octocat-spinner-32 vm_insnhelper.h * vm_insnhelper.h: partly revert r37631 (DTrace support). November 22, 2012
Octocat-spinner-32 vm_method.c * class.c (rb_include_class_new), eval.c (rb_using_refinement): June 22, 2013
Octocat-spinner-32 vm_opts.h fix minor code comment typos April 22, 2013
Octocat-spinner-32 vm_trace.c * vm_trace.c: [DOC] Fix TracePoint return values in examples August 05, 2013
Octocat-spinner-32 vsnprintf.c unecessary macros and K&R style coding August 16, 2012
README
= What's Ruby

Ruby is the interpreted scripting language for quick and
easy object-oriented programming.  It has many features to
process text files and to do system management tasks (as in
Perl).  It is simple, straight-forward, and extensible.


== Features of Ruby

*   Simple Syntax
*   *Normal* Object-Oriented features(ex. class, method calls)
*   *Advanced* Object-Oriented features(ex. Mix-in, Singleton-method)
*   Operator Overloading
*   Exception Handling
*   Iterators and Closures
*   Garbage Collection
*   Dynamic Loading of Object files(on some architecture)
*   Highly Portable (works on many Unix-like/POSIX compatible platforms
    as well as Windows, Mac OS X, BeOS etc.)
    cf. http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatforms


== How to get Ruby

For a complete list of ways to install Ruby, including using third party
tools like rvm, see:

http://www.ruby-lang.org/en/downloads/

The Ruby distribution files can be found in the following FTP site:

ftp://ftp.ruby-lang.org/pub/ruby/

The trunk of the Ruby source tree can be checked out with the
following command:

  $ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby

Or if you are using git then use the following command:

  $ git clone git://github.com/ruby/ruby.git

There are some other branches under development.  Try the following
command and see the list of branches:

  $ svn ls http://svn.ruby-lang.org/repos/ruby/branches/

Or if you are using git then use the following command:

  $ git ls-remote git://github.com/ruby/ruby.git

== Ruby home-page

The URL of the Ruby home-page is:

http://www.ruby-lang.org/


== Mailing list

There is a mailing list to talk about Ruby.
To subscribe this list, please send the following phrase

        subscribe YourFirstName YourFamilyName
e.g.
        subscribe Joseph Smith

in the mail body (not subject) to the address <mailto:ruby-talk-ctl@ruby-lang.org>.


== How to compile and install

This is what you need to do to compile and install Ruby:

0.   If you want to use Microsoft Visual C++ to compile ruby,
     read win32/README.win32 instead of this document.

1.   If +./configure+ does not exist or is older than configure.in,
     run autoconf to (re)generate configure.

2.   Run +./configure+, which will generate config.h and Makefile.

     Some C compiler flags may be added by default depending on your
     environment.  Specify <tt>optflags=..</tt> and <tt>warnflags=..</tt> as
     necessary to override them.

3.   Edit +defines.h+ if you need. Usually this step will not be needed.

4.   Remove comment mark(<tt>#</tt>) before the module names from +ext/Setup+
     (or add module names if not present), if you want to link modules
     statically.

     If you don't want to compile non static extension modules
     (probably on architectures which does not allow dynamic loading),
     remove comment mark from the line "<tt>#option nodynamic</tt>" in
     +ext/Setup+.

     Usually this step will not be needed.

5.   Run +make+.

6.   Optionally, run '<tt>make check</tt>' to check whether the compiled Ruby
     interpreter works well. If you see the message "<tt>check succeeded</tt>",
     your ruby works as it should (hopefully).

7.   Run '<tt>make install</tt>'

     This command will create following directories and install files
     onto them.

     * <tt>${DESTDIR}${prefix}/bin</tt>
     * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}</tt>
     * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
     * <tt>${DESTDIR}${prefix}/lib</tt>
     * <tt>${DESTDIR}${prefix}/lib/ruby</tt>
     * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
     * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
     * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby</tt>
     * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
     * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
     * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby</tt>
     * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
     * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
     * <tt>${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}</tt>
     * <tt>${DESTDIR}${prefix}/share/man/man1</tt>
     * <tt>${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system</tt>

     If Ruby's API version is '_x.y.z_', the <tt>${MAJOR}</tt> is '_x_', the
     <tt>${MINOR}</tt> is '_y_', and the <tt>${TEENY}</tt> is '_z_'.

     *NOTE*: teeny of the API version may be different from one of
     Ruby's program version

     You may have to be a super user to install ruby.

If you fail to compile ruby, please send the detailed error report with
the error log and machine/OS type, to help others.

Some extension libraries may not get compiled because of lack of
necessary external libraries and/or headers, then you will need to run
'<tt>make distclean-ext</tt>' to remove old configuration after
installing them in such case.

== Copying

See the file +COPYING+.

== Feedback

Questions about the Ruby language can be asked on the Ruby-Talk mailing list
(http://www.ruby-lang.org/en/community/mailing-lists) or on websites like
(http://stackoverflow.com).

Bug reports should be filed at http://bugs.ruby-lang.org

== The Author

Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in 1995.

<mailto:matz@ruby-lang.org>

--
Local variables:
mode: rdoc
end:
Something went wrong with that request. Please try again.