<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ruby Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/category/ruby/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Mon, 19 Jun 2023 13:30:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Top 50 Ruby Interview Questions with Answers</title>
		<link>https://www.scmgalaxy.com/tutorials/top-50-ruby-interview-questions-with-answers/</link>
					<comments>https://www.scmgalaxy.com/tutorials/top-50-ruby-interview-questions-with-answers/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Sat, 29 Apr 2023 11:36:37 +0000</pubDate>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ruby programming]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=10053</guid>

					<description><![CDATA[<p>1. What is Ruby? a) A programming languageb) A web browserc) A database management systemd) An operating system Answer: a) [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/top-50-ruby-interview-questions-with-answers/">Top 50 Ruby Interview Questions with Answers</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img fetchpriority="high" decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2023/04/image-16.png" alt="" class="wp-image-10055" width="742" height="318" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2023/04/image-16.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2023/04/image-16-300x129.png 300w" sizes="(max-width: 742px) 100vw, 742px" /><figcaption class="wp-element-caption"><strong><em>Ruby Interview Questions with Answers</em></strong></figcaption></figure>
</div>


<h3 class="wp-block-heading">1. What is Ruby?</h3>



<p class="wp-block-paragraph">a) A programming language<br>b) A web browser<br>c) A database management system<br>d) An operating system</p>



<h4 class="wp-block-heading">Answer: a) A programming language</h4>



<h3 class="wp-block-heading">2. Which of the following is not a valid variable name in Ruby?</h3>



<p class="wp-block-paragraph">a) my_variable<br>b) my-variable<br>c) MyVariable<br>d) myVariable</p>



<h4 class="wp-block-heading">Answer: b) my-variable</h4>



<h3 class="wp-block-heading">3. What is the difference between an instance variable and a class variable in Ruby?</h3>



<p class="wp-block-paragraph">a) An instance variable is shared by all instances of a class, while a class variable is unique to each instance.<br>b) An instance variable is unique to each instance of a class, while a class variable is shared by all instances of a class.<br>c) An instance variable is not used in Ruby programming, while a class variable is used to store class-level data.<br>d) There is no difference between an instance variable and a class variable in Ruby.</p>



<h4 class="wp-block-heading">Answer: b) An instance variable is unique to each instance of a class, while a class variable is shared by all instances of a class.</h4>



<h3 class="wp-block-heading">4. What does the attr_accessor method do in Ruby?</h3>



<p class="wp-block-paragraph">a) Defines a new attribute for a class<br>b) Allows read and write access to an instance variable<br>c) Allows read-only access to an instance variable<br>d) Allows write-only access to an instance variable</p>



<h4 class="wp-block-heading">Answer: b) Allows read and write access to an instance variable</h4>



<h3 class="wp-block-heading">5. In Ruby, what is the difference between &#8216;and&#8217; and &#8216;&amp;&amp;&#8217;?</h3>



<p class="wp-block-paragraph">a) There is no difference<br>b) &#8216;and&#8217; has higher precedence than &#8216;&amp;&amp;&#8217;<br>c) &#8216;&amp;&amp;&#8217; has higher precedence than &#8216;and&#8217;<br>d) &#8216;and&#8217; is used for logical OR operations, while &#8216;&amp;&amp;&#8217; is used for logical AND operations</p>



<h4 class="wp-block-heading">Answer: c) &#8216;&amp;&amp;&#8217; has higher precedence than &#8216;and&#8217;</h4>



<h3 class="wp-block-heading">6. Which of the following is not a valid loop construct in Ruby?</h3>



<p class="wp-block-paragraph">a) for<br>b) while<br>c) until<br>d) if</p>



<h4 class="wp-block-heading">Answer: d) if</h4>



<h3 class="wp-block-heading">7. What is the difference between puts and print in Ruby?</h3>



<p class="wp-block-paragraph">a) There is no difference<br>b) puts adds a line break after the output, while print does not<br>c) print adds a line break after the output, while puts does not<br>d) puts and print are not valid Ruby commands</p>



<h4 class="wp-block-heading">Answer: b) puts adds a line break after the output, while print does not</h4>



<h3 class="wp-block-heading">8. Which of the following is not a valid method for an array in Ruby?</h3>



<p class="wp-block-paragraph">a) push<br>b) pop<br>c) remove<br>d) shift</p>



<h4 class="wp-block-heading">Answer: c) remove</h4>



<h3 class="wp-block-heading">9. What is the result of 5.times { |i| puts i } in Ruby?</h3>



<p class="wp-block-paragraph">a) 0 1 2 3 4<br>b) 1 2 3 4 5<br>c) 0 2 4 6 8<br>d) Nothing is outputted</p>



<h4 class="wp-block-heading">Answer: a) 0 1 2 3 4</h4>



<h3 class="wp-block-heading">11. What is the purpose of a block in Ruby?</h3>



<p class="wp-block-paragraph">a) To define a new class<br>b) To define a new method<br>c) To group statements and pass them to a method<br>d) To create a new object</p>



<h4 class="wp-block-heading">Answer: c) To group statements and pass them to a method</h4>



<h3 class="wp-block-heading">12. What is the result of &#8220;hello&#8221;.reverse in Ruby?</h3>



<p class="wp-block-paragraph">a) &#8220;hello&#8221;<br>b) &#8220;loleh&#8221;<br>c) &#8220;olleh&#8221;<br>d) &#8220;e&#8221;</p>



<h4 class="wp-block-heading">Answer: c) &#8220;olleh&#8221;</h4>



<h3 class="wp-block-heading">12. What does the following code do in Ruby?<br>array = [1,2,3]<br>array.map! { |x| x * 2 }</h3>



<p class="wp-block-paragraph">a) It creates a new array with each element multiplied by 2<br>b) It creates a new array with each element added by 2<br>c) It modifies the current array by multiplying each element by 2<br>d) It modifies the current array by adding 2 to each element</p>



<h4 class="wp-block-heading">Answer: c) It modifies the current array by multiplying each element by 2</h4>



<h3 class="wp-block-heading">13. What does the ||= operator do in Ruby?</h3>



<p class="wp-block-paragraph">a) It assigns a value only if the current value is nil or false<br>b) It assigns a value regardless of the current value<br>c) It checks if two variables are equal<br>d) It performs a bit-wise OR operation</p>



<h4 class="wp-block-heading">Answer: a) It assigns a value only if the current value is nil or false</h4>



<h3 class="wp-block-heading">14. What is the result of (1..5).to_a in Ruby?</h3>



<p class="wp-block-paragraph">a) [0, 1, 2, 3, 4, 5]<br>b) [1, 2, 3, 4, 5]<br>c) [1, 3, 5]<br>d) [0, 1, 2, 3, 4]</p>



<h4 class="wp-block-heading">Answer: b) [1, 2, 3, 4, 5]</h4>



<h3 class="wp-block-heading">15. Which of the following is not a valid way to create a hash in Ruby?</h3>



<p class="wp-block-paragraph">a) { key1: value1, key2: value2 }<br>b) { &#8220;key1&#8221; =&gt; &#8220;value1&#8221;, &#8220;key2&#8221; =&gt; &#8220;value2&#8221; }<br>c) Hash.new(key: value)<br>d) { :key1 =&gt; &#8220;value1&#8221;, :key2 =&gt; &#8220;value2&#8221; }</p>



<h4 class="wp-block-heading">Answer: c) Hash.new(key: value)</h4>



<h3 class="wp-block-heading">16. What is a module in Ruby?</h3>



<p class="wp-block-paragraph">a) A way to define a new class<br>b) A way to group related methods and constants<br>c) A way to define a new variable<br>d) A way to define a new block</p>



<h4 class="wp-block-heading">Answer: b) A way to group related methods and constants</h4>



<h3 class="wp-block-heading">17. What is the result of [1,2,3].inject(:+) in Ruby?</h3>



<p class="wp-block-paragraph">a) 6<br>b) [1,2,3]<br>c) [1, 3, 6]<br>d) Nothing is outputted</p>



<h4 class="wp-block-heading">Answer: a) 6</h4>



<h3 class="wp-block-heading">18. What is the purpose of the &#8216;self&#8217; keyword in Ruby?</h3>



<p class="wp-block-paragraph">a) To define a new class<br>b) To define a new module<br>c) To refer to the current object<br>d) To refer to the parent object</p>



<h4 class="wp-block-heading">Answer: c) To refer to the current object</h4>



<h3 class="wp-block-heading">19. What is the difference between &#8216;raise&#8217; and &#8216;rescue&#8217; in Ruby?</h3>



<p class="wp-block-paragraph">a) There is no difference<br>b) &#8216;raise&#8217; is used to raise an exception, while &#8216;rescue&#8217; is used to handle an exception<br>c) &#8216;rescue&#8217; is used to raise an exception, while &#8216;raise&#8217; is used to handle an exception<br>d) &#8216;raise&#8217; and &#8216;rescue&#8217; are not valid Ruby commands</p>



<h4 class="wp-block-heading">Answer: b) &#8216;raise&#8217; is used to raise an exception, while &#8216;rescue&#8217; is used to handle an exception</h4>



<h3 class="wp-block-heading">20. What is a gem in Ruby?</h3>



<p class="wp-block-paragraph">a) A way to define a new class<br>b) A way to group related methods and constants<br>c) A way to define a new method<br>d) A way to package and distribute Ruby code</p>



<h4 class="wp-block-heading">Answer: d) A way to package and distribute Ruby code</h4>



<h3 class="wp-block-heading">21. What is the result of 10.divmod(3) in Ruby?</h3>



<p class="wp-block-paragraph">a) 3<br>b) 1<br>c) [3, 1]<br>d) [1, 3]</p>



<h4 class="wp-block-heading">Answer: c) [3, 1]</h4>



<h3 class="wp-block-heading">22. What is the difference between a lambda and a proc in Ruby?</h3>



<p class="wp-block-paragraph">a) There is no difference<br>b) A lambda checks the number of arguments passed, while a proc does not<br>c) A proc checks the number of arguments passed, while a lambda does not<br>d) A lambda can be called with or without arguments, while a proc must be called with arguments</p>



<h4 class="wp-block-heading">Answer: b) A lambda checks the number of arguments passed, while a proc does not</h4>



<h3 class="wp-block-heading">23. What is the result of &#8220;hello&#8221;.gsub(&#8216;l&#8217;, &#8216;b&#8217;) in Ruby?</h3>



<p class="wp-block-paragraph">a) &#8220;hello&#8221;<br>b) &#8220;hb&#8221;<br>c) &#8220;hebbo&#8221;<br>d) &#8220;helbo&#8221;</p>



<h4 class="wp-block-heading">Answer: d) &#8220;helbo&#8221;</h4>



<h3 class="wp-block-heading">24. Which of the following is not a valid way to define a class in Ruby?</h3>



<p class="wp-block-paragraph">a) class MyClass; end<br>b) MyClass = class; end<br>c) class MyClass &lt; ParentClass; end<br>d) class MyClass; def my_method; end; end</p>



<h4 class="wp-block-heading">Answer: b) MyClass = class; end</h4>



<h3 class="wp-block-heading">25. What is the result of &#8220;hello world&#8221;.split in Ruby?</h3>



<p class="wp-block-paragraph">a) [&#8220;hello&#8221;, &#8220;world&#8221;]<br>b) &#8220;hello world&#8221;<br>c) &#8220;helloworld&#8221;<br>d) [&#8220;h&#8221;, &#8220;e&#8221;, &#8220;l&#8221;, &#8220;l&#8221;, &#8220;o&#8221;, &#8221; &#8220;, &#8220;w&#8221;, &#8220;o&#8221;, &#8220;r&#8221;, &#8220;l&#8221;, &#8220;d&#8221;]</p>



<h4 class="wp-block-heading">Answer: a) [&#8220;hello&#8221;, &#8220;world&#8221;]</h4>



<h3 class="wp-block-heading">26. What is the purpose of the return keyword in Ruby?</h3>



<p class="wp-block-paragraph">a) To define a new variable<br>b) To define a new method<br>c) To stop the execution of a method and return a value<br>d) To refer to the current object</p>



<h4 class="wp-block-heading">Answer: c) To stop the execution of a method and return a value</h4>



<h3 class="wp-block-heading">27. What is the result of {&#8216;a&#8217; =&gt; 1, &#8216;b&#8217; =&gt; 2}.invert in Ruby?</h3>



<p class="wp-block-paragraph">a) {&#8216;1&#8217; =&gt; &#8216;a&#8217;, &#8216;2&#8217; =&gt; &#8216;b&#8217;}<br>b) {&#8216;a&#8217; =&gt; &#8216;1&#8217;, &#8216;b&#8217; =&gt; &#8216;2&#8217;}<br>c) {1 =&gt; &#8216;a&#8217;, 2 =&gt; &#8216;b&#8217;}<br>d) {&#8216;a&#8217; =&gt; 2, &#8216;b&#8217; =&gt; 1}</p>



<h4 class="wp-block-heading">Answer: {1 =&gt; &#8216;a&#8217;, 2 =&gt; &#8216;b&#8217;}</h4>



<h3 class="wp-block-heading">28. What is the difference between &#8216;puts&#8217; and &#8216;p&#8217; in Ruby?</h3>



<p class="wp-block-paragraph">a) There is no difference<br>b) &#8216;p&#8217; adds a line break after the output, while &#8216;puts&#8217; does not<br>c) &#8216;puts&#8217; adds a line break after the output, while &#8216;p&#8217; does not<br>d) &#8216;puts&#8217; prints the object and its type, while &#8216;p&#8217; only prints the object</p>



<h4 class="wp-block-heading">Answer: d) &#8216;puts&#8217; prints the object and its type, while &#8216;p&#8217; only prints the object</h4>



<h3 class="wp-block-heading">29. What is the result of [1,2,3].each { |x| puts x * 2 } in Ruby?</h3>



<p class="wp-block-paragraph">a) [2, 4, 6]<br>b) Nothing is outputted<br>c) 2 4 6<br>d) 1 2 3</p>



<h4 class="wp-block-heading">Answer: b) Nothing is outputted</h4>



<h3 class="wp-block-heading">30. What is the result of &#8216;hello&#8217;.length in Ruby?</h3>



<p class="wp-block-paragraph">a) 4<br>b) 5<br>c) 6<br>d) 7</p>



<h4 class="wp-block-heading">Answer: b) 5</h4>



<h3 class="wp-block-heading">31. Which of the following is not a valid way to create a range in Ruby?</h3>



<p class="wp-block-paragraph">a) 1..5<br>b) 1…5<br>c) (1, 5)<br>d) Range.new(1, 5)</p>



<h4 class="wp-block-heading">Answer: c) (1, 5)</h4>



<h3 class="wp-block-heading">32. What is the purpose of the &#8216;unless&#8217; keyword in Ruby?</h3>



<p class="wp-block-paragraph">a) To define a new variable<br>b) To define a new loop<br>c) To define a new method<br>d) To execute code only if a condition is false</p>



<h4 class="wp-block-heading">Answer: d) To execute code only if a condition is false</h4>



<h3 class="wp-block-heading">33. What is the result of &#8220;hello&#8221;.upcase in Ruby?</h3>



<p class="wp-block-paragraph">a) &#8220;hello&#8221;<br>b) &#8220;HELLO&#8221;<br>c) &#8220;Hello&#8221;<br>d) &#8220;hello world&#8221;</p>



<h4 class="wp-block-heading">Answer: b) &#8220;HELLO&#8221;</h4>



<h3 class="wp-block-heading">34. What is the difference between &#8216;include&#8217; and &#8216;extend&#8217; in Ruby?</h3>



<p class="wp-block-paragraph">a) There is no difference<br>b) &#8216;include&#8217; adds methods as instance methods, while &#8216;extend&#8217; adds methods as class methods<br>c) &#8216;extend&#8217; adds methods as instance methods, while &#8216;include&#8217; adds methods as class methods<br>d) &#8216;include&#8217; and &#8216;extend&#8217; are not valid Ruby commands</p>



<h4 class="wp-block-heading">Answer: b) &#8216;include&#8217; adds methods as instance methods, while &#8216;extend&#8217; adds methods as class methods</h4>



<h3 class="wp-block-heading">35. What is the result of [1,2,3].reduce(:+) in Ruby?</h3>



<p class="wp-block-paragraph">a) 6<br>b) [1,2,3]<br>c) [1, 3, 6]<br>d) Nothing is outputted</p>



<h4 class="wp-block-heading">Answer: a) 6</h4>



<h3 class="wp-block-heading">36. Which of the following is not a valid way to access a hash value in Ruby?</h3>



<p class="wp-block-paragraph">a) hash[key]<br>b) hash.fetch(key)<br>c) hash.get(key)<br>d) hash.values_at(key)</p>



<h4 class="wp-block-heading">Answer: c) hash.get(key)</h4>



<h3 class="wp-block-heading">37. What is the result of &#8220;hello&#8221;.index(&#8216;l&#8217;) in Ruby?</h3>



<p class="wp-block-paragraph">a) 0<br>b) 1<br>c) 2<br>d) 3</p>



<h4 class="wp-block-heading">Answer: b) 1</h4>



<h3 class="wp-block-heading">38. What does the following code do in Ruby?</h3>



<p class="wp-block-paragraph">class MyClass<br>def initializer<br>puts &#8220;Hello, world!&#8221;<br>end<br>end</p>



<p class="wp-block-paragraph">a) Defines a new method<br>b) Defines a new class<br>c) Prints &#8220;Hello, world!&#8221; to the console<br>d) There is a typo in the code and it will not run</p>



<h4 class="wp-block-heading">Answer: b) Defines a new class</h4>



<h3 class="wp-block-heading">39. What is the purpose of the &#8216;nil&#8217; keyword in Ruby?</h3>



<p class="wp-block-paragraph">a) To define a new variable<br>b) To indicate that a value is unknown or undefined<br>c) To stop the execution of a method and return a value<br>d) To refer to the current object</p>



<h4 class="wp-block-heading">Answer: b) To indicate that a value is unknown or undefined</h4>



<h3 class="wp-block-heading">40. What is the result of &#8216;hello&#8217;.include?(&#8216;lo&#8217;) in Ruby?</h3>



<p class="wp-block-paragraph">a) true<br>b) false<br>c) nil<br>d) There is a syntax error in the code</p>



<h4 class="wp-block-heading">Answer: a) true</h4>



<h3 class="wp-block-heading">41. What is the difference between &#8216;next&#8217; and &#8216;break&#8217; in Ruby?</h3>



<p class="wp-block-paragraph">a) There is no difference<br>b) &#8216;next&#8217; skips the current iteration of a loop, while &#8216;break&#8217; stops the loop entirely<br>c) &#8216;break&#8217; skips the current iteration of a loop, while &#8216;next&#8217; stops the loop entirely<br>d) &#8216;next&#8217; and &#8216;break&#8217; are not valid Ruby commands</p>



<h4 class="wp-block-heading">Answer: b) &#8216;next&#8217; skips the current iteration of a loop, while &#8216;break&#8217; stops the loop entirely</h4>



<h3 class="wp-block-heading">42. What is the result of &#8220;hello world&#8221;.capitalize in Ruby?</h3>



<p class="wp-block-paragraph">a) &#8220;hello world&#8221;<br>b) &#8220;Hello world&#8221;<br>c) &#8220;Hello World&#8221;<br>d) &#8220;hELLO WORLD&#8221;</p>



<h4 class="wp-block-heading">Answer: b) &#8220;Hello world&#8221;</h4>



<h3 class="wp-block-heading">43. What is the purpose of the &#8216;super&#8217; keyword in Ruby?</h3>



<p class="wp-block-paragraph">a) To refer to the current object<br>b) To call the parent method with the same name<br>c) To define a new class<br>d) To define a new module</p>



<h4 class="wp-block-heading">Answer: b) To call the parent method with the same name</h4>



<h3 class="wp-block-heading">44. What is the result of &#8220;hello&#8221;.concat(&#8221; world&#8221;) in Ruby?</h3>



<p class="wp-block-paragraph">a) &#8220;hello world&#8221;<br>b) &#8220;helloworld&#8221;<br>c) &#8220;worldhello&#8221;<br>d) &#8220;hell worldo&#8221;</p>



<h4 class="wp-block-heading">Answer: a) &#8220;hello world&#8221;</h4>



<h3 class="wp-block-heading">45. What is the difference between == and === in Ruby?</h3>



<p class="wp-block-paragraph">a) There is no difference<br>b) == is used for exact matches, while === is used for range comparisons<br>c) === is used for exact matches, while == is used for pattern matching<br>d) === is not a valid Ruby operator</p>



<h4 class="wp-block-heading">Answer: c) === is used for exact matches, while == is used for pattern matching</h4>



<h3 class="wp-block-heading">46. What is the result of [1,2,3].select { |x| x % 2 == 0 } in Ruby?</h3>



<p class="wp-block-paragraph">a) [1]<br>b) [2]<br>c) [3]<br>d) [2,3]</p>



<h4 class="wp-block-heading">Answer: b) [2]</h4>



<h3 class="wp-block-heading">47. What is the result of &#8220;hello&#8221;.delete(&#8216;lo&#8217;) in Ruby?</h3>



<p class="wp-block-paragraph">a) &#8220;hello&#8221;<br>b) &#8220;heo&#8221;<br>c) &#8220;ho&#8221;<br>d) &#8220;el&#8221;</p>



<h4 class="wp-block-heading">Answer: d) &#8220;el&#8221;</h4>



<h3 class="wp-block-heading">48. What is the result of (1..5).reduce(:*) in Ruby?</h3>



<p class="wp-block-paragraph">a) 120<br>b) [1,2,3,4,5]<br>c) [1,5,10,15,20,25]<br>d) Nothing is outputted</p>



<h4 class="wp-block-heading">Answer: a) 120</h4>



<h3 class="wp-block-heading">49. What is the purpose of the &#8216;eval&#8217; method in Ruby?</h3>



<p class="wp-block-paragraph">a) To define a new variable<br>b) To define a new method<br>c) To execute a string as Ruby code<br>d) To execute a file as Ruby code</p>



<h4 class="wp-block-heading">Answer: c) To execute a string as Ruby code</h4>



<h3 class="wp-block-heading">50. What is the difference between &#8216;private&#8217; and &#8216;protected&#8217; in Ruby?</h3>



<p class="wp-block-paragraph">a) There is no difference<br>b) &#8216;private&#8217; restricts access to a method to the current object, while &#8216;protected&#8217; restricts access to a method to the current object and its subclasses<br>c) &#8216;protected&#8217; restricts access to a method to the current object, while &#8216;private&#8217; restricts access to a method to the current object and its subclasses<br>d) &#8216;private&#8217; and &#8216;protected&#8217; are not valid Ruby commands</p>



<h4 class="wp-block-heading">Answer: b) &#8216;private&#8217; restricts access to a method to the current object, while &#8216;protected&#8217; restricts access to a method to the current object and its subclasses</h4>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/top-50-ruby-interview-questions-with-answers/">Top 50 Ruby Interview Questions with Answers</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/top-50-ruby-interview-questions-with-answers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Lets Understand the Ruby programming world in 5 mins!!!</title>
		<link>https://www.scmgalaxy.com/tutorials/lets-understand-the-ruby-programming-world-in-5-mins/</link>
					<comments>https://www.scmgalaxy.com/tutorials/lets-understand-the-ruby-programming-world-in-5-mins/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Fri, 01 Jun 2018 06:12:53 +0000</pubDate>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[bower]]></category>
		<category><![CDATA[Bundler]]></category>
		<category><![CDATA[Gem]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rake]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[yarn]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=4994</guid>

					<description><![CDATA[<p>Lets Understand the Ruby programming world in 5 mins? Ruby Ruby is a dynamic, interpreted, reflective, object-oriented, general-purpose programming language. [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/lets-understand-the-ruby-programming-world-in-5-mins/">Lets Understand the Ruby programming world in 5 mins!!!</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="alignnone size-full wp-image-5008" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2018/06/ruby-programming-languages.png" alt="" width="600" height="350" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2018/06/ruby-programming-languages.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2018/06/ruby-programming-languages-300x175.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p>Lets Understand the Ruby programming world in 5 mins?</p>
<p><strong>Ruby</strong><br />
Ruby is a dynamic, interpreted, reflective, object-oriented, general-purpose programming language. It was designed and developed in the mid-1990s by Yukihiro &#8220;Matz&#8221; Matsumoto in Japan. The Currnet most latest stable release is Ruby 2.5.</p>
<p><strong>Gem &#8211; A Ruby Package</strong><br />
A Gem is a Ruby application package which can contain anything from a collection of code to libraries, and/or list of dependencies that the packaged code actually needs to run.</p>
<p>Gems are formed of a structure similar to the following:</p>
<pre class="brush: plain; title: ; notranslate">
/&#x5B;package_name] # The main root directory of the Gem package.
|__ /bin # Location of the executable binaries if the package has any.
|__ /lib # Directory containing the main Ruby application code (inc. modules).
|__ /test # Location of test files.
|__ README #
|__ Rakefile # The Rake-file for libraries which use Rake for builds.
|__ &#x5B;name].gemspec # *.gemspec file, which has the name of the main directory, contains all package meta-data, e.g. name, version, directories etc.

</pre>
<p>One of the tools we will be using for creating Gems is Bundler.</p>
<p><strong>Bundler</strong><br />
Bundler a gem to bundle gems. Bundler makes sure Ruby applications run the same code on every machine.</p>
<p>It does this by managing the gems that the application depends on. Given a list of gems, it can automatically download and install those gems, as well as any other gems needed by the gems that are listed. Before installing gems, it checks the versions of every gem to make sure that they are compatible, and can all be loaded at the same time. After the gems have been installed, Bundler can help you update some or all of them when new versions become available. Finally, it records the exact versions that have been installed, so that others can install the exact same gems.</p>
<p><strong>RubyGems &#8211; A Package Manager</strong><br />
RubyGems is the default package manager for Ruby. It helps with all application package lifecycle from downloading to distributing Ruby applications and relevant binaries or libraries. RubyGems is a powerful package management tool which provides the developers a standardised structure for packing application in archives called Ruby Gem. The webiste is https://rubygems.org/</p>
<p><strong>Rake</strong><br />
Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax. you must write a “Rakefile” file which contains the build rules.</p>
<p><strong>Rails</strong><br />
Rails is a web application development framework written in the Ruby programming language. It is designed to make programming web applications easier by making assumptions about what every developer needs to get started. It allows you to write less code while accomplishing more than many other languages and frameworks. Experienced Rails developers also report that it makes web application development more fun.</p>
<p><strong>bower</strong><br />
Web sites are made of lots of things — frameworks, libraries, assets, and utilities. Bower manages all these things for you. Bower can manage components that contain HTML, CSS, JavaScript, fonts or even image files. Bower doesn’t concatenate or minify code or do anything else &#8211; it just installs the right versions of the packages you need and their dependencies.</p>
<p><strong>yarn</strong><br />
Yarn caches every package it has downloaded, so it never needs to download the same package again. It also does almost everything concurrently to maximize resource utilization. This means even faster installs.</p>
<p>If i have missed any tools which is important of Rudy ecospace, please mentioned in the comments sections.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/lets-understand-the-ruby-programming-world-in-5-mins/">Lets Understand the Ruby programming world in 5 mins!!!</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/lets-understand-the-ruby-programming-world-in-5-mins/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
