From d41fdbcba9a8d764ffcd1eaca453c7870567784f Mon Sep 17 00:00:00 2001 From: Kristian Date: Mon, 26 Oct 2015 17:56:28 +1000 Subject: Fixed typo in docs + Added a better description for 'nil' --- ruby.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ruby.html.markdown') diff --git a/ruby.html.markdown b/ruby.html.markdown index 998b4bf7..a3fc859e 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -49,7 +49,7 @@ You shouldn't either 10.* 5 #=> 50 # Special values are objects -nil # Nothing to see here +nil # equivalent to null in other languages true # truth false # falsehood @@ -122,7 +122,7 @@ puts "I'm printing!" # print to the output without a newline print "I'm printing!" -#=> I'm printing! => nill +#=> I'm printing! => nil # Variables x = 25 #=> 25 -- cgit v1.2.3 From 5acb0c1a604d468af2cd651229866c48ed7c4e24 Mon Sep 17 00:00:00 2001 From: Bruno Volcov Date: Mon, 26 Oct 2015 17:23:27 -0200 Subject: add a cool reference for learn Ruby =) --- ruby.html.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ruby.html.markdown') diff --git a/ruby.html.markdown b/ruby.html.markdown index c10255d8..b3ef2a4d 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -13,6 +13,7 @@ contributors: - ["Levi Bostian", "https://github.com/levibostian"] - ["Rahil Momin", "https://github.com/iamrahil"] - ["Gabriel Halley", https://github.com/ghalley] + - ["Bruno Volcov", https://github.com/volcov] --- @@ -285,7 +286,7 @@ end #=> iteration 4 #=> iteration 5 -# There are a bunch of other helpful looping functions in Ruby, +# There are a bunch of other helpful looping functions in Ruby, # for example "map", "reduce", "inject", the list goes on. Map, # for instance, takes the array it's looping over, does something # to it as defined in your block, and returns an entirely new array. @@ -576,3 +577,4 @@ Something.new.qux # => 'qux' - [Ruby from other languages](https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/) - [Programming Ruby](http://www.amazon.com/Programming-Ruby-1-9-2-0-Programmers/dp/1937785491/) - An older [free edition](http://ruby-doc.com/docs/ProgrammingRuby/) is available online. - [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide) - A community-driven Ruby coding style guide. +- [Try Ruby](http://tryruby.org) - Learn the basic of Ruby programming language, interactive in the browser. -- cgit v1.2.3 From ec601c168aa50368822411d7487e81027388db53 Mon Sep 17 00:00:00 2001 From: Jake Faris Date: Fri, 30 Oct 2015 10:17:15 -0400 Subject: Adds combined comparison operator to Ruby --- ruby.html.markdown | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ruby.html.markdown') diff --git a/ruby.html.markdown b/ruby.html.markdown index 998b4bf7..6114c14e 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -77,6 +77,11 @@ false.class #=> FalseClass 2 <= 2 #=> true 2 >= 2 #=> true +# Combined comparison operator +1 <=> 10 #=> -1 +10 <=> 1 #=> 1 +1 <=> 1 #=> 0 + # Logical operators true && false #=> false true || false #=> true -- cgit v1.2.3 From 33337d045d5af8155e9ef3418f6f766298977a15 Mon Sep 17 00:00:00 2001 From: Jake Faris Date: Fri, 30 Oct 2015 10:22:23 -0400 Subject: Adds bitwise operators (AND, OR, XOR) --- ruby.html.markdown | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ruby.html.markdown') diff --git a/ruby.html.markdown b/ruby.html.markdown index 998b4bf7..f13b77ac 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -41,7 +41,11 @@ You shouldn't either 35 / 5 #=> 7 2**5 #=> 32 5 % 3 #=> 2 -5 ^ 6 #=> 3 + +# Bitwise operators +3 & 5 #=> 1 +3 | 5 #=> 7 +3 ^ 5 #=> 6 # Arithmetic is just syntactic sugar # for calling a method on an object -- cgit v1.2.3 From f10292ed98674521cc80a0ab66d8508c74e7a627 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 31 Oct 2015 16:55:25 -0700 Subject: Added new ruby resource --- ruby.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'ruby.html.markdown') diff --git a/ruby.html.markdown b/ruby.html.markdown index 8720fec6..1118e2dd 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -588,6 +588,7 @@ Something.new.qux # => 'qux' ## Additional resources - [Learn Ruby by Example with Challenges](http://www.learneroo.com/modules/61/nodes/338) - A variant of this reference with in-browser challenges. +- [An Interactive Tutorial for Ruby](https://rubymonk.com/) - Learn Ruby through a series of interactive tutorials. - [Official Documentation](http://www.ruby-doc.org/core-2.1.1/) - [Ruby from other languages](https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/) - [Programming Ruby](http://www.amazon.com/Programming-Ruby-1-9-2-0-Programmers/dp/1937785491/) - An older [free edition](http://ruby-doc.com/docs/ProgrammingRuby/) is available online. -- cgit v1.2.3 From b13bb0ce47386d0426342c0470ddc4a52720c56d Mon Sep 17 00:00:00 2001 From: Jake Faris Date: Mon, 2 Nov 2015 10:06:01 -0500 Subject: adds JF to authors --- ruby.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'ruby.html.markdown') diff --git a/ruby.html.markdown b/ruby.html.markdown index 782ffc4c..243f788b 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -14,6 +14,7 @@ contributors: - ["Rahil Momin", "https://github.com/iamrahil"] - ["Gabriel Halley", "https://github.com/ghalley"] - ["Persa Zula", "http://persazula.com"] + - ["Jake Faris", "https://github.com/farisj"] --- ```ruby -- cgit v1.2.3 From e7dc56273f07066e2b4da1c02e3f723b8da834a0 Mon Sep 17 00:00:00 2001 From: Leslie Zhang Date: Mon, 23 Nov 2015 09:14:49 +0800 Subject: Replace Hash#has_key? with Hash#key? 1. Replace Hash#has_key? with Hash#key? 2. Replace Hash#has_value? with Hash#value? --- ruby.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ruby.html.markdown') diff --git a/ruby.html.markdown b/ruby.html.markdown index 243f788b..cf1a18e3 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -230,8 +230,8 @@ new_hash = { defcon: 3, action: true } new_hash.keys #=> [:defcon, :action] # Check existence of keys and values in hash -new_hash.has_key?(:defcon) #=> true -new_hash.has_value?(3) #=> true +new_hash.key?(:defcon) #=> true +new_hash.value?(3) #=> true # Tip: Both Arrays and Hashes are Enumerable # They share a lot of useful methods such as each, map, count, and more -- cgit v1.2.3 From 746df3268afcd0307c0da434bf162632be3d53ea Mon Sep 17 00:00:00 2001 From: Bruno Volcov Date: Mon, 4 Jan 2016 17:28:36 -0200 Subject: remove contributors name --- ruby.html.markdown | 1 - 1 file changed, 1 deletion(-) (limited to 'ruby.html.markdown') diff --git a/ruby.html.markdown b/ruby.html.markdown index b3ef2a4d..267889b1 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -13,7 +13,6 @@ contributors: - ["Levi Bostian", "https://github.com/levibostian"] - ["Rahil Momin", "https://github.com/iamrahil"] - ["Gabriel Halley", https://github.com/ghalley] - - ["Bruno Volcov", https://github.com/volcov] --- -- cgit v1.2.3