<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mvkantra</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mvkantra"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Mvkantra"/>
	<updated>2026-10-05T19:08:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54457</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4g ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54457"/>
		<updated>2011-10-31T18:16:05Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* History of Metaprogramming: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Metaprogramming?==&lt;br /&gt;
&lt;br /&gt;
Metaprogramming&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]&amp;lt;/ref&amp;gt; can change the way you program in your programming language. This is the most under used programming techniques. Metaprogramming is writing computer programs that manipulate other programs, or that which  do  a part of their work at compile time that would otherwise be done at runtime. This is very advantageous because it gives greater flexibility to programs to efficiently handle new situations without recompilation. Languages which provide metaprogramming are called metalanguages.  Metaprograms treat themselves as part of data and they can modify their own structure and behaviour. &lt;br /&gt;
&lt;br /&gt;
==History of Metaprogramming:==&lt;br /&gt;
&lt;br /&gt;
Not all metaprogramming involves [http://en.wikipedia.org/wiki/Automatic_programming generative programming]. If programs are modifiable at runtime or if an incremental compilation is available, then techniques can be used to perform metaprogramming without actually generating source code.&lt;br /&gt;
&lt;br /&gt;
Lisp first used metaprogramming by using macros as a standard facility to write code that will directly be read and compiled by the system at run time.&lt;br /&gt;
&lt;br /&gt;
In C-language, one of the popular examples of meta-programming is the [http://en.wikipedia.org/wiki/Yacc Lex/Yacc] system for generation of parsers and lexical scanners. That is, it reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in C. Instead of doing the laborious work of generating a parser in C, one can use Yacc to generate the repetitive parts of the program. Then, one can add only the code necessary to operate on the parsed entities.&lt;br /&gt;
&lt;br /&gt;
Template metaprogramming done in C++ is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions.&lt;br /&gt;
&lt;br /&gt;
Metaprogramming also exists in Java, C# and Prolog. Metaprogramming in  Java comprises of three main components reflection, generics, annotations.&lt;br /&gt;
&lt;br /&gt;
==Uses of Metaprogramming:&amp;lt;ref&amp;gt;[http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Metaprogramming&amp;lt;ref&amp;gt;[http://www.ibm.com/developerworks/linux/library/l-metaprog1/index.html Uses]&amp;lt;/ref&amp;gt; allows us to write programs that will pre-generate tables of data for use at runtime. For example, if a quick lookup table for the sine of all 8-bit integers is needed, then the sin can either be calculated and hand coded or the program can be made to build the table at startup at runtime or a program can used to build the custom code for the table before compile-time. While it may make sense to build the table at runtime for such a small set of numbers, other such tasks may cause program startup to be prohibitively slow. In such cases, writing a program to build static data tables is usually the best answer.&lt;br /&gt;
* A mini language can be created when there are a lot of functions which include a lot of boilerplate code. This mini language will do the boilerplate code and lets the user code only the important parts.&lt;br /&gt;
It is best to abstract out the boilerplate portions into a function. But often the boilerplate code isn't so pretty. Maybe there's a list of variables to be declared in every instance, or maybe there are several pieces of the boilerplate that have code inserted in certain circumstances. All of these make a simple function call impossible. In such cases, it is often a good idea to create a mini-language that allows the developer to work with the boilerplate code in an easier fashion. This mini-language will then be converted into your regular source code language before compiling.&lt;br /&gt;
Finally, a lot of programming languages make the developer write really verbose statements to do really simple things. Code-generating programs allow the developer to abbreviate such statements and save a lot of typing, which also prevents a lot of mistakes because there is less chance of mistyping.&lt;br /&gt;
&lt;br /&gt;
==Examples of metaprograms are:==&lt;br /&gt;
&lt;br /&gt;
* Compiler or interpreter of any language&lt;br /&gt;
* Lex and [http://en.wikipedia.org/wiki/Yacc Yacc]&lt;br /&gt;
* CORBA's IDL compiler&lt;br /&gt;
* Quine&lt;br /&gt;
* Programs to generate EJB code and XML from database metadata&lt;br /&gt;
* Enhanced Cweb.&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming in Ruby==&lt;br /&gt;
&lt;br /&gt;
===Aspects of Ruby make it easy for metaprogramming:===&lt;br /&gt;
&lt;br /&gt;
====Everything in Ruby is an object==== &lt;br /&gt;
&lt;br /&gt;
This means even native types in other languages such as Integer, Float, String and even the null value (‘nil’ in Ruby) is an object. So ruby doesn’t really have functions, if every single data is an object then every single action on the data is a method.&lt;br /&gt;
&lt;br /&gt;
Following example demonstrates that:&lt;br /&gt;
&lt;br /&gt;
 puts &amp;quot;cat&amp;quot;.class&lt;br /&gt;
 #Here's an iterator method being called on a simple Integer (Fixnum in Ruby)&lt;br /&gt;
 5.times { puts 'hi'}&lt;br /&gt;
 puts 5.class&lt;br /&gt;
&lt;br /&gt;
 #Even nil is an object!&lt;br /&gt;
 puts nil.class&lt;br /&gt;
&lt;br /&gt;
 #You can even define methods in nil! We'll be looking more at this later.&lt;br /&gt;
 def nil.hi&lt;br /&gt;
  puts 'hi!'&lt;br /&gt;
 end&lt;br /&gt;
 nil.hi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Classes and objects are open==== &lt;br /&gt;
&lt;br /&gt;
In Ruby classes are open,it means they are open for enhancing their functionality anytime i.e even at runtime.&amp;lt;ref&amp;gt;[http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 Suppose we have an array [1,2,3,4,5] and we want to find the sum of elements, so we invoke method called ‘sum’ on it.&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 #It gives us ‘No method error’&lt;br /&gt;
&lt;br /&gt;
So now we try to enhance the functionality of Array class by defining a method called sum on it&lt;br /&gt;
&lt;br /&gt;
 Class Array&lt;br /&gt;
  def sum&lt;br /&gt;
     inject(0){|s,v| s+v}&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Now lets try to invoke sum on the array&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 Output: 15&lt;br /&gt;
&lt;br /&gt;
====Code can be manipulated as data==== &lt;br /&gt;
&lt;br /&gt;
Ruby code can evaluate the contents of the string at runtime, which can be used to define classes and methods on the go at runtime.&amp;lt;ref&amp;gt;[http://www.slideshare.net/bsbodden/ruby-metaprogramming-08 http://www.slideshare.net/bsbodden/ruby-metaprogramming-08]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 # say_hello.rb&lt;br /&gt;
 puts “puts ‘Hello World !!’ “&lt;br /&gt;
&lt;br /&gt;
Code that invokes code&lt;br /&gt;
&lt;br /&gt;
 ruby –e “ ‘ruby say_hello.rb’ “&lt;br /&gt;
 Output: Hello World !!&lt;br /&gt;
&lt;br /&gt;
Ruby provides the ‘eval’ family of methods for runtime execution of code that is stored in strings&lt;br /&gt;
&lt;br /&gt;
*‘eval’ can evaluate any string. Other important methods of this family are instance_eval and class_eval.&lt;br /&gt;
 &lt;br /&gt;
 eval(“2*2”)&lt;br /&gt;
 Output: 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Instance_eval] evaluates string or a code block in the context of the receiver (object).&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.instance_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 # ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Class_eval] evaluates an string or a code block in the context of the class or module it is invoked on.&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.class_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 # ’hi’&lt;br /&gt;
&lt;br /&gt;
====Deep reflection capabilities==== &lt;br /&gt;
&lt;br /&gt;
In Ruby it's possible to read information about a class or object at runtime. We could use some of the methods like class(), instance_methods(), instance_variables()&amp;lt;ref&amp;gt;[http://www.khelll.com/blog/ruby/ruby-reflection/ http://www.khelll.com/blog/ruby/ruby-reflection/]&amp;lt;/ref&amp;gt; to do that.&lt;br /&gt;
&lt;br /&gt;
=====Example:=====&lt;br /&gt;
&lt;br /&gt;
 # The code in the following class definition is executed immediately&lt;br /&gt;
  &lt;br /&gt;
  Class Rubyist&lt;br /&gt;
   # the code in the following method definition is executed later,&lt;br /&gt;
   # when you eventually call the method&lt;br /&gt;
   &lt;br /&gt;
   def what_does_he_do&lt;br /&gt;
    @person = 'A Rubyist'&lt;br /&gt;
    'Ruby programming'&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  an_object = Rubyist.new&lt;br /&gt;
  puts an_object.class # =&amp;gt; Rubyist&lt;br /&gt;
  puts an_object.class.instance_methods(false) # =&amp;gt; what_does_he_do&lt;br /&gt;
  an_object.what_does_he_do&lt;br /&gt;
  puts an_object.instance_variables # =&amp;gt; @person&lt;br /&gt;
&lt;br /&gt;
===Meta programming techniques:===&lt;br /&gt;
&lt;br /&gt;
====Using Singleton Classes:&amp;lt;ref&amp;gt;[http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Singleton classes are used to implement instance specific behavior in Ruby.&amp;lt;ref&amp;gt;[http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/ http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/]&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 class MyClass &lt;br /&gt;
  def blah&lt;br /&gt;
    'blah'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj = MyClass.new&lt;br /&gt;
 obj.hi # =&amp;gt; NoMethodError&lt;br /&gt;
 &lt;br /&gt;
 def obj.hi&lt;br /&gt;
  'hi'&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj.hi # =&amp;gt; 'hi'&lt;br /&gt;
 &lt;br /&gt;
 another_obj = MyClass.new&lt;br /&gt;
 another_obj.hi # =&amp;gt; NoMethodError &lt;br /&gt;
 &lt;br /&gt;
 obj.class # =&amp;gt; MyClass&lt;br /&gt;
 another_obj.class # =&amp;gt; MyClass&lt;br /&gt;
&lt;br /&gt;
The above code shows one way to add instance-specific behavior. &lt;br /&gt;
&lt;br /&gt;
Interesting thing to note is that the new method is invokable only from the instance it was defined on and not from other instances of the same class. This means that the method was not added to the class of the instance.&lt;br /&gt;
&lt;br /&gt;
Does it mean an object itself can hold method definitions?&lt;br /&gt;
&lt;br /&gt;
Well, the answer is no (unless it's an object that represents a class or a module). One of the reasons the concept of classes exists in Ruby is that they are meant to hold method definitions and act as blueprints for their instances, ie, they determine what methods can be invoked on their instances.&lt;br /&gt;
&lt;br /&gt;
So where did the method 'hi' go?&lt;br /&gt;
&lt;br /&gt;
It goes into the singleton class of the instance. This hidden class is different from the class the instance was created from and is a Ruby implementation detail that is typically not revealed to anyone (there is only one way to get to the singleton class, which is discussed later in the article ). This is the reason it is sometimes called ghost class or anonymous class or shadow class. The singleton class is created for an object as soon as the Ruby interpreter needs to add instance-specific behavior for that object (but not before that). Going forward, if more methods need to be added to the same object, its already-created singleton class is used. Also, more instances cannot be created using a particular singleton class (its new method raises an error). Because of this one-to-one relationship between an object and its singleton class, the word 'singleton' is used.&lt;br /&gt;
&lt;br /&gt;
So, what is the way in which one can get access to an object's singleton class?&lt;br /&gt;
&lt;br /&gt;
 # ... in continuation from previous snippet &lt;br /&gt;
 obj_singleton_class = class &amp;lt;&amp;lt; obj; self; end&lt;br /&gt;
 obj_singleton_class.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
 MyClass.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
&lt;br /&gt;
Here class &amp;lt;&amp;lt; obj; self; end is the key: anything written after class &amp;lt;&amp;lt; obj and before the corresponding end is evaluated against the context of the singleton class of obj, ie, selfpoints to the singleton class.&lt;br /&gt;
&lt;br /&gt;
In the above snippet, we return self, getting a reference to it in the variable obj_singleton_class. We then see that the singleton class fakes the same ancestry as the original class of the object. This implies that when a method is invoked on an object, Ruby first looks for the method definition in the object's singleton class (if it exists), if not, Ruby then continues looking up the normal inheritance hierarchy.&lt;br /&gt;
 &lt;br /&gt;
 # ... in continuation from previous snippet&lt;br /&gt;
 obj.hi # method looked for in singleton class; found; invoked&lt;br /&gt;
 obj.blah # method looked for in singleton class; not found; looked for in MyClass; found; invoked&lt;br /&gt;
 obj.xyz # method looked for in singleton class, MyClass, Object, Kernel; not found; obj.method_missing() called, raising NoMethodError&lt;br /&gt;
&lt;br /&gt;
Let's quickly look at two other ways in which we could have added instance-specific behavior to an object:&lt;br /&gt;
 class &amp;lt;&amp;lt; obj&lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 obj.instance_eval do&lt;br /&gt;
  &lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The former one should be clear from what has already been explained. The latter is tied to how def works with instance_eval (which is explained earlier in this article).&lt;br /&gt;
Now, before concluding, let's take a step back and see if we've seen the syntax discussed so far, before. You'll probably recognize their use in defining class-level methods:&lt;br /&gt;
 &lt;br /&gt;
 Class MyClass&lt;br /&gt;
  def MyClass.my_class_method1&lt;br /&gt;
    'class method 1'&lt;br /&gt;
  end&lt;br /&gt;
  def self.my_class_method2&lt;br /&gt;
    'class method 2'&lt;br /&gt;
  end&lt;br /&gt;
  class &amp;lt;&amp;lt; self&lt;br /&gt;
    def my_class_method3&lt;br /&gt;
      'class method 3'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Here all class methods go into the singleton class of the object representing the class, in this case, the object referenced by the constant name:MyClass (remember classes are also objects). After all, these class method definitions need to go somewhere, and in such a way that the methods don't become part of the class's instances (ie, they aren't instance methods) nor do the methods go to the super class.&lt;br /&gt;
&lt;br /&gt;
====Defining methods on the fly:&amp;lt;ref&amp;gt;[http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/ http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Ruby has the ability to define methods on the fly using ‘define_method’&amp;lt;ref&amp;gt;[http://metaclass.org/2007/9/18/define-method http://metaclass.org/2007/9/18/define-method]&amp;lt;/ref&amp;gt;, method_missing, [http://www.infoq.com/articles/eval-options-in-ruby ‘eval’] family methods. &lt;br /&gt;
&lt;br /&gt;
=====Using 'eval' family methods :&amp;lt;ref&amp;gt;[http://ilikestuffblog.com/2009/01/09/fun-with-rubys-instance_eval-and-class_eval/]&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
This is illustrated by following example.&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      class_eval “def greet_in_#{language}; puts ‘#{greeting}’; end”&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
 alan=Person.new&lt;br /&gt;
 alan.greet_in_English&lt;br /&gt;
 #Hello!&lt;br /&gt;
&lt;br /&gt;
 p=Person&lt;br /&gt;
 p.make_greeting(“dutch”,”Hallo!”)&lt;br /&gt;
 lisa=p.new&lt;br /&gt;
 lisa.greet_in_dutch&lt;br /&gt;
 #Hallo!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above example is used to create greetings in different languages on the go. A new greeting is created in make_greeting method, which uses class_eval to evaluate the string that defines a method for a ‘language’ (argument for the make_greeting method). As the method defined using class_val it would in the scope of the entire class (Person). Now to access greet_in_English method we need to create an object and use it to invoke the method. Now to define method at runtime we can invoke make_greeting method using the class (Person.make_greeting(language,greeting)).  And now the newly defined method is available for access by any Person’s object.&lt;br /&gt;
&lt;br /&gt;
The same functionality can be achieved by define method in following was:&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      define_method  “greet_in_#{language};” do &lt;br /&gt;
        puts “#{greeting}”&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
====Defining methods using method_missing:&amp;lt;ref&amp;gt;[http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://technicalpickles.com/posts/using-method_missing-and-respond_to-to-create-dynamic-methods/&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
One of the ways Ruby is dynamic is that we can choose how to handle methods that are called, but don’t actually exist. If we have a lot of very similar methods, we can even use this to define them all at once. Ruby does this using the method_missing method, which we override in the classes where we need more dynamic method calling.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by using following example&amp;lt;ref&amp;gt;[http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/ http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/]&amp;lt;/ref&amp;gt; which creates a widget that store any attribute that is given to it.&lt;br /&gt;
&lt;br /&gt;
 # lib/widget.rb&lt;br /&gt;
 Class Widget&lt;br /&gt;
  def method_missing sym, *args&lt;br /&gt;
    if sym =~ /^(\w+)=$/&lt;br /&gt;
      instance_variable_set &amp;quot;@#{$1}&amp;quot;, args[0]&lt;br /&gt;
    else&lt;br /&gt;
      instance_variable_get &amp;quot;@#{sym}&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 widget = Widget.new&lt;br /&gt;
 #&amp;lt;Widget:0x0000010383f618&amp;gt;&lt;br /&gt;
 widget.name = 'Bob'&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age = 30&lt;br /&gt;
 # 30&lt;br /&gt;
 widget.name&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age&lt;br /&gt;
 # 30&lt;br /&gt;
&lt;br /&gt;
We have a created Widget and no methods are defined in it, so whenever a method is invoked it would call method missing. In method it is looking for a command with ‘=’ symbol that means it assigning something, so if that is the case it would put that variable into the instance variable set for later retrieval. If the command doesn’t have ‘=’ it is simply displaying the attributes from the instance variable set.&lt;br /&gt;
&lt;br /&gt;
====Aliasing:&amp;lt;ref&amp;gt;[http://pragprog.com/book/ppmetr/metaprogramming-ruby Aliasing]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
To alias a method or variable name in Ruby is to create a second name for the method or variable. Aliasing can be used either to provide more expressive options to the programmer using the class, or to help override methods and change the behavior of the class or object. We can redefine a method in an existing class by opening it up and rewriting it, but since we cannot loose the behaviour provided by the original method, we can use alias_method.&lt;br /&gt;
 alias        :new  :old&lt;br /&gt;
 alias_method :new, :old&lt;br /&gt;
&lt;br /&gt;
Syntax&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.ruby-forum.com/topic/135598 http://www.ruby-forum.com/topic/135598]&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 alias method-name method-name&lt;br /&gt;
 alias global-variable-name global-variable-name&lt;br /&gt;
&lt;br /&gt;
Creates a new reference to whatever old referred to. old can be any existing method, operator, global. It may not be a local, instance, constant, or class variable. Alias_method is used when there is a need to override a method but still count on its old behaviour. 	&lt;br /&gt;
 &lt;br /&gt;
Example1:&lt;br /&gt;
&lt;br /&gt;
 alias foo bar  -&amp;gt; Creates a foo alias for bar&lt;br /&gt;
&lt;br /&gt;
 alias $MATCH $&amp;amp; -&amp;gt; $MATCH is an alias for $&amp;amp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
&lt;br /&gt;
 1.	def oldmtd  &lt;br /&gt;
 2.	  &amp;quot;old method&amp;quot;  &lt;br /&gt;
 3.	end  &lt;br /&gt;
 4.	alias newmtd oldmtd  &lt;br /&gt;
 5.	def oldmtd  &lt;br /&gt;
 6.	  &amp;quot;old improved method&amp;quot;  &lt;br /&gt;
 7.	end  &lt;br /&gt;
 8.	puts oldmtd  &lt;br /&gt;
 9.	puts newmtd  &lt;br /&gt;
&lt;br /&gt;
The output is:&lt;br /&gt;
 1.	old improved method  &lt;br /&gt;
 2.	old method  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local variables, instance variables, class variables and constants may not be aliased. The parameters to alias may be names or symbols.  When a method is aliased, the new name refers to a copy of the original method’s body. If the method is subsequently redefined, the aliased name will still invoke the original implementation. Aliases cannot be defined within the method body. The alias of the method keeps the current definition of the method even when the methods are overridden.&lt;br /&gt;
Making aliases for the numbered global variables ($1,$2,….) is prohibited. Overriding the built in global variables may cause serious problems.&lt;br /&gt;
&lt;br /&gt;
====Modules:====&lt;br /&gt;
&lt;br /&gt;
Module&amp;lt;ref&amp;gt;[http://www.rubyist.net/~slagell/ruby/modules.html Modules]&amp;lt;/ref&amp;gt; is just a bunch of instance methods. A class is just a module but has certain additional features like a superclass and a new() method. The main reason for having both modules and class in Ruby is to make the code more explicit. A module&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html]&amp;lt;/ref&amp;gt; is used in situations where it has to be included somewhere or when it needs to be used as a namespace. A class is used when it needs to be instantiated or inherited.&lt;br /&gt;
A module can be included by a class. A module can be shared between and included by multiple classes at the same time.  Modules can be used to organize constants in the same way as directories are used to organize files.&lt;br /&gt;
	&lt;br /&gt;
Example&amp;lt;ref&amp;gt;[http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/ http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
 module Stats&lt;br /&gt;
  def max_health&lt;br /&gt;
    100&lt;br /&gt;
  end&lt;br /&gt;
  def constitution&lt;br /&gt;
    50&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 class Character&lt;br /&gt;
  include Stats&lt;br /&gt;
  attr_accessor:name&lt;br /&gt;
  attr_accessor:location&lt;br /&gt;
  def talk; end&lt;br /&gt;
  def walk; end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
In the above example we have extracted max_health and constitution into a module. The Character class incudes the Stats module. Whenever a method  is called on an instance of Character, that cannot be found in the referenced class, Ruby will look if the method can be found in one of the included modules. This is not the same as inheritance. Multiple modules can be included at the same time.&lt;br /&gt;
 Modules define a namespace, a sandbox in which your methods and constants can play without having to worry about being stepped on by other methods and constants.&lt;br /&gt;
include mixes a module into a class or another module. Methods from that the module are called function-style (without a receiver).&lt;br /&gt;
&lt;br /&gt;
Extend keyword can be used to extend a single functionality for the object. Adds to object the instance methods from each module given as a parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 module Mod&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 class Klass&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 k = Klass.new&lt;br /&gt;
 k.hello	»	&amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
 k.extend(Mod)	» #&amp;lt;Klass:0x401b598c&amp;gt;&lt;br /&gt;
 k.hello	» &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extend is used to include a module in an object(instance). Methods in the module become methods in the object&lt;br /&gt;
&lt;br /&gt;
The possibilities meta programing opens up seem to be endless. Joining on the way are endless possibilities to do something wrong.  “with great power comes great responsibility”&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[http://pedromtavares.wordpress.com/2010/02/24/ruby-object-model-and-metaprogramming/ More About Metaprogramming]&lt;br /&gt;
&lt;br /&gt;
[http://www.devalot.com/articles/2008/09/ruby-singleton More about Singleton Classes]&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54456</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4g ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54456"/>
		<updated>2011-10-31T18:08:12Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* History of Metaprogramming: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Metaprogramming?==&lt;br /&gt;
&lt;br /&gt;
Metaprogramming&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]&amp;lt;/ref&amp;gt; can change the way you program in your programming language. This is the most under used programming techniques. Metaprogramming is writing computer programs that manipulate other programs, or that which  do  a part of their work at compile time that would otherwise be done at runtime. This is very advantageous because it gives greater flexibility to programs to efficiently handle new situations without recompilation. Languages which provide metaprogramming are called metalanguages.  Metaprograms treat themselves as part of data and they can modify their own structure and behaviour. &lt;br /&gt;
&lt;br /&gt;
==History of Metaprogramming:==&lt;br /&gt;
&lt;br /&gt;
Not all metaprogramming involves [http://en.wikipedia.org/wiki/Automatic_programming generative programming]. If programs are modifiable at runtime or if an incremental compilation is available, then techniques can be used to perform metaprogramming without actually generating source code.&lt;br /&gt;
&lt;br /&gt;
Template metaprogramming is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions.&lt;br /&gt;
&lt;br /&gt;
In C-language, one of the popular examples of meta-programming is the [http://en.wikipedia.org/wiki/Yacc Lex/Yacc] system for generation of parsers and lexical scanners. That is, it reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in C. Instead of doing the laborious work of generating a parser in C, one can use Yacc to generate the repetitive parts of the program. Then, one can add only the code necessary to operate on the parsed entities.&lt;br /&gt;
&lt;br /&gt;
Metaprogramming in Java comprises of three main components reflection, generics, annotations.&lt;br /&gt;
&lt;br /&gt;
==Uses of Metaprogramming:&amp;lt;ref&amp;gt;[http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Metaprogramming&amp;lt;ref&amp;gt;[http://www.ibm.com/developerworks/linux/library/l-metaprog1/index.html Uses]&amp;lt;/ref&amp;gt; allows us to write programs that will pre-generate tables of data for use at runtime. For example, if a quick lookup table for the sine of all 8-bit integers is needed, then the sin can either be calculated and hand coded or the program can be made to build the table at startup at runtime or a program can used to build the custom code for the table before compile-time. While it may make sense to build the table at runtime for such a small set of numbers, other such tasks may cause program startup to be prohibitively slow. In such cases, writing a program to build static data tables is usually the best answer.&lt;br /&gt;
* A mini language can be created when there are a lot of functions which include a lot of boilerplate code. This mini language will do the boilerplate code and lets the user code only the important parts.&lt;br /&gt;
It is best to abstract out the boilerplate portions into a function. But often the boilerplate code isn't so pretty. Maybe there's a list of variables to be declared in every instance, or maybe there are several pieces of the boilerplate that have code inserted in certain circumstances. All of these make a simple function call impossible. In such cases, it is often a good idea to create a mini-language that allows the developer to work with the boilerplate code in an easier fashion. This mini-language will then be converted into your regular source code language before compiling.&lt;br /&gt;
Finally, a lot of programming languages make the developer write really verbose statements to do really simple things. Code-generating programs allow the developer to abbreviate such statements and save a lot of typing, which also prevents a lot of mistakes because there is less chance of mistyping.&lt;br /&gt;
&lt;br /&gt;
==Examples of metaprograms are:==&lt;br /&gt;
&lt;br /&gt;
* Compiler or interpreter of any language&lt;br /&gt;
* Lex and [http://en.wikipedia.org/wiki/Yacc Yacc]&lt;br /&gt;
* CORBA's IDL compiler&lt;br /&gt;
* Quine&lt;br /&gt;
* Programs to generate EJB code and XML from database metadata&lt;br /&gt;
* Enhanced Cweb.&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming in Ruby==&lt;br /&gt;
&lt;br /&gt;
===Aspects of Ruby make it easy for metaprogramming:===&lt;br /&gt;
&lt;br /&gt;
====Everything in Ruby is an object==== &lt;br /&gt;
&lt;br /&gt;
This means even native types in other languages such as Integer, Float, String and even the null value (‘nil’ in Ruby) is an object. So ruby doesn’t really have functions, if every single data is an object then every single action on the data is a method.&lt;br /&gt;
&lt;br /&gt;
Following example demonstrates that:&lt;br /&gt;
&lt;br /&gt;
 puts &amp;quot;cat&amp;quot;.class&lt;br /&gt;
 #Here's an iterator method being called on a simple Integer (Fixnum in Ruby)&lt;br /&gt;
 5.times { puts 'hi'}&lt;br /&gt;
 puts 5.class&lt;br /&gt;
&lt;br /&gt;
 #Even nil is an object!&lt;br /&gt;
 puts nil.class&lt;br /&gt;
&lt;br /&gt;
 #You can even define methods in nil! We'll be looking more at this later.&lt;br /&gt;
 def nil.hi&lt;br /&gt;
  puts 'hi!'&lt;br /&gt;
 end&lt;br /&gt;
 nil.hi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Classes and objects are open==== &lt;br /&gt;
&lt;br /&gt;
In Ruby classes are open,it means they are open for enhancing their functionality anytime i.e even at runtime.&amp;lt;ref&amp;gt;[http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 Suppose we have an array [1,2,3,4,5] and we want to find the sum of elements, so we invoke method called ‘sum’ on it.&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 #It gives us ‘No method error’&lt;br /&gt;
&lt;br /&gt;
So now we try to enhance the functionality of Array class by defining a method called sum on it&lt;br /&gt;
&lt;br /&gt;
 Class Array&lt;br /&gt;
  def sum&lt;br /&gt;
     inject(0){|s,v| s+v}&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Now lets try to invoke sum on the array&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 Output: 15&lt;br /&gt;
&lt;br /&gt;
====Code can be manipulated as data==== &lt;br /&gt;
&lt;br /&gt;
Ruby code can evaluate the contents of the string at runtime, which can be used to define classes and methods on the go at runtime.&amp;lt;ref&amp;gt;[http://www.slideshare.net/bsbodden/ruby-metaprogramming-08 http://www.slideshare.net/bsbodden/ruby-metaprogramming-08]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 # say_hello.rb&lt;br /&gt;
 puts “puts ‘Hello World !!’ “&lt;br /&gt;
&lt;br /&gt;
Code that invokes code&lt;br /&gt;
&lt;br /&gt;
 ruby –e “ ‘ruby say_hello.rb’ “&lt;br /&gt;
 Output: Hello World !!&lt;br /&gt;
&lt;br /&gt;
Ruby provides the ‘eval’ family of methods for runtime execution of code that is stored in strings&lt;br /&gt;
&lt;br /&gt;
*‘eval’ can evaluate any string. Other important methods of this family are instance_eval and class_eval.&lt;br /&gt;
 &lt;br /&gt;
 eval(“2*2”)&lt;br /&gt;
 Output: 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Instance_eval] evaluates string or a code block in the context of the receiver (object).&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.instance_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 # ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Class_eval] evaluates an string or a code block in the context of the class or module it is invoked on.&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.class_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 # ’hi’&lt;br /&gt;
&lt;br /&gt;
====Deep reflection capabilities==== &lt;br /&gt;
&lt;br /&gt;
In Ruby it's possible to read information about a class or object at runtime. We could use some of the methods like class(), instance_methods(), instance_variables()&amp;lt;ref&amp;gt;[http://www.khelll.com/blog/ruby/ruby-reflection/ http://www.khelll.com/blog/ruby/ruby-reflection/]&amp;lt;/ref&amp;gt; to do that.&lt;br /&gt;
&lt;br /&gt;
=====Example:=====&lt;br /&gt;
&lt;br /&gt;
 # The code in the following class definition is executed immediately&lt;br /&gt;
  &lt;br /&gt;
  Class Rubyist&lt;br /&gt;
   # the code in the following method definition is executed later,&lt;br /&gt;
   # when you eventually call the method&lt;br /&gt;
   &lt;br /&gt;
   def what_does_he_do&lt;br /&gt;
    @person = 'A Rubyist'&lt;br /&gt;
    'Ruby programming'&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  an_object = Rubyist.new&lt;br /&gt;
  puts an_object.class # =&amp;gt; Rubyist&lt;br /&gt;
  puts an_object.class.instance_methods(false) # =&amp;gt; what_does_he_do&lt;br /&gt;
  an_object.what_does_he_do&lt;br /&gt;
  puts an_object.instance_variables # =&amp;gt; @person&lt;br /&gt;
&lt;br /&gt;
===Meta programming techniques:===&lt;br /&gt;
&lt;br /&gt;
====Using Singleton Classes:&amp;lt;ref&amp;gt;[http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Singleton classes are used to implement instance specific behavior in Ruby.&amp;lt;ref&amp;gt;[http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/ http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/]&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 class MyClass &lt;br /&gt;
  def blah&lt;br /&gt;
    'blah'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj = MyClass.new&lt;br /&gt;
 obj.hi # =&amp;gt; NoMethodError&lt;br /&gt;
 &lt;br /&gt;
 def obj.hi&lt;br /&gt;
  'hi'&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj.hi # =&amp;gt; 'hi'&lt;br /&gt;
 &lt;br /&gt;
 another_obj = MyClass.new&lt;br /&gt;
 another_obj.hi # =&amp;gt; NoMethodError &lt;br /&gt;
 &lt;br /&gt;
 obj.class # =&amp;gt; MyClass&lt;br /&gt;
 another_obj.class # =&amp;gt; MyClass&lt;br /&gt;
&lt;br /&gt;
The above code shows one way to add instance-specific behavior. &lt;br /&gt;
&lt;br /&gt;
Interesting thing to note is that the new method is invokable only from the instance it was defined on and not from other instances of the same class. This means that the method was not added to the class of the instance.&lt;br /&gt;
&lt;br /&gt;
Does it mean an object itself can hold method definitions?&lt;br /&gt;
&lt;br /&gt;
Well, the answer is no (unless it's an object that represents a class or a module). One of the reasons the concept of classes exists in Ruby is that they are meant to hold method definitions and act as blueprints for their instances, ie, they determine what methods can be invoked on their instances.&lt;br /&gt;
&lt;br /&gt;
So where did the method 'hi' go?&lt;br /&gt;
&lt;br /&gt;
It goes into the singleton class of the instance. This hidden class is different from the class the instance was created from and is a Ruby implementation detail that is typically not revealed to anyone (there is only one way to get to the singleton class, which is discussed later in the article ). This is the reason it is sometimes called ghost class or anonymous class or shadow class. The singleton class is created for an object as soon as the Ruby interpreter needs to add instance-specific behavior for that object (but not before that). Going forward, if more methods need to be added to the same object, its already-created singleton class is used. Also, more instances cannot be created using a particular singleton class (its new method raises an error). Because of this one-to-one relationship between an object and its singleton class, the word 'singleton' is used.&lt;br /&gt;
&lt;br /&gt;
So, what is the way in which one can get access to an object's singleton class?&lt;br /&gt;
&lt;br /&gt;
 # ... in continuation from previous snippet &lt;br /&gt;
 obj_singleton_class = class &amp;lt;&amp;lt; obj; self; end&lt;br /&gt;
 obj_singleton_class.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
 MyClass.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
&lt;br /&gt;
Here class &amp;lt;&amp;lt; obj; self; end is the key: anything written after class &amp;lt;&amp;lt; obj and before the corresponding end is evaluated against the context of the singleton class of obj, ie, selfpoints to the singleton class.&lt;br /&gt;
&lt;br /&gt;
In the above snippet, we return self, getting a reference to it in the variable obj_singleton_class. We then see that the singleton class fakes the same ancestry as the original class of the object. This implies that when a method is invoked on an object, Ruby first looks for the method definition in the object's singleton class (if it exists), if not, Ruby then continues looking up the normal inheritance hierarchy.&lt;br /&gt;
 &lt;br /&gt;
 # ... in continuation from previous snippet&lt;br /&gt;
 obj.hi # method looked for in singleton class; found; invoked&lt;br /&gt;
 obj.blah # method looked for in singleton class; not found; looked for in MyClass; found; invoked&lt;br /&gt;
 obj.xyz # method looked for in singleton class, MyClass, Object, Kernel; not found; obj.method_missing() called, raising NoMethodError&lt;br /&gt;
&lt;br /&gt;
Let's quickly look at two other ways in which we could have added instance-specific behavior to an object:&lt;br /&gt;
 class &amp;lt;&amp;lt; obj&lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 obj.instance_eval do&lt;br /&gt;
  &lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The former one should be clear from what has already been explained. The latter is tied to how def works with instance_eval (which is explained earlier in this article).&lt;br /&gt;
Now, before concluding, let's take a step back and see if we've seen the syntax discussed so far, before. You'll probably recognize their use in defining class-level methods:&lt;br /&gt;
 &lt;br /&gt;
 Class MyClass&lt;br /&gt;
  def MyClass.my_class_method1&lt;br /&gt;
    'class method 1'&lt;br /&gt;
  end&lt;br /&gt;
  def self.my_class_method2&lt;br /&gt;
    'class method 2'&lt;br /&gt;
  end&lt;br /&gt;
  class &amp;lt;&amp;lt; self&lt;br /&gt;
    def my_class_method3&lt;br /&gt;
      'class method 3'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Here all class methods go into the singleton class of the object representing the class, in this case, the object referenced by the constant name:MyClass (remember classes are also objects). After all, these class method definitions need to go somewhere, and in such a way that the methods don't become part of the class's instances (ie, they aren't instance methods) nor do the methods go to the super class.&lt;br /&gt;
&lt;br /&gt;
====Defining methods on the fly:&amp;lt;ref&amp;gt;[http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/ http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Ruby has the ability to define methods on the fly using ‘define_method’&amp;lt;ref&amp;gt;[http://metaclass.org/2007/9/18/define-method http://metaclass.org/2007/9/18/define-method]&amp;lt;/ref&amp;gt;, method_missing, [http://www.infoq.com/articles/eval-options-in-ruby ‘eval’] family methods. &lt;br /&gt;
&lt;br /&gt;
=====Using 'eval' family methods :&amp;lt;ref&amp;gt;[http://ilikestuffblog.com/2009/01/09/fun-with-rubys-instance_eval-and-class_eval/]&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
This is illustrated by following example.&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      class_eval “def greet_in_#{language}; puts ‘#{greeting}’; end”&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
 alan=Person.new&lt;br /&gt;
 alan.greet_in_English&lt;br /&gt;
 #Hello!&lt;br /&gt;
&lt;br /&gt;
 p=Person&lt;br /&gt;
 p.make_greeting(“dutch”,”Hallo!”)&lt;br /&gt;
 lisa=p.new&lt;br /&gt;
 lisa.greet_in_dutch&lt;br /&gt;
 #Hallo!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above example is used to create greetings in different languages on the go. A new greeting is created in make_greeting method, which uses class_eval to evaluate the string that defines a method for a ‘language’ (argument for the make_greeting method). As the method defined using class_val it would in the scope of the entire class (Person). Now to access greet_in_English method we need to create an object and use it to invoke the method. Now to define method at runtime we can invoke make_greeting method using the class (Person.make_greeting(language,greeting)).  And now the newly defined method is available for access by any Person’s object.&lt;br /&gt;
&lt;br /&gt;
The same functionality can be achieved by define method in following was:&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      define_method  “greet_in_#{language};” do &lt;br /&gt;
        puts “#{greeting}”&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
====Defining methods using method_missing:&amp;lt;ref&amp;gt;[http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://technicalpickles.com/posts/using-method_missing-and-respond_to-to-create-dynamic-methods/&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
One of the ways Ruby is dynamic is that we can choose how to handle methods that are called, but don’t actually exist. If we have a lot of very similar methods, we can even use this to define them all at once. Ruby does this using the method_missing method, which we override in the classes where we need more dynamic method calling.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by using following example&amp;lt;ref&amp;gt;[http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/ http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/]&amp;lt;/ref&amp;gt; which creates a widget that store any attribute that is given to it.&lt;br /&gt;
&lt;br /&gt;
 # lib/widget.rb&lt;br /&gt;
 Class Widget&lt;br /&gt;
  def method_missing sym, *args&lt;br /&gt;
    if sym =~ /^(\w+)=$/&lt;br /&gt;
      instance_variable_set &amp;quot;@#{$1}&amp;quot;, args[0]&lt;br /&gt;
    else&lt;br /&gt;
      instance_variable_get &amp;quot;@#{sym}&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 widget = Widget.new&lt;br /&gt;
 #&amp;lt;Widget:0x0000010383f618&amp;gt;&lt;br /&gt;
 widget.name = 'Bob'&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age = 30&lt;br /&gt;
 # 30&lt;br /&gt;
 widget.name&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age&lt;br /&gt;
 # 30&lt;br /&gt;
&lt;br /&gt;
We have a created Widget and no methods are defined in it, so whenever a method is invoked it would call method missing. In method it is looking for a command with ‘=’ symbol that means it assigning something, so if that is the case it would put that variable into the instance variable set for later retrieval. If the command doesn’t have ‘=’ it is simply displaying the attributes from the instance variable set.&lt;br /&gt;
&lt;br /&gt;
====Aliasing:&amp;lt;ref&amp;gt;[http://pragprog.com/book/ppmetr/metaprogramming-ruby Aliasing]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
To alias a method or variable name in Ruby is to create a second name for the method or variable. Aliasing can be used either to provide more expressive options to the programmer using the class, or to help override methods and change the behavior of the class or object. We can redefine a method in an existing class by opening it up and rewriting it, but since we cannot loose the behaviour provided by the original method, we can use alias_method.&lt;br /&gt;
 alias        :new  :old&lt;br /&gt;
 alias_method :new, :old&lt;br /&gt;
&lt;br /&gt;
Syntax&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.ruby-forum.com/topic/135598 http://www.ruby-forum.com/topic/135598]&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 alias method-name method-name&lt;br /&gt;
 alias global-variable-name global-variable-name&lt;br /&gt;
&lt;br /&gt;
Creates a new reference to whatever old referred to. old can be any existing method, operator, global. It may not be a local, instance, constant, or class variable. Alias_method is used when there is a need to override a method but still count on its old behaviour. 	&lt;br /&gt;
 &lt;br /&gt;
Example1:&lt;br /&gt;
&lt;br /&gt;
 alias foo bar  -&amp;gt; Creates a foo alias for bar&lt;br /&gt;
&lt;br /&gt;
 alias $MATCH $&amp;amp; -&amp;gt; $MATCH is an alias for $&amp;amp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
&lt;br /&gt;
 1.	def oldmtd  &lt;br /&gt;
 2.	  &amp;quot;old method&amp;quot;  &lt;br /&gt;
 3.	end  &lt;br /&gt;
 4.	alias newmtd oldmtd  &lt;br /&gt;
 5.	def oldmtd  &lt;br /&gt;
 6.	  &amp;quot;old improved method&amp;quot;  &lt;br /&gt;
 7.	end  &lt;br /&gt;
 8.	puts oldmtd  &lt;br /&gt;
 9.	puts newmtd  &lt;br /&gt;
&lt;br /&gt;
The output is:&lt;br /&gt;
 1.	old improved method  &lt;br /&gt;
 2.	old method  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local variables, instance variables, class variables and constants may not be aliased. The parameters to alias may be names or symbols.  When a method is aliased, the new name refers to a copy of the original method’s body. If the method is subsequently redefined, the aliased name will still invoke the original implementation. Aliases cannot be defined within the method body. The alias of the method keeps the current definition of the method even when the methods are overridden.&lt;br /&gt;
Making aliases for the numbered global variables ($1,$2,….) is prohibited. Overriding the built in global variables may cause serious problems.&lt;br /&gt;
&lt;br /&gt;
====Modules:====&lt;br /&gt;
&lt;br /&gt;
Module&amp;lt;ref&amp;gt;[http://www.rubyist.net/~slagell/ruby/modules.html Modules]&amp;lt;/ref&amp;gt; is just a bunch of instance methods. A class is just a module but has certain additional features like a superclass and a new() method. The main reason for having both modules and class in Ruby is to make the code more explicit. A module&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html]&amp;lt;/ref&amp;gt; is used in situations where it has to be included somewhere or when it needs to be used as a namespace. A class is used when it needs to be instantiated or inherited.&lt;br /&gt;
A module can be included by a class. A module can be shared between and included by multiple classes at the same time.  Modules can be used to organize constants in the same way as directories are used to organize files.&lt;br /&gt;
	&lt;br /&gt;
Example&amp;lt;ref&amp;gt;[http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/ http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
 module Stats&lt;br /&gt;
  def max_health&lt;br /&gt;
    100&lt;br /&gt;
  end&lt;br /&gt;
  def constitution&lt;br /&gt;
    50&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 class Character&lt;br /&gt;
  include Stats&lt;br /&gt;
  attr_accessor:name&lt;br /&gt;
  attr_accessor:location&lt;br /&gt;
  def talk; end&lt;br /&gt;
  def walk; end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
In the above example we have extracted max_health and constitution into a module. The Character class incudes the Stats module. Whenever a method  is called on an instance of Character, that cannot be found in the referenced class, Ruby will look if the method can be found in one of the included modules. This is not the same as inheritance. Multiple modules can be included at the same time.&lt;br /&gt;
 Modules define a namespace, a sandbox in which your methods and constants can play without having to worry about being stepped on by other methods and constants.&lt;br /&gt;
include mixes a module into a class or another module. Methods from that the module are called function-style (without a receiver).&lt;br /&gt;
&lt;br /&gt;
Extend keyword can be used to extend a single functionality for the object. Adds to object the instance methods from each module given as a parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 module Mod&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 class Klass&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 k = Klass.new&lt;br /&gt;
 k.hello	»	&amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
 k.extend(Mod)	» #&amp;lt;Klass:0x401b598c&amp;gt;&lt;br /&gt;
 k.hello	» &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extend is used to include a module in an object(instance). Methods in the module become methods in the object&lt;br /&gt;
&lt;br /&gt;
The possibilities meta programing opens up seem to be endless. Joining on the way are endless possibilities to do something wrong.  “with great power comes great responsibility”&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[http://pedromtavares.wordpress.com/2010/02/24/ruby-object-model-and-metaprogramming/ More About Metaprogramming]&lt;br /&gt;
&lt;br /&gt;
[http://www.devalot.com/articles/2008/09/ruby-singleton More about Singleton Classes]&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54149</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4g ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54149"/>
		<updated>2011-10-24T23:52:27Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Modules: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Metaprogramming?==&lt;br /&gt;
&lt;br /&gt;
Metaprogramming&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]&amp;lt;/ref&amp;gt; can change the way you program in your programming language. This is the most under used programming techniques. Metaprogramming is writing computer programs that manipulate other programs, or that which  do  a part of their work at compile time that would otherwise be done at runtime. This is very advantageous because it gives greater flexibility to programs to efficiently handle new situations without recompilation. Languages which provide metaprogramming are called metalanguages.  Metaprograms treat themselves as part of data and they can modify their own structure and behaviour. &lt;br /&gt;
&lt;br /&gt;
==History of Metaprogramming:==&lt;br /&gt;
&lt;br /&gt;
Not all metaprogramming involves generative programming. If programs are modifiable at runtime or if an incremental compilation is available, then techniques can be used to perform metaprogramming without actually generating source code.&lt;br /&gt;
Template metaprogramming is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions.&lt;br /&gt;
In C-language, one of the popular examples of meta-programming is the Lex/Yacc system for generation of parsers and lexical scanners. That is, it reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in C. Instead of doing the laborious work of generating a parser in C, one can use Yacc to generate the repetitive parts of the program. Then, one can add only the code necessary to operate on the parsed entities.&lt;br /&gt;
Metaprogramming in Java comprises of three main components reflection, generics, annotations.&lt;br /&gt;
&lt;br /&gt;
==Uses of Metaprogramming:&amp;lt;ref&amp;gt;[http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Metaprogramming&amp;lt;ref&amp;gt;[http://www.ibm.com/developerworks/linux/library/l-metaprog1/index.html Uses]&amp;lt;/ref&amp;gt; allows us to write programs that will pre-generate tables of data for use at runtime. For example, if a quick lookup table for the sine of all 8-bit integers is needed, then the sin can either be calculated and hand coded or the program can be made to build the table at startup at runtime or a program can used to build the custom code for the table before compile-time. While it may make sense to build the table at runtime for such a small set of numbers, other such tasks may cause program startup to be prohibitively slow. In such cases, writing a program to build static data tables is usually the best answer.&lt;br /&gt;
* A mini language can be created when there are a lot of functions which include a lot of boilerplate code. This mini language will do the boilerplate code and lets the user code only the important parts.&lt;br /&gt;
It is best to abstract out the boilerplate portions into a function. But often the boilerplate code isn't so pretty. Maybe there's a list of variables to be declared in every instance, or maybe there are several pieces of the boilerplate that have code inserted in certain circumstances. All of these make a simple function call impossible. In such cases, it is often a good idea to create a mini-language that allows the developer to work with the boilerplate code in an easier fashion. This mini-language will then be converted into your regular source code language before compiling.&lt;br /&gt;
Finally, a lot of programming languages make the developer write really verbose statements to do really simple things. Code-generating programs allow the developer to abbreviate such statements and save a lot of typing, which also prevents a lot of mistakes because there is less chance of mistyping.&lt;br /&gt;
&lt;br /&gt;
==Examples of metaprograms are:==&lt;br /&gt;
&lt;br /&gt;
* Compiler or interpreter of any language&lt;br /&gt;
* Lex and Yacc&lt;br /&gt;
* CORBA's IDL compiler&lt;br /&gt;
* Quine&lt;br /&gt;
* Programs to generate EJB code and XML from database metadata&lt;br /&gt;
* Enhanced Cweb.&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming in Ruby==&lt;br /&gt;
&lt;br /&gt;
===Aspects of Ruby make it easy for metaprogramming:===&lt;br /&gt;
&lt;br /&gt;
====Everything in Ruby is an object==== &lt;br /&gt;
&lt;br /&gt;
This means even native types in other languages such as Integer, Float, String and even the null value (‘nil’ in Ruby) is an object. So ruby doesn’t really have functions, if every single data is an object then every single action on the data is a method.&lt;br /&gt;
&lt;br /&gt;
Following example demonstrates that:&lt;br /&gt;
&lt;br /&gt;
 puts &amp;quot;cat&amp;quot;.class&lt;br /&gt;
 #Here's an iterator method being called on a simple Integer (Fixnum in Ruby)&lt;br /&gt;
 5.times { puts 'hi'}&lt;br /&gt;
 puts 5.class&lt;br /&gt;
&lt;br /&gt;
 #Even nil is an object!&lt;br /&gt;
 puts nil.class&lt;br /&gt;
&lt;br /&gt;
 #You can even define methods in nil! We'll be looking more at this later.&lt;br /&gt;
 def nil.hi&lt;br /&gt;
  puts 'hi!'&lt;br /&gt;
 end&lt;br /&gt;
 nil.hi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Classes and objects are open==== &lt;br /&gt;
&lt;br /&gt;
In Ruby classes are open,it means they are open for enhancing their functionality anytime i.e even at runtime.&amp;lt;ref&amp;gt;[http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 Suppose we have an array [1,2,3,4,5] and we want to find the sum of elements, so we invoke method called ‘sum’ on it.&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 #It gives us ‘No method error’&lt;br /&gt;
&lt;br /&gt;
So now we try to enhance the functionality of Array class by defining a method called sum on it&lt;br /&gt;
&lt;br /&gt;
 Class Array&lt;br /&gt;
  def sum&lt;br /&gt;
     inject(0){|s,v| s+v}&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Now lets try to invoke sum on the array&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 Output: 15&lt;br /&gt;
&lt;br /&gt;
====Code can be manipulated as data==== &lt;br /&gt;
&lt;br /&gt;
Ruby code can evaluate the contents of the string at runtime, which can be used to define classes and methods on the go at runtime.&amp;lt;ref&amp;gt;[http://www.slideshare.net/bsbodden/ruby-metaprogramming-08 http://www.slideshare.net/bsbodden/ruby-metaprogramming-08]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 # say_hello.rb&lt;br /&gt;
 puts “puts ‘Hello World !!’ “&lt;br /&gt;
&lt;br /&gt;
Code that invokes code&lt;br /&gt;
&lt;br /&gt;
 ruby –e “ ‘ruby say_hello.rb’ “&lt;br /&gt;
 Output: Hello World !!&lt;br /&gt;
&lt;br /&gt;
Ruby provides the ‘eval’ family of methods for runtime execution of code that is stored in strings&lt;br /&gt;
&lt;br /&gt;
*‘eval’ can evaluate any string. Other important methods of this family are instance_eval and class_eval.&lt;br /&gt;
 &lt;br /&gt;
 eval(“2*2”)&lt;br /&gt;
 Output: 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Instance_eval] evaluates string or a code block in the context of the receiver (object).&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.instance_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 # ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Class_eval] evaluates an string or a code block in the context of the class or module it is invoked on.&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.class_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 # ’hi’&lt;br /&gt;
&lt;br /&gt;
====Deep reflection capabilities==== &lt;br /&gt;
&lt;br /&gt;
In Ruby it's possible to read information about a class or object at runtime. We could use some of the methods like class(), instance_methods(), instance_variables()&amp;lt;ref&amp;gt;[http://www.khelll.com/blog/ruby/ruby-reflection/ http://www.khelll.com/blog/ruby/ruby-reflection/]&amp;lt;/ref&amp;gt; to do that.&lt;br /&gt;
&lt;br /&gt;
=====Example:=====&lt;br /&gt;
&lt;br /&gt;
 # The code in the following class definition is executed immediately&lt;br /&gt;
  &lt;br /&gt;
  Class Rubyist&lt;br /&gt;
   # the code in the following method definition is executed later,&lt;br /&gt;
   # when you eventually call the method&lt;br /&gt;
   &lt;br /&gt;
   def what_does_he_do&lt;br /&gt;
    @person = 'A Rubyist'&lt;br /&gt;
    'Ruby programming'&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  an_object = Rubyist.new&lt;br /&gt;
  puts an_object.class # =&amp;gt; Rubyist&lt;br /&gt;
  puts an_object.class.instance_methods(false) # =&amp;gt; what_does_he_do&lt;br /&gt;
  an_object.what_does_he_do&lt;br /&gt;
  puts an_object.instance_variables # =&amp;gt; @person&lt;br /&gt;
&lt;br /&gt;
===Meta programming techniques:===&lt;br /&gt;
&lt;br /&gt;
====Using Singleton Classes:&amp;lt;ref&amp;gt;[http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Singleton classes are used to implement instance specific behavior in Ruby.&amp;lt;ref&amp;gt;[http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/ http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/]&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 class MyClass &lt;br /&gt;
  def blah&lt;br /&gt;
    'blah'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj = MyClass.new&lt;br /&gt;
 obj.hi # =&amp;gt; NoMethodError&lt;br /&gt;
 &lt;br /&gt;
 def obj.hi&lt;br /&gt;
  'hi'&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj.hi # =&amp;gt; 'hi'&lt;br /&gt;
 &lt;br /&gt;
 another_obj = MyClass.new&lt;br /&gt;
 another_obj.hi # =&amp;gt; NoMethodError &lt;br /&gt;
 &lt;br /&gt;
 obj.class # =&amp;gt; MyClass&lt;br /&gt;
 another_obj.class # =&amp;gt; MyClass&lt;br /&gt;
&lt;br /&gt;
The above code shows one way to add instance-specific behavior. &lt;br /&gt;
&lt;br /&gt;
Interesting thing to note is that the new method is invokable only from the instance it was defined on and not from other instances of the same class. This means that the method was not added to the class of the instance.&lt;br /&gt;
&lt;br /&gt;
Does it mean an object itself can hold method definitions?&lt;br /&gt;
&lt;br /&gt;
Well, the answer is no (unless it's an object that represents a class or a module). One of the reasons the concept of classes exists in Ruby is that they are meant to hold method definitions and act as blueprints for their instances, ie, they determine what methods can be invoked on their instances.&lt;br /&gt;
&lt;br /&gt;
So where did the method 'hi' go?&lt;br /&gt;
&lt;br /&gt;
It goes into the singleton class of the instance. This hidden class is different from the class the instance was created from and is a Ruby implementation detail that is typically not revealed to anyone (there is only one way to get to the singleton class, which is discussed later in the article ). This is the reason it is sometimes called ghost class or anonymous class or shadow class. The singleton class is created for an object as soon as the Ruby interpreter needs to add instance-specific behavior for that object (but not before that). Going forward, if more methods need to be added to the same object, its already-created singleton class is used. Also, more instances cannot be created using a particular singleton class (its new method raises an error). Because of this one-to-one relationship between an object and its singleton class, the word 'singleton' is used.&lt;br /&gt;
&lt;br /&gt;
So, what is the way in which one can get access to an object's singleton class?&lt;br /&gt;
&lt;br /&gt;
 # ... in continuation from previous snippet &lt;br /&gt;
 obj_singleton_class = class &amp;lt;&amp;lt; obj; self; end&lt;br /&gt;
 obj_singleton_class.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
 MyClass.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
&lt;br /&gt;
Here class &amp;lt;&amp;lt; obj; self; end is the key: anything written after class &amp;lt;&amp;lt; obj and before the corresponding end is evaluated against the context of the singleton class of obj, ie, selfpoints to the singleton class.&lt;br /&gt;
&lt;br /&gt;
In the above snippet, we return self, getting a reference to it in the variable obj_singleton_class. We then see that the singleton class fakes the same ancestry as the original class of the object. This implies that when a method is invoked on an object, Ruby first looks for the method definition in the object's singleton class (if it exists), if not, Ruby then continues looking up the normal inheritance hierarchy.&lt;br /&gt;
 &lt;br /&gt;
 # ... in continuation from previous snippet&lt;br /&gt;
 obj.hi # method looked for in singleton class; found; invoked&lt;br /&gt;
 obj.blah # method looked for in singleton class; not found; looked for in MyClass; found; invoked&lt;br /&gt;
 obj.xyz # method looked for in singleton class, MyClass, Object, Kernel; not found; obj.method_missing() called, raising NoMethodError&lt;br /&gt;
&lt;br /&gt;
Let's quickly look at two other ways in which we could have added instance-specific behavior to an object:&lt;br /&gt;
 class &amp;lt;&amp;lt; obj&lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 obj.instance_eval do&lt;br /&gt;
  &lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The former one should be clear from what has already been explained. The latter is tied to how def works with instance_eval (which is explained earlier in this article).&lt;br /&gt;
Now, before concluding, let's take a step back and see if we've seen the syntax discussed so far, before. You'll probably recognize their use in defining class-level methods:&lt;br /&gt;
 &lt;br /&gt;
 Class MyClass&lt;br /&gt;
&lt;br /&gt;
  def MyClass.my_class_method1&lt;br /&gt;
    'class method 1'&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def self.my_class_method2&lt;br /&gt;
    'class method 2'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class &amp;lt;&amp;lt; self&lt;br /&gt;
&lt;br /&gt;
    def my_class_method3&lt;br /&gt;
      'class method 3'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Here all class methods go into the singleton class of the object representing the class, in this case, the object referenced by the constant name:MyClass (remember classes are also objects). After all, these class method definitions need to go somewhere, and in such a way that the methods don't become part of the class's instances (ie, they aren't instance methods) nor do the methods go to the super class.&lt;br /&gt;
&lt;br /&gt;
====Defining methods on the fly:&amp;lt;ref&amp;gt;[http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/ http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Ruby has the ability to define methods on the fly using ‘define_method’&amp;lt;ref&amp;gt;[http://metaclass.org/2007/9/18/define-method http://metaclass.org/2007/9/18/define-method]&amp;lt;/ref&amp;gt;, method_missing, [http://www.infoq.com/articles/eval-options-in-ruby ‘eval’] family methods. &lt;br /&gt;
&lt;br /&gt;
=====Using 'eval' family methods :&amp;lt;ref&amp;gt;[http://ilikestuffblog.com/2009/01/09/fun-with-rubys-instance_eval-and-class_eval/]&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
This is illustrated by following example.&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      class_eval “def greet_in_#{language}; puts ‘#{greeting}’; end”&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
 alan=Person.new&lt;br /&gt;
 alan.greet_in_English&lt;br /&gt;
 #Hello!&lt;br /&gt;
&lt;br /&gt;
 p=Person&lt;br /&gt;
 p.make_greeting(“dutch”,”Hallo!”)&lt;br /&gt;
 lisa=p.new&lt;br /&gt;
 lisa.greet_in_dutch&lt;br /&gt;
 #Hallo!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above example is used to create greetings in different languages on the go. A new greeting is created in make_greeting method, which uses class_eval to evaluate the string that defines a method for a ‘language’ (argument for the make_greeting method). As the method defined using class_val it would in the scope of the entire class (Person). Now to access greet_in_English method we need to create an object and use it to invoke the method. Now to define method at runtime we can invoke make_greeting method using the class (Person.make_greeting(language,greeting)).  And now the newly defined method is available for access by any Person’s object.&lt;br /&gt;
&lt;br /&gt;
The same functionality can be achieved by define method in following was:&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      define_method  “greet_in_#{language};” do &lt;br /&gt;
        puts “#{greeting}”&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
====Defining methods using method_missing:&amp;lt;ref&amp;gt;[http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://technicalpickles.com/posts/using-method_missing-and-respond_to-to-create-dynamic-methods/&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
One of the ways Ruby is dynamic is that we can choose how to handle methods that are called, but don’t actually exist. If we have a lot of very similar methods, we can even use this to define them all at once. Ruby does this using the method_missing method, which we override in the classes where we need more dynamic method calling.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by using following example&amp;lt;ref&amp;gt;[http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/ http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/]&amp;lt;/ref&amp;gt; which creates a widget that store any attribute that is given to it.&lt;br /&gt;
&lt;br /&gt;
 # lib/widget.rb&lt;br /&gt;
 Class Widget&lt;br /&gt;
  def method_missing sym, *args&lt;br /&gt;
    if sym =~ /^(\w+)=$/&lt;br /&gt;
      instance_variable_set &amp;quot;@#{$1}&amp;quot;, args[0]&lt;br /&gt;
    else&lt;br /&gt;
      instance_variable_get &amp;quot;@#{sym}&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 widget = Widget.new&lt;br /&gt;
 #&amp;lt;Widget:0x0000010383f618&amp;gt;&lt;br /&gt;
 widget.name = 'Bob'&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age = 30&lt;br /&gt;
 # 30&lt;br /&gt;
 widget.name&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age&lt;br /&gt;
 # 30&lt;br /&gt;
&lt;br /&gt;
We have a created Widget and no methods are defined in it, so whenever a method is invoked it would call method missing. In method it is looking for a command with ‘=’ symbol that means it assigning something, so if that is the case it would put that variable into the instance variable set for later retrieval. If the command doesn’t have ‘=’ it is simply displaying the attributes from the instance variable set.&lt;br /&gt;
&lt;br /&gt;
====Aliasing:&amp;lt;ref&amp;gt;[http://pragprog.com/book/ppmetr/metaprogramming-ruby Aliasing]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
We can redefine a method in an existing class by opening it up and rewriting it, but since we cannot loose the behaviour provided by the original method, we can use alias_method.&lt;br /&gt;
 alias        :new  :old&lt;br /&gt;
 alias_method :new, :old&lt;br /&gt;
&lt;br /&gt;
Syntax&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.ruby-forum.com/topic/135598 http://www.ruby-forum.com/topic/135598]&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 alias method-name method-name&lt;br /&gt;
 alias global-variable-name global-variable-name&lt;br /&gt;
&lt;br /&gt;
Creates a new reference to whatever old referred to. old can be any existing method, operator, global. It may not be a local, instance, constant, or class variable. Alias_method is used when there is a need to override a method but still count on its old behaviour. 	&lt;br /&gt;
 &lt;br /&gt;
Example1:&lt;br /&gt;
&lt;br /&gt;
 alias foo bar  -&amp;gt; Creates a foo alias for bar&lt;br /&gt;
&lt;br /&gt;
 alias $MATCH $&amp;amp; -&amp;gt; $MATCH is an alias for $&amp;amp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
&lt;br /&gt;
 1.	def oldmtd  &lt;br /&gt;
 2.	  &amp;quot;old method&amp;quot;  &lt;br /&gt;
 3.	end  &lt;br /&gt;
 4.	alias newmtd oldmtd  &lt;br /&gt;
 5.	def oldmtd  &lt;br /&gt;
 6.	  &amp;quot;old improved method&amp;quot;  &lt;br /&gt;
 7.	end  &lt;br /&gt;
 8.	puts oldmtd  &lt;br /&gt;
 9.	puts newmtd  &lt;br /&gt;
&lt;br /&gt;
The output is:&lt;br /&gt;
 1.	old improved method  &lt;br /&gt;
 2.	old method  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local variables, instance variables, class variables and constants may not be aliased. The parameters to alias may be names or symbols.  When a method is aliased, the new name refers to a copy of the original method’s body. If the method is subsequently redefined, the aliased name will still invoke the original implementation. Aliases cannot be defined within the method body. The alias of the method keeps the current definition of the method even when the methods are overridden.&lt;br /&gt;
Making aliases for the numbered global variables ($1,$2,….) is prohibited. Overriding the built in global variables may cause serious problems.&lt;br /&gt;
&lt;br /&gt;
====Modules:====&lt;br /&gt;
&lt;br /&gt;
Module&amp;lt;ref&amp;gt;[http://www.rubyist.net/~slagell/ruby/modules.html Modules]&amp;lt;/ref&amp;gt; is just a bunch of instance methods. A class is just a module but has certain additional features like a superclass and a new() method. The main reason for having both modules and class in Ruby is to make the code more explicit. A module&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html]&amp;lt;/ref&amp;gt; is used in situations where it has to be included somewhere or when it needs to be used as a namespace. A class is used when it needs to be instantiated or inherited.&lt;br /&gt;
A module can be included by a class. A module can be shared between and included by multiple classes at the same time.  Modules can be used to organize constants in the same way as directories are used to organize files.&lt;br /&gt;
	&lt;br /&gt;
Example&amp;lt;ref&amp;gt;[http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/ http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
 module Stats&lt;br /&gt;
  def max_health&lt;br /&gt;
    100&lt;br /&gt;
  end&lt;br /&gt;
  def constitution&lt;br /&gt;
    50&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 class Character&lt;br /&gt;
  include Stats&lt;br /&gt;
  attr_accessor:name&lt;br /&gt;
  attr_accessor:location&lt;br /&gt;
  def talk; end&lt;br /&gt;
  def walk; end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
In the above example we have extracted max_health and constitution into a module. The Character class incudes the Stats module. Whenever a method  is called on an instance of Character, that cannot be found in the referenced class, Ruby will look if the method can be found in one of the included modules. This is not the same as inheritance. Multiple modules can be included at the same time.&lt;br /&gt;
 Modules define a namespace, a sandbox in which your methods and constants can play without having to worry about being stepped on by other methods and constants.&lt;br /&gt;
include mixes a module into a class or another module. Methods from that the module are called function-style (without a receiver).&lt;br /&gt;
&lt;br /&gt;
Extend keyword can be used to extend a single functionality for the object. Adds to object the instance methods from each module given as a parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 module Mod&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 class Klass&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 k = Klass.new&lt;br /&gt;
 k.hello	»	&amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
 k.extend(Mod)	» #&amp;lt;Klass:0x401b598c&amp;gt;&lt;br /&gt;
 k.hello	» &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extend is used to include a module in an object(instance). Methods in the module become methods in the object&lt;br /&gt;
&lt;br /&gt;
The possibilities meta programing opens up seem to be endless. Joining on the way are endless possibilities to do something wrong.  “with great power comes great responsibility”&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[http://pedromtavares.wordpress.com/2010/02/24/ruby-object-model-and-metaprogramming/ More About Metaprogramming]&lt;br /&gt;
&lt;br /&gt;
[http://www.devalot.com/articles/2008/09/ruby-singleton More about Singleton Classes]&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54147</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4g ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54147"/>
		<updated>2011-10-24T19:57:19Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Aliasing:Aliasing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Metaprogramming?==&lt;br /&gt;
&lt;br /&gt;
Metaprogramming&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]&amp;lt;/ref&amp;gt; can change the way you program in your programming language. This is the most under used programming techniques. Metaprogramming is writing computer programs that manipulate other programs, or that which  do  a part of their work at compile time that would otherwise be done at runtime. This is very advantageous because it gives greater flexibility to programs to efficiently handle new situations without recompilation. Languages which provide metaprogramming are called metalanguages.  Metaprograms treat themselves as part of data and they can modify their own structure and behaviour. &lt;br /&gt;
&lt;br /&gt;
==History of Metaprogramming:==&lt;br /&gt;
&lt;br /&gt;
Not all metaprogramming involves generative programming. If programs are modifiable at runtime or if an incremental compilation is available, then techniques can be used to perform metaprogramming without actually generating source code.&lt;br /&gt;
Template metaprogramming is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions.&lt;br /&gt;
In C-language, one of the popular examples of meta-programming is the Lex/Yacc system for generation of parsers and lexical scanners. That is, it reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in C. Instead of doing the laborious work of generating a parser in C, one can use Yacc to generate the repetitive parts of the program. Then, one can add only the code necessary to operate on the parsed entities.&lt;br /&gt;
Metaprogramming in Java comprises of three main components reflection, generics, annotations.&lt;br /&gt;
&lt;br /&gt;
==Uses of Metaprogramming:&amp;lt;ref&amp;gt;[http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Metaprogramming&amp;lt;ref&amp;gt;[http://www.ibm.com/developerworks/linux/library/l-metaprog1/index.html Uses]&amp;lt;/ref&amp;gt; allows us to write programs that will pre-generate tables of data for use at runtime. For example, if a quick lookup table for the sine of all 8-bit integers is needed, then the sin can either be calculated and hand coded or the program can be made to build the table at startup at runtime or a program can used to build the custom code for the table before compile-time. While it may make sense to build the table at runtime for such a small set of numbers, other such tasks may cause program startup to be prohibitively slow. In such cases, writing a program to build static data tables is usually the best answer.&lt;br /&gt;
* A mini language can be created when there are a lot of functions which include a lot of boilerplate code. This mini language will do the boilerplate code and lets the user code only the important parts.&lt;br /&gt;
It is best to abstract out the boilerplate portions into a function. But often the boilerplate code isn't so pretty. Maybe there's a list of variables to be declared in every instance, or maybe there are several pieces of the boilerplate that have code inserted in certain circumstances. All of these make a simple function call impossible. In such cases, it is often a good idea to create a mini-language that allows the developer to work with the boilerplate code in an easier fashion. This mini-language will then be converted into your regular source code language before compiling.&lt;br /&gt;
Finally, a lot of programming languages make the developer write really verbose statements to do really simple things. Code-generating programs allow the developer to abbreviate such statements and save a lot of typing, which also prevents a lot of mistakes because there is less chance of mistyping.&lt;br /&gt;
&lt;br /&gt;
==Examples of metaprograms are:==&lt;br /&gt;
&lt;br /&gt;
* Compiler or interpreter of any language&lt;br /&gt;
* Lex and Yacc&lt;br /&gt;
* CORBA's IDL compiler&lt;br /&gt;
* Quine&lt;br /&gt;
* Programs to generate EJB code and XML from database metadata&lt;br /&gt;
* Enhanced Cweb.&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming in Ruby==&lt;br /&gt;
&lt;br /&gt;
===Aspects of Ruby make it easy for metaprogramming:===&lt;br /&gt;
&lt;br /&gt;
====Everything in Ruby is an object==== &lt;br /&gt;
&lt;br /&gt;
This means even native types in other languages such as Integer, Float, String and even the null value (‘nil’ in Ruby) is an object. So ruby doesn’t really have functions, if every single data is an object then every single action on the data is a method.&lt;br /&gt;
&lt;br /&gt;
Following example demonstrates that:&lt;br /&gt;
&lt;br /&gt;
 puts &amp;quot;cat&amp;quot;.class&lt;br /&gt;
 #Here's an iterator method being called on a simple Integer (Fixnum in Ruby)&lt;br /&gt;
 5.times { puts 'hi'}&lt;br /&gt;
 puts 5.class&lt;br /&gt;
&lt;br /&gt;
 #Even nil is an object!&lt;br /&gt;
 puts nil.class&lt;br /&gt;
&lt;br /&gt;
 #You can even define methods in nil! We'll be looking more at this later.&lt;br /&gt;
 def nil.hi&lt;br /&gt;
  puts 'hi!'&lt;br /&gt;
 end&lt;br /&gt;
 nil.hi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Classes and objects are open==== &lt;br /&gt;
&lt;br /&gt;
In Ruby classes are open,it means they are open for enhancing their functionality anytime i.e even at runtime.&amp;lt;ref&amp;gt;[http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 Suppose we have an array [1,2,3,4,5] and we want to find the sum of elements, so we invoke method called ‘sum’ on it.&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 #It gives us ‘No method error’&lt;br /&gt;
&lt;br /&gt;
So now we try to enhance the functionality of Array class by defining a method called sum on it&lt;br /&gt;
&lt;br /&gt;
 Class Array&lt;br /&gt;
  def sum&lt;br /&gt;
     inject(0){|s,v| s+v}&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Now lets try to invoke sum on the array&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 Output: 15&lt;br /&gt;
&lt;br /&gt;
====Code can be manipulated as data==== &lt;br /&gt;
&lt;br /&gt;
Ruby code can evaluate the contents of the string at runtime, which can be used to define classes and methods on the go at runtime.&amp;lt;ref&amp;gt;[http://www.slideshare.net/bsbodden/ruby-metaprogramming-08 http://www.slideshare.net/bsbodden/ruby-metaprogramming-08]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 # say_hello.rb&lt;br /&gt;
 puts “puts ‘Hello World !!’ “&lt;br /&gt;
&lt;br /&gt;
Code that invokes code&lt;br /&gt;
&lt;br /&gt;
 ruby –e “ ‘ruby say_hello.rb’ “&lt;br /&gt;
 Output: Hello World !!&lt;br /&gt;
&lt;br /&gt;
Ruby provides the ‘eval’ family of methods for runtime execution of code that is stored in strings&lt;br /&gt;
&lt;br /&gt;
*‘eval’ can evaluate any string. Other important methods of this family are instance_eval and class_eval.&lt;br /&gt;
 &lt;br /&gt;
 eval(“2*2”)&lt;br /&gt;
 Output: 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Instance_eval] evaluates string or a code block in the context of the receiver (object).&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.instance_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 # ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Class_eval] evaluates an string or a code block in the context of the class or module it is invoked on.&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.class_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 # ’hi’&lt;br /&gt;
&lt;br /&gt;
====Deep reflection capabilities==== &lt;br /&gt;
&lt;br /&gt;
In Ruby it's possible to read information about a class or object at runtime. We could use some of the methods like class(), instance_methods(), instance_variables()&amp;lt;ref&amp;gt;[http://www.khelll.com/blog/ruby/ruby-reflection/ http://www.khelll.com/blog/ruby/ruby-reflection/]&amp;lt;/ref&amp;gt; to do that.&lt;br /&gt;
&lt;br /&gt;
=====Example:=====&lt;br /&gt;
&lt;br /&gt;
 # The code in the following class definition is executed immediately&lt;br /&gt;
  &lt;br /&gt;
  Class Rubyist&lt;br /&gt;
   # the code in the following method definition is executed later,&lt;br /&gt;
   # when you eventually call the method&lt;br /&gt;
   &lt;br /&gt;
   def what_does_he_do&lt;br /&gt;
    @person = 'A Rubyist'&lt;br /&gt;
    'Ruby programming'&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  an_object = Rubyist.new&lt;br /&gt;
  puts an_object.class # =&amp;gt; Rubyist&lt;br /&gt;
  puts an_object.class.instance_methods(false) # =&amp;gt; what_does_he_do&lt;br /&gt;
  an_object.what_does_he_do&lt;br /&gt;
  puts an_object.instance_variables # =&amp;gt; @person&lt;br /&gt;
&lt;br /&gt;
===Meta programming techniques:===&lt;br /&gt;
&lt;br /&gt;
====Using Singleton Classes:&amp;lt;ref&amp;gt;[http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Singleton classes are used to implement instance specific behavior in Ruby.&amp;lt;ref&amp;gt;[http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/ http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/]&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 class MyClass &lt;br /&gt;
  def blah&lt;br /&gt;
    'blah'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj = MyClass.new&lt;br /&gt;
 obj.hi # =&amp;gt; NoMethodError&lt;br /&gt;
 &lt;br /&gt;
 def obj.hi&lt;br /&gt;
  'hi'&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj.hi # =&amp;gt; 'hi'&lt;br /&gt;
 &lt;br /&gt;
 another_obj = MyClass.new&lt;br /&gt;
 another_obj.hi # =&amp;gt; NoMethodError &lt;br /&gt;
 &lt;br /&gt;
 obj.class # =&amp;gt; MyClass&lt;br /&gt;
 another_obj.class # =&amp;gt; MyClass&lt;br /&gt;
&lt;br /&gt;
The above code shows one way to add instance-specific behavior. &lt;br /&gt;
&lt;br /&gt;
Interesting thing to note is that the new method is invokable only from the instance it was defined on and not from other instances of the same class. This means that the method was not added to the class of the instance.&lt;br /&gt;
&lt;br /&gt;
Does it mean an object itself can hold method definitions?&lt;br /&gt;
&lt;br /&gt;
Well, the answer is no (unless it's an object that represents a class or a module). One of the reasons the concept of classes exists in Ruby is that they are meant to hold method definitions and act as blueprints for their instances, ie, they determine what methods can be invoked on their instances.&lt;br /&gt;
&lt;br /&gt;
So where did the method 'hi' go?&lt;br /&gt;
&lt;br /&gt;
It goes into the singleton class of the instance. This hidden class is different from the class the instance was created from and is a Ruby implementation detail that is typically not revealed to anyone (there is only one way to get to the singleton class, which is discussed later in the article ). This is the reason it is sometimes called ghost class or anonymous class or shadow class. The singleton class is created for an object as soon as the Ruby interpreter needs to add instance-specific behavior for that object (but not before that). Going forward, if more methods need to be added to the same object, its already-created singleton class is used. Also, more instances cannot be created using a particular singleton class (its new method raises an error). Because of this one-to-one relationship between an object and its singleton class, the word 'singleton' is used.&lt;br /&gt;
&lt;br /&gt;
So, what is the way in which one can get access to an object's singleton class?&lt;br /&gt;
&lt;br /&gt;
 # ... in continuation from previous snippet &lt;br /&gt;
 obj_singleton_class = class &amp;lt;&amp;lt; obj; self; end&lt;br /&gt;
 obj_singleton_class.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
 MyClass.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
&lt;br /&gt;
Here class &amp;lt;&amp;lt; obj; self; end is the key: anything written after class &amp;lt;&amp;lt; obj and before the corresponding end is evaluated against the context of the singleton class of obj, ie, selfpoints to the singleton class.&lt;br /&gt;
&lt;br /&gt;
In the above snippet, we return self, getting a reference to it in the variable obj_singleton_class. We then see that the singleton class fakes the same ancestry as the original class of the object. This implies that when a method is invoked on an object, Ruby first looks for the method definition in the object's singleton class (if it exists), if not, Ruby then continues looking up the normal inheritance hierarchy.&lt;br /&gt;
 &lt;br /&gt;
 # ... in continuation from previous snippet&lt;br /&gt;
 obj.hi # method looked for in singleton class; found; invoked&lt;br /&gt;
 obj.blah # method looked for in singleton class; not found; looked for in MyClass; found; invoked&lt;br /&gt;
 obj.xyz # method looked for in singleton class, MyClass, Object, Kernel; not found; obj.method_missing() called, raising NoMethodError&lt;br /&gt;
&lt;br /&gt;
Let's quickly look at two other ways in which we could have added instance-specific behavior to an object:&lt;br /&gt;
 class &amp;lt;&amp;lt; obj&lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 obj.instance_eval do&lt;br /&gt;
  &lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The former one should be clear from what has already been explained. The latter is tied to how def works with instance_eval (I'll probably cover this in another blog post).&lt;br /&gt;
Now, before concluding, let's take a step back and see if we've seen the syntax discussed so far, before. You'll probably recognize their use in defining class-level methods:&lt;br /&gt;
 &lt;br /&gt;
 Class MyClass&lt;br /&gt;
&lt;br /&gt;
  def MyClass.my_class_method1&lt;br /&gt;
    'class method 1'&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def self.my_class_method2&lt;br /&gt;
    'class method 2'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class &amp;lt;&amp;lt; self&lt;br /&gt;
&lt;br /&gt;
    def my_class_method3&lt;br /&gt;
      'class method 3'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Here all class methods go into the singleton class of the object representing the class, in this case, the object referenced by the constant name:MyClass (remember classes are also objects). After all, these class method definitions need to go somewhere, and in such a way that the methods don't become part of the class's instances (ie, they aren't instance methods) nor do the methods go to the super class.&lt;br /&gt;
&lt;br /&gt;
====Defining methods on the fly:&amp;lt;ref&amp;gt;[http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/ http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Ruby has the ability to define methods on the fly using ‘define_method’&amp;lt;ref&amp;gt;[http://metaclass.org/2007/9/18/define-method http://metaclass.org/2007/9/18/define-method]&amp;lt;/ref&amp;gt;, method_missing, [http://www.infoq.com/articles/eval-options-in-ruby ‘eval’] family methods. &lt;br /&gt;
&lt;br /&gt;
=====Using 'eval' family methods :&amp;lt;ref&amp;gt;[http://ilikestuffblog.com/2009/01/09/fun-with-rubys-instance_eval-and-class_eval/]&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
This is illustrated by following example.&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      class_eval “def greet_in_#{language}; puts ‘#{greeting}’; end”&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
 alan=Person.new&lt;br /&gt;
 alan.greet_in_English&lt;br /&gt;
 #Hello!&lt;br /&gt;
&lt;br /&gt;
 p=Person&lt;br /&gt;
 p.make_greeting(“dutch”,”Hallo!”)&lt;br /&gt;
 lisa=p.new&lt;br /&gt;
 lisa.greet_in_dutch&lt;br /&gt;
 #Hallo!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above example is used to create greetings in different languages on the go. A new greeting is created in make_greeting method, which uses class_eval to evaluate the string that defines a method for a ‘language’ (argument for the make_greeting method). As the method defined using class_val it would in the scope of the entire class (Person). Now to access greet_in_English method we need to create an object and use it to invoke the method. Now to define method at runtime we can invoke make_greeting method using the class (Person.make_greeting(language,greeting)).  And now the newly defined method is available for access by any Person’s object.&lt;br /&gt;
&lt;br /&gt;
The same functionality can be achieved by define method in following was:&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      define_method  “greet_in_#{language};” do &lt;br /&gt;
        puts “#{greeting}”&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
====Defining methods using method_missing:&amp;lt;ref&amp;gt;[http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://technicalpickles.com/posts/using-method_missing-and-respond_to-to-create-dynamic-methods/&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
One of the ways Ruby is dynamic is that we can choose how to handle methods that are called, but don’t actually exist. If we have a lot of very similar methods, we can even use this to define them all at once. Ruby does this using the method_missing method, which we override in the classes where we need more dynamic method calling.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by using following example&amp;lt;ref&amp;gt;[http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/ http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/]&amp;lt;/ref&amp;gt; which creates a widget that store any attribute that is given to it.&lt;br /&gt;
&lt;br /&gt;
 # lib/widget.rb&lt;br /&gt;
 Class Widget&lt;br /&gt;
  def method_missing sym, *args&lt;br /&gt;
    if sym =~ /^(\w+)=$/&lt;br /&gt;
      instance_variable_set &amp;quot;@#{$1}&amp;quot;, args[0]&lt;br /&gt;
    else&lt;br /&gt;
      instance_variable_get &amp;quot;@#{sym}&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 widget = Widget.new&lt;br /&gt;
 #&amp;lt;Widget:0x0000010383f618&amp;gt;&lt;br /&gt;
 widget.name = 'Bob'&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age = 30&lt;br /&gt;
 # 30&lt;br /&gt;
 widget.name&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age&lt;br /&gt;
 # 30&lt;br /&gt;
&lt;br /&gt;
We have a created Widget and no methods are defined in it, so whenever a method is invoked it would call method missing. In method it is looking for a command with ‘=’ symbol that means it assigning something, so if that is the case it would put that variable into the instance variable set for later retrieval. If the command doesn’t have ‘=’ it is simply displaying the attributes from the instance variable set.&lt;br /&gt;
&lt;br /&gt;
====Aliasing:&amp;lt;ref&amp;gt;[http://pragprog.com/book/ppmetr/metaprogramming-ruby Aliasing]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
We can redefine a method in an existing class by opening it up and rewriting it, but since we cannot loose the behaviour provided by the original method, we can use alias_method.&lt;br /&gt;
 alias        :new  :old&lt;br /&gt;
 alias_method :new, :old&lt;br /&gt;
&lt;br /&gt;
Syntax&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.ruby-forum.com/topic/135598 http://www.ruby-forum.com/topic/135598]&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 alias method-name method-name&lt;br /&gt;
 alias global-variable-name global-variable-name&lt;br /&gt;
&lt;br /&gt;
Creates a new reference to whatever old referred to. old can be any existing method, operator, global. It may not be a local, instance, constant, or class variable. Alias_method is used when there is a need to override a method but still count on its old behaviour. 	&lt;br /&gt;
 &lt;br /&gt;
Example1:&lt;br /&gt;
&lt;br /&gt;
 alias foo bar  -&amp;gt; Creates a foo alias for bar&lt;br /&gt;
&lt;br /&gt;
 alias $MATCH $&amp;amp; -&amp;gt; $MATCH is an alias for $&amp;amp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
&lt;br /&gt;
 1.	def oldmtd  &lt;br /&gt;
 2.	  &amp;quot;old method&amp;quot;  &lt;br /&gt;
 3.	end  &lt;br /&gt;
 4.	alias newmtd oldmtd  &lt;br /&gt;
 5.	def oldmtd  &lt;br /&gt;
 6.	  &amp;quot;old improved method&amp;quot;  &lt;br /&gt;
 7.	end  &lt;br /&gt;
 8.	puts oldmtd  &lt;br /&gt;
 9.	puts newmtd  &lt;br /&gt;
&lt;br /&gt;
The output is:&lt;br /&gt;
 1.	old improved method  &lt;br /&gt;
 2.	old method  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local variables, instance variables, class variables and constants may not be aliased. The parameters to alias may be names or symbols.  When a method is aliased, the new name refers to a copy of the original method’s body. If the method is subsequently redefined, the aliased name will still invoke the original implementation. Aliases cannot be defined within the method body. The alias of the method keeps the current definition of the method even when the methods are overridden.&lt;br /&gt;
Making aliases for the numbered global variables ($1,$2,….) is prohibited. Overriding the built in global variables may cause serious problems.&lt;br /&gt;
&lt;br /&gt;
====Modules:====&lt;br /&gt;
&lt;br /&gt;
Module&amp;lt;ref&amp;gt;[http://www.rubyist.net/~slagell/ruby/modules.html Modules]&amp;lt;/ref&amp;gt; is just a bunch of instance methods. A class is just a module but has certain additional features like a superclass and a new() method. The main reason for having both modules and class in Ruby is to make the code more explicit. A module&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html]&amp;lt;/ref&amp;gt; is used in situations where it has to be included somewhere or when it needs to be used as a namespace. A class is used when it needs to be instantiated or inherited.&lt;br /&gt;
A module can be included by a class. A module can be shared between and included by multiple classes at the same time.  Modules can be used to organize constants in the same way as directories are used to organize files.&lt;br /&gt;
	&lt;br /&gt;
Example&amp;lt;ref&amp;gt;[http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/ http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
module Stats&lt;br /&gt;
  def max_health&lt;br /&gt;
    100&lt;br /&gt;
  end&lt;br /&gt;
  def constitution&lt;br /&gt;
    50&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Character&lt;br /&gt;
  include Stats&lt;br /&gt;
  attr_accessor:name&lt;br /&gt;
  attr_accessor:location&lt;br /&gt;
  def talk; end&lt;br /&gt;
  def walk; end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
In the above example we have extracted max_health and constitution into a module. The Character class incudes the Stats module. Whenever a method  is called on an instance of Character, that cannot be found in the referenced class, Ruby will look if the method can be found in one of the included modules. This is not the same as inheritance. Multiple modules can be included at the same time.&lt;br /&gt;
 Modules define a namespace, a sandbox in which your methods and constants can play without having to worry about being stepped on by other methods and constants.&lt;br /&gt;
include mixes a module into a class or another module. Methods from that the module are called function-style (without a receiver).&lt;br /&gt;
&lt;br /&gt;
Extend keyword can be used to extend a single functionality for the object. Adds to object the instance methods from each module given as a parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 module Mod&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 class Klass&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 k = Klass.new&lt;br /&gt;
 k.hello	»	&amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
 k.extend(Mod)	» #&amp;lt;Klass:0x401b598c&amp;gt;&lt;br /&gt;
 k.hello	» &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extend is used to include a module in an object(instance). Methods in the module become methods in the object&lt;br /&gt;
&lt;br /&gt;
The possibilities meta programing opens up seem to be endless. Joining on the way are endless possibilities to do something wrong.  “with great power comes great responsibility”&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[http://pedromtavares.wordpress.com/2010/02/24/ruby-object-model-and-metaprogramming/ More About Metaprogramming]&lt;br /&gt;
&lt;br /&gt;
[http://www.devalot.com/articles/2008/09/ruby-singleton More about Singleton Classes]&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54146</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4g ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54146"/>
		<updated>2011-10-24T19:55:00Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Metaprogramming?==&lt;br /&gt;
&lt;br /&gt;
Metaprogramming&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]&amp;lt;/ref&amp;gt; can change the way you program in your programming language. This is the most under used programming techniques. Metaprogramming is writing computer programs that manipulate other programs, or that which  do  a part of their work at compile time that would otherwise be done at runtime. This is very advantageous because it gives greater flexibility to programs to efficiently handle new situations without recompilation. Languages which provide metaprogramming are called metalanguages.  Metaprograms treat themselves as part of data and they can modify their own structure and behaviour. &lt;br /&gt;
&lt;br /&gt;
==History of Metaprogramming:==&lt;br /&gt;
&lt;br /&gt;
Not all metaprogramming involves generative programming. If programs are modifiable at runtime or if an incremental compilation is available, then techniques can be used to perform metaprogramming without actually generating source code.&lt;br /&gt;
Template metaprogramming is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions.&lt;br /&gt;
In C-language, one of the popular examples of meta-programming is the Lex/Yacc system for generation of parsers and lexical scanners. That is, it reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in C. Instead of doing the laborious work of generating a parser in C, one can use Yacc to generate the repetitive parts of the program. Then, one can add only the code necessary to operate on the parsed entities.&lt;br /&gt;
Metaprogramming in Java comprises of three main components reflection, generics, annotations.&lt;br /&gt;
&lt;br /&gt;
==Uses of Metaprogramming:&amp;lt;ref&amp;gt;[http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Metaprogramming&amp;lt;ref&amp;gt;[http://www.ibm.com/developerworks/linux/library/l-metaprog1/index.html Uses]&amp;lt;/ref&amp;gt; allows us to write programs that will pre-generate tables of data for use at runtime. For example, if a quick lookup table for the sine of all 8-bit integers is needed, then the sin can either be calculated and hand coded or the program can be made to build the table at startup at runtime or a program can used to build the custom code for the table before compile-time. While it may make sense to build the table at runtime for such a small set of numbers, other such tasks may cause program startup to be prohibitively slow. In such cases, writing a program to build static data tables is usually the best answer.&lt;br /&gt;
* A mini language can be created when there are a lot of functions which include a lot of boilerplate code. This mini language will do the boilerplate code and lets the user code only the important parts.&lt;br /&gt;
It is best to abstract out the boilerplate portions into a function. But often the boilerplate code isn't so pretty. Maybe there's a list of variables to be declared in every instance, or maybe there are several pieces of the boilerplate that have code inserted in certain circumstances. All of these make a simple function call impossible. In such cases, it is often a good idea to create a mini-language that allows the developer to work with the boilerplate code in an easier fashion. This mini-language will then be converted into your regular source code language before compiling.&lt;br /&gt;
Finally, a lot of programming languages make the developer write really verbose statements to do really simple things. Code-generating programs allow the developer to abbreviate such statements and save a lot of typing, which also prevents a lot of mistakes because there is less chance of mistyping.&lt;br /&gt;
&lt;br /&gt;
==Examples of metaprograms are:==&lt;br /&gt;
&lt;br /&gt;
* Compiler or interpreter of any language&lt;br /&gt;
* Lex and Yacc&lt;br /&gt;
* CORBA's IDL compiler&lt;br /&gt;
* Quine&lt;br /&gt;
* Programs to generate EJB code and XML from database metadata&lt;br /&gt;
* Enhanced Cweb.&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming in Ruby==&lt;br /&gt;
&lt;br /&gt;
===Aspects of Ruby make it easy for metaprogramming:===&lt;br /&gt;
&lt;br /&gt;
====Everything in Ruby is an object==== &lt;br /&gt;
&lt;br /&gt;
This means even native types in other languages such as Integer, Float, String and even the null value (‘nil’ in Ruby) is an object. So ruby doesn’t really have functions, if every single data is an object then every single action on the data is a method.&lt;br /&gt;
&lt;br /&gt;
Following example demonstrates that:&lt;br /&gt;
&lt;br /&gt;
 puts &amp;quot;cat&amp;quot;.class&lt;br /&gt;
 #Here's an iterator method being called on a simple Integer (Fixnum in Ruby)&lt;br /&gt;
 5.times { puts 'hi'}&lt;br /&gt;
 puts 5.class&lt;br /&gt;
&lt;br /&gt;
 #Even nil is an object!&lt;br /&gt;
 puts nil.class&lt;br /&gt;
&lt;br /&gt;
 #You can even define methods in nil! We'll be looking more at this later.&lt;br /&gt;
 def nil.hi&lt;br /&gt;
  puts 'hi!'&lt;br /&gt;
 end&lt;br /&gt;
 nil.hi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Classes and objects are open==== &lt;br /&gt;
&lt;br /&gt;
In Ruby classes are open,it means they are open for enhancing their functionality anytime i.e even at runtime.&amp;lt;ref&amp;gt;[http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 Suppose we have an array [1,2,3,4,5] and we want to find the sum of elements, so we invoke method called ‘sum’ on it.&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 #It gives us ‘No method error’&lt;br /&gt;
&lt;br /&gt;
So now we try to enhance the functionality of Array class by defining a method called sum on it&lt;br /&gt;
&lt;br /&gt;
 Class Array&lt;br /&gt;
  def sum&lt;br /&gt;
     inject(0){|s,v| s+v}&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Now lets try to invoke sum on the array&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 Output: 15&lt;br /&gt;
&lt;br /&gt;
====Code can be manipulated as data==== &lt;br /&gt;
&lt;br /&gt;
Ruby code can evaluate the contents of the string at runtime, which can be used to define classes and methods on the go at runtime.&amp;lt;ref&amp;gt;[http://www.slideshare.net/bsbodden/ruby-metaprogramming-08 http://www.slideshare.net/bsbodden/ruby-metaprogramming-08]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 # say_hello.rb&lt;br /&gt;
 puts “puts ‘Hello World !!’ “&lt;br /&gt;
&lt;br /&gt;
Code that invokes code&lt;br /&gt;
&lt;br /&gt;
 ruby –e “ ‘ruby say_hello.rb’ “&lt;br /&gt;
 Output: Hello World !!&lt;br /&gt;
&lt;br /&gt;
Ruby provides the ‘eval’ family of methods for runtime execution of code that is stored in strings&lt;br /&gt;
&lt;br /&gt;
*‘eval’ can evaluate any string. Other important methods of this family are instance_eval and class_eval.&lt;br /&gt;
 &lt;br /&gt;
 eval(“2*2”)&lt;br /&gt;
 Output: 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Instance_eval] evaluates string or a code block in the context of the receiver (object).&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.instance_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 # ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Class_eval] evaluates an string or a code block in the context of the class or module it is invoked on.&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.class_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 # ’hi’&lt;br /&gt;
&lt;br /&gt;
====Deep reflection capabilities==== &lt;br /&gt;
&lt;br /&gt;
In Ruby it's possible to read information about a class or object at runtime. We could use some of the methods like class(), instance_methods(), instance_variables()&amp;lt;ref&amp;gt;[http://www.khelll.com/blog/ruby/ruby-reflection/ http://www.khelll.com/blog/ruby/ruby-reflection/]&amp;lt;/ref&amp;gt; to do that.&lt;br /&gt;
&lt;br /&gt;
=====Example:=====&lt;br /&gt;
&lt;br /&gt;
 # The code in the following class definition is executed immediately&lt;br /&gt;
  &lt;br /&gt;
  Class Rubyist&lt;br /&gt;
   # the code in the following method definition is executed later,&lt;br /&gt;
   # when you eventually call the method&lt;br /&gt;
   &lt;br /&gt;
   def what_does_he_do&lt;br /&gt;
    @person = 'A Rubyist'&lt;br /&gt;
    'Ruby programming'&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  an_object = Rubyist.new&lt;br /&gt;
  puts an_object.class # =&amp;gt; Rubyist&lt;br /&gt;
  puts an_object.class.instance_methods(false) # =&amp;gt; what_does_he_do&lt;br /&gt;
  an_object.what_does_he_do&lt;br /&gt;
  puts an_object.instance_variables # =&amp;gt; @person&lt;br /&gt;
&lt;br /&gt;
===Meta programming techniques:===&lt;br /&gt;
&lt;br /&gt;
====Using Singleton Classes:&amp;lt;ref&amp;gt;[http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Singleton classes are used to implement instance specific behavior in Ruby.&amp;lt;ref&amp;gt;[http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/ http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/]&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 class MyClass &lt;br /&gt;
  def blah&lt;br /&gt;
    'blah'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj = MyClass.new&lt;br /&gt;
 obj.hi # =&amp;gt; NoMethodError&lt;br /&gt;
 &lt;br /&gt;
 def obj.hi&lt;br /&gt;
  'hi'&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj.hi # =&amp;gt; 'hi'&lt;br /&gt;
 &lt;br /&gt;
 another_obj = MyClass.new&lt;br /&gt;
 another_obj.hi # =&amp;gt; NoMethodError &lt;br /&gt;
 &lt;br /&gt;
 obj.class # =&amp;gt; MyClass&lt;br /&gt;
 another_obj.class # =&amp;gt; MyClass&lt;br /&gt;
&lt;br /&gt;
The above code shows one way to add instance-specific behavior. &lt;br /&gt;
&lt;br /&gt;
Interesting thing to note is that the new method is invokable only from the instance it was defined on and not from other instances of the same class. This means that the method was not added to the class of the instance.&lt;br /&gt;
&lt;br /&gt;
Does it mean an object itself can hold method definitions?&lt;br /&gt;
&lt;br /&gt;
Well, the answer is no (unless it's an object that represents a class or a module). One of the reasons the concept of classes exists in Ruby is that they are meant to hold method definitions and act as blueprints for their instances, ie, they determine what methods can be invoked on their instances.&lt;br /&gt;
&lt;br /&gt;
So where did the method 'hi' go?&lt;br /&gt;
&lt;br /&gt;
It goes into the singleton class of the instance. This hidden class is different from the class the instance was created from and is a Ruby implementation detail that is typically not revealed to anyone (there is only one way to get to the singleton class, which is discussed later in the article ). This is the reason it is sometimes called ghost class or anonymous class or shadow class. The singleton class is created for an object as soon as the Ruby interpreter needs to add instance-specific behavior for that object (but not before that). Going forward, if more methods need to be added to the same object, its already-created singleton class is used. Also, more instances cannot be created using a particular singleton class (its new method raises an error). Because of this one-to-one relationship between an object and its singleton class, the word 'singleton' is used.&lt;br /&gt;
&lt;br /&gt;
So, what is the way in which one can get access to an object's singleton class?&lt;br /&gt;
&lt;br /&gt;
 # ... in continuation from previous snippet &lt;br /&gt;
 obj_singleton_class = class &amp;lt;&amp;lt; obj; self; end&lt;br /&gt;
 obj_singleton_class.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
 MyClass.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
&lt;br /&gt;
Here class &amp;lt;&amp;lt; obj; self; end is the key: anything written after class &amp;lt;&amp;lt; obj and before the corresponding end is evaluated against the context of the singleton class of obj, ie, selfpoints to the singleton class.&lt;br /&gt;
&lt;br /&gt;
In the above snippet, we return self, getting a reference to it in the variable obj_singleton_class. We then see that the singleton class fakes the same ancestry as the original class of the object. This implies that when a method is invoked on an object, Ruby first looks for the method definition in the object's singleton class (if it exists), if not, Ruby then continues looking up the normal inheritance hierarchy.&lt;br /&gt;
 &lt;br /&gt;
 # ... in continuation from previous snippet&lt;br /&gt;
 obj.hi # method looked for in singleton class; found; invoked&lt;br /&gt;
 obj.blah # method looked for in singleton class; not found; looked for in MyClass; found; invoked&lt;br /&gt;
 obj.xyz # method looked for in singleton class, MyClass, Object, Kernel; not found; obj.method_missing() called, raising NoMethodError&lt;br /&gt;
&lt;br /&gt;
Let's quickly look at two other ways in which we could have added instance-specific behavior to an object:&lt;br /&gt;
 class &amp;lt;&amp;lt; obj&lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 obj.instance_eval do&lt;br /&gt;
  &lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The former one should be clear from what has already been explained. The latter is tied to how def works with instance_eval (I'll probably cover this in another blog post).&lt;br /&gt;
Now, before concluding, let's take a step back and see if we've seen the syntax discussed so far, before. You'll probably recognize their use in defining class-level methods:&lt;br /&gt;
 &lt;br /&gt;
 Class MyClass&lt;br /&gt;
&lt;br /&gt;
  def MyClass.my_class_method1&lt;br /&gt;
    'class method 1'&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def self.my_class_method2&lt;br /&gt;
    'class method 2'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class &amp;lt;&amp;lt; self&lt;br /&gt;
&lt;br /&gt;
    def my_class_method3&lt;br /&gt;
      'class method 3'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Here all class methods go into the singleton class of the object representing the class, in this case, the object referenced by the constant name:MyClass (remember classes are also objects). After all, these class method definitions need to go somewhere, and in such a way that the methods don't become part of the class's instances (ie, they aren't instance methods) nor do the methods go to the super class.&lt;br /&gt;
&lt;br /&gt;
====Defining methods on the fly:&amp;lt;ref&amp;gt;[http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/ http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Ruby has the ability to define methods on the fly using ‘define_method’&amp;lt;ref&amp;gt;[http://metaclass.org/2007/9/18/define-method http://metaclass.org/2007/9/18/define-method]&amp;lt;/ref&amp;gt;, method_missing, [http://www.infoq.com/articles/eval-options-in-ruby ‘eval’] family methods. &lt;br /&gt;
&lt;br /&gt;
=====Using 'eval' family methods :&amp;lt;ref&amp;gt;[http://ilikestuffblog.com/2009/01/09/fun-with-rubys-instance_eval-and-class_eval/]&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
This is illustrated by following example.&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      class_eval “def greet_in_#{language}; puts ‘#{greeting}’; end”&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
 alan=Person.new&lt;br /&gt;
 alan.greet_in_English&lt;br /&gt;
 #Hello!&lt;br /&gt;
&lt;br /&gt;
 p=Person&lt;br /&gt;
 p.make_greeting(“dutch”,”Hallo!”)&lt;br /&gt;
 lisa=p.new&lt;br /&gt;
 lisa.greet_in_dutch&lt;br /&gt;
 #Hallo!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above example is used to create greetings in different languages on the go. A new greeting is created in make_greeting method, which uses class_eval to evaluate the string that defines a method for a ‘language’ (argument for the make_greeting method). As the method defined using class_val it would in the scope of the entire class (Person). Now to access greet_in_English method we need to create an object and use it to invoke the method. Now to define method at runtime we can invoke make_greeting method using the class (Person.make_greeting(language,greeting)).  And now the newly defined method is available for access by any Person’s object.&lt;br /&gt;
&lt;br /&gt;
The same functionality can be achieved by define method in following was:&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      define_method  “greet_in_#{language};” do &lt;br /&gt;
        puts “#{greeting}”&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
====Defining methods using method_missing:&amp;lt;ref&amp;gt;[http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://technicalpickles.com/posts/using-method_missing-and-respond_to-to-create-dynamic-methods/&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
One of the ways Ruby is dynamic is that we can choose how to handle methods that are called, but don’t actually exist. If we have a lot of very similar methods, we can even use this to define them all at once. Ruby does this using the method_missing method, which we override in the classes where we need more dynamic method calling.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by using following example&amp;lt;ref&amp;gt;[http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/ http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/]&amp;lt;/ref&amp;gt; which creates a widget that store any attribute that is given to it.&lt;br /&gt;
&lt;br /&gt;
 # lib/widget.rb&lt;br /&gt;
 Class Widget&lt;br /&gt;
  def method_missing sym, *args&lt;br /&gt;
    if sym =~ /^(\w+)=$/&lt;br /&gt;
      instance_variable_set &amp;quot;@#{$1}&amp;quot;, args[0]&lt;br /&gt;
    else&lt;br /&gt;
      instance_variable_get &amp;quot;@#{sym}&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 widget = Widget.new&lt;br /&gt;
 #&amp;lt;Widget:0x0000010383f618&amp;gt;&lt;br /&gt;
 widget.name = 'Bob'&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age = 30&lt;br /&gt;
 # 30&lt;br /&gt;
 widget.name&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age&lt;br /&gt;
 # 30&lt;br /&gt;
&lt;br /&gt;
We have a created Widget and no methods are defined in it, so whenever a method is invoked it would call method missing. In method it is looking for a command with ‘=’ symbol that means it assigning something, so if that is the case it would put that variable into the instance variable set for later retrieval. If the command doesn’t have ‘=’ it is simply displaying the attributes from the instance variable set.&lt;br /&gt;
&lt;br /&gt;
====Aliasing:&amp;lt;ref&amp;gt;[http://pragprog.com/book/ppmetr/metaprogramming-ruby Aliasing]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
We can redefine a method in an existing class by opening it up and rewriting it, but since we cannot loose the behaviour provided by the original method, we can use alias_method.&lt;br /&gt;
 alias        :new  :old&lt;br /&gt;
 alias_method :new, :old&lt;br /&gt;
&lt;br /&gt;
Syntax&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.ruby-forum.com/topic/135598 http://www.ruby-forum.com/topic/135598]&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 alias method-name method-name&lt;br /&gt;
 alias global-variable-name global-variable-name&lt;br /&gt;
&lt;br /&gt;
Creates a new reference to whatever old referred to. old can be any existing method, operator, global. It may not be a local, instance, constant, or class variable. Alias_method is used when there is a need to override a method but still count on its old behaviour. 	&lt;br /&gt;
 &lt;br /&gt;
Example1:&lt;br /&gt;
&lt;br /&gt;
 alias foo bar  -&amp;gt; Creates a foo alias for bar&lt;br /&gt;
&lt;br /&gt;
 alias $MATCH $&amp;amp; -&amp;gt; $MATCH is an alias for $&amp;amp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
&lt;br /&gt;
1.	def oldmtd  &lt;br /&gt;
2.	  &amp;quot;old method&amp;quot;  &lt;br /&gt;
3.	end  &lt;br /&gt;
4.	alias newmtd oldmtd  &lt;br /&gt;
5.	def oldmtd  &lt;br /&gt;
6.	  &amp;quot;old improved method&amp;quot;  &lt;br /&gt;
7.	end  &lt;br /&gt;
8.	puts oldmtd  &lt;br /&gt;
9.	puts newmtd  &lt;br /&gt;
&lt;br /&gt;
The output is:&lt;br /&gt;
1.	old improved method  &lt;br /&gt;
2.	old method  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local variables, instance variables, class variables and constants may not be aliased. The parameters to alias may be names or symbols.  When a method is aliased, the new name refers to a copy of the original method’s body. If the method is subsequently redefined, the aliased name will still invoke the original implementation. Aliases cannot be defined within the method body. The alias of the method keeps the current definition of the method even when the methods are overridden.&lt;br /&gt;
Making aliases for the numbered global variables ($1,$2,….) is prohibited. Overriding the built in global variables may cause serious problems.&lt;br /&gt;
&lt;br /&gt;
====Modules:====&lt;br /&gt;
&lt;br /&gt;
Module&amp;lt;ref&amp;gt;[http://www.rubyist.net/~slagell/ruby/modules.html Modules]&amp;lt;/ref&amp;gt; is just a bunch of instance methods. A class is just a module but has certain additional features like a superclass and a new() method. The main reason for having both modules and class in Ruby is to make the code more explicit. A module&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html]&amp;lt;/ref&amp;gt; is used in situations where it has to be included somewhere or when it needs to be used as a namespace. A class is used when it needs to be instantiated or inherited.&lt;br /&gt;
A module can be included by a class. A module can be shared between and included by multiple classes at the same time.  Modules can be used to organize constants in the same way as directories are used to organize files.&lt;br /&gt;
	&lt;br /&gt;
Example&amp;lt;ref&amp;gt;[http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/ http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
module Stats&lt;br /&gt;
  def max_health&lt;br /&gt;
    100&lt;br /&gt;
  end&lt;br /&gt;
  def constitution&lt;br /&gt;
    50&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Character&lt;br /&gt;
  include Stats&lt;br /&gt;
  attr_accessor:name&lt;br /&gt;
  attr_accessor:location&lt;br /&gt;
  def talk; end&lt;br /&gt;
  def walk; end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
In the above example we have extracted max_health and constitution into a module. The Character class incudes the Stats module. Whenever a method  is called on an instance of Character, that cannot be found in the referenced class, Ruby will look if the method can be found in one of the included modules. This is not the same as inheritance. Multiple modules can be included at the same time.&lt;br /&gt;
 Modules define a namespace, a sandbox in which your methods and constants can play without having to worry about being stepped on by other methods and constants.&lt;br /&gt;
include mixes a module into a class or another module. Methods from that the module are called function-style (without a receiver).&lt;br /&gt;
&lt;br /&gt;
Extend keyword can be used to extend a single functionality for the object. Adds to object the instance methods from each module given as a parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 module Mod&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 class Klass&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 k = Klass.new&lt;br /&gt;
 k.hello	»	&amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
 k.extend(Mod)	» #&amp;lt;Klass:0x401b598c&amp;gt;&lt;br /&gt;
 k.hello	» &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extend is used to include a module in an object(instance). Methods in the module become methods in the object&lt;br /&gt;
&lt;br /&gt;
The possibilities meta programing opens up seem to be endless. Joining on the way are endless possibilities to do something wrong.  “with great power comes great responsibility”&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[http://pedromtavares.wordpress.com/2010/02/24/ruby-object-model-and-metaprogramming/ More About Metaprogramming]&lt;br /&gt;
&lt;br /&gt;
[http://www.devalot.com/articles/2008/09/ruby-singleton More about Singleton Classes]&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54144</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4g ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54144"/>
		<updated>2011-10-24T18:05:54Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Metaprogramming?==&lt;br /&gt;
&lt;br /&gt;
Metaprogramming&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]&amp;lt;/ref&amp;gt; can change the way you program in your programming language. This is the most under used programming techniques. Metaprogramming is writing computer programs that manipulate other programs, or that which  do  a part of their work at compile time that would otherwise be done at runtime. This is very advantageous because it gives greater flexibility to programs to efficiently handle new situations without recompilation. Languages which provide metaprogramming are called metalanguages.  Metaprograms treat themselves as part of data and they can modify their own structure and behaviour. &lt;br /&gt;
&lt;br /&gt;
==History of Metaprogramming:==&lt;br /&gt;
&lt;br /&gt;
Not all metaprogramming involves generative programming. If programs are modifiable at runtime or if an incremental compilation is available, then techniques can be used to perform metaprogramming without actually generating source code.&lt;br /&gt;
Template metaprogramming is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions.&lt;br /&gt;
In C-language, one of the popular examples of meta-programming is the Lex/Yacc system for generation of parsers and lexical scanners. That is, it reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in C. Instead of doing the laborious work of generating a parser in C, one can use Yacc to generate the repetitive parts of the program. Then, one can add only the code necessary to operate on the parsed entities.&lt;br /&gt;
Metaprogramming in Java comprises of three main components reflection, generics, annotations.&lt;br /&gt;
&lt;br /&gt;
==Uses of Metaprogramming:&amp;lt;ref&amp;gt;[http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Metaprogramming&amp;lt;ref&amp;gt;[http://www.ibm.com/developerworks/linux/library/l-metaprog1/index.html Uses]&amp;lt;/ref&amp;gt; allows us to write programs that will pre-generate tables of data for use at runtime. For example, if a quick lookup table for the sine of all 8-bit integers is needed, then the sin can either be calculated and hand coded or the program can be made to build the table at startup at runtime or a program can used to build the custom code for the table before compile-time. While it may make sense to build the table at runtime for such a small set of numbers, other such tasks may cause program startup to be prohibitively slow. In such cases, writing a program to build static data tables is usually the best answer.&lt;br /&gt;
* A mini language can be created when there are a lot of functions which include a lot of boilerplate code. This mini language will do the boilerplate code and lets the user code only the important parts.&lt;br /&gt;
It is best to abstract out the boilerplate portions into a function. But often the boilerplate code isn't so pretty. Maybe there's a list of variables to be declared in every instance, or maybe there are several pieces of the boilerplate that have code inserted in certain circumstances. All of these make a simple function call impossible. In such cases, it is often a good idea to create a mini-language that allows the developer to work with the boilerplate code in an easier fashion. This mini-language will then be converted into your regular source code language before compiling.&lt;br /&gt;
Finally, a lot of programming languages make the developer write really verbose statements to do really simple things. Code-generating programs allow the developer to abbreviate such statements and save a lot of typing, which also prevents a lot of mistakes because there is less chance of mistyping.&lt;br /&gt;
&lt;br /&gt;
==Examples of metaprograms are:==&lt;br /&gt;
&lt;br /&gt;
* Compiler or interpreter of any language&lt;br /&gt;
* Lex and Yacc&lt;br /&gt;
* CORBA's IDL compiler&lt;br /&gt;
* Quine&lt;br /&gt;
* Programs to generate EJB code and XML from database metadata&lt;br /&gt;
* Enhanced Cweb.&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming in Ruby==&lt;br /&gt;
&lt;br /&gt;
===Aspects of Ruby make it easy for metaprogramming:===&lt;br /&gt;
&lt;br /&gt;
====Everything in Ruby is an object==== &lt;br /&gt;
&lt;br /&gt;
This means even native types in other languages such as Integer, Float, String and even the null value (‘nil’ in Ruby) is an object. So ruby doesn’t really have functions, if every single data is an object then every single action on the data is a method.&lt;br /&gt;
&lt;br /&gt;
Following example demonstrates that:&lt;br /&gt;
&lt;br /&gt;
 puts &amp;quot;cat&amp;quot;.class&lt;br /&gt;
 #Here's an iterator method being called on a simple Integer (Fixnum in Ruby)&lt;br /&gt;
 5.times { puts 'hi'}&lt;br /&gt;
 puts 5.class&lt;br /&gt;
&lt;br /&gt;
 #Even nil is an object!&lt;br /&gt;
 puts nil.class&lt;br /&gt;
&lt;br /&gt;
 #You can even define methods in nil! We'll be looking more at this later.&lt;br /&gt;
 def nil.hi&lt;br /&gt;
  puts 'hi!'&lt;br /&gt;
 end&lt;br /&gt;
 nil.hi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Classes and objects are open==== &lt;br /&gt;
&lt;br /&gt;
In Ruby classes are open,it means they are open for enhancing their functionality anytime i.e even at runtime.&amp;lt;ref&amp;gt;[http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 Suppose we have an array [1,2,3,4,5] and we want to find the sum of elements, so we invoke method called ‘sum’ on it.&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 #It gives us ‘No method error’&lt;br /&gt;
&lt;br /&gt;
So now we try to enhance the functionality of Array class by defining a method called sum on it&lt;br /&gt;
&lt;br /&gt;
 Class Array&lt;br /&gt;
  def sum&lt;br /&gt;
     inject(0){|s,v| s+v}&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Now lets try to invoke sum on the array&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 Output: 15&lt;br /&gt;
&lt;br /&gt;
====Code can be manipulated as data==== &lt;br /&gt;
&lt;br /&gt;
Ruby code can evaluate the contents of the string at runtime, which can be used to define classes and methods on the go at runtime.&amp;lt;ref&amp;gt;[http://www.slideshare.net/bsbodden/ruby-metaprogramming-08 http://www.slideshare.net/bsbodden/ruby-metaprogramming-08]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 # say_hello.rb&lt;br /&gt;
 puts “puts ‘Hello World !!’ “&lt;br /&gt;
&lt;br /&gt;
Code that invokes code&lt;br /&gt;
&lt;br /&gt;
 ruby –e “ ‘ruby say_hello.rb’ “&lt;br /&gt;
 Output: Hello World !!&lt;br /&gt;
&lt;br /&gt;
Ruby provides the ‘eval’ family of methods for runtime execution of code that is stored in strings&lt;br /&gt;
&lt;br /&gt;
*‘eval’ can evaluate any string. Other important methods of this family are instance_eval and class_eval.&lt;br /&gt;
 &lt;br /&gt;
 eval(“2*2”)&lt;br /&gt;
 Output: 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Instance_eval] evaluates string or a code block in the context of the receiver (object).&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.instance_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 # ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Class_eval] evaluates an string or a code block in the context of the class or module it is invoked on.&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.class_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 # ’hi’&lt;br /&gt;
&lt;br /&gt;
====Deep reflection capabilities==== &lt;br /&gt;
&lt;br /&gt;
In Ruby it's possible to read information about a class or object at runtime. We could use some of the methods like class(), instance_methods(), instance_variables()&amp;lt;ref&amp;gt;[http://www.khelll.com/blog/ruby/ruby-reflection/ http://www.khelll.com/blog/ruby/ruby-reflection/]&amp;lt;/ref&amp;gt; to do that.&lt;br /&gt;
&lt;br /&gt;
=====Example:=====&lt;br /&gt;
&lt;br /&gt;
 # The code in the following class definition is executed immediately&lt;br /&gt;
  &lt;br /&gt;
  Class Rubyist&lt;br /&gt;
   # the code in the following method definition is executed later,&lt;br /&gt;
   # when you eventually call the method&lt;br /&gt;
   &lt;br /&gt;
   def what_does_he_do&lt;br /&gt;
    @person = 'A Rubyist'&lt;br /&gt;
    'Ruby programming'&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  an_object = Rubyist.new&lt;br /&gt;
  puts an_object.class # =&amp;gt; Rubyist&lt;br /&gt;
  puts an_object.class.instance_methods(false) # =&amp;gt; what_does_he_do&lt;br /&gt;
  an_object.what_does_he_do&lt;br /&gt;
  puts an_object.instance_variables # =&amp;gt; @person&lt;br /&gt;
&lt;br /&gt;
===Meta programming techniques:===&lt;br /&gt;
&lt;br /&gt;
====Using Singleton Classes:&amp;lt;ref&amp;gt;[http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Singleton classes are used to implement instance specific behavior in Ruby.&amp;lt;ref&amp;gt;[http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/ http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/]&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 class MyClass &lt;br /&gt;
  def blah&lt;br /&gt;
    'blah'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj = MyClass.new&lt;br /&gt;
 obj.hi # =&amp;gt; NoMethodError&lt;br /&gt;
 &lt;br /&gt;
 def obj.hi&lt;br /&gt;
  'hi'&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj.hi # =&amp;gt; 'hi'&lt;br /&gt;
 &lt;br /&gt;
 another_obj = MyClass.new&lt;br /&gt;
 another_obj.hi # =&amp;gt; NoMethodError &lt;br /&gt;
 &lt;br /&gt;
 obj.class # =&amp;gt; MyClass&lt;br /&gt;
 another_obj.class # =&amp;gt; MyClass&lt;br /&gt;
&lt;br /&gt;
The above code shows one way to add instance-specific behavior. &lt;br /&gt;
&lt;br /&gt;
Interesting thing to note is that the new method is invokable only from the instance it was defined on and not from other instances of the same class. This means that the method was not added to the class of the instance.&lt;br /&gt;
&lt;br /&gt;
Does it mean an object itself can hold method definitions?&lt;br /&gt;
&lt;br /&gt;
Well, the answer is no (unless it's an object that represents a class or a module). One of the reasons the concept of classes exists in Ruby is that they are meant to hold method definitions and act as blueprints for their instances, ie, they determine what methods can be invoked on their instances.&lt;br /&gt;
&lt;br /&gt;
So where did the method 'hi' go?&lt;br /&gt;
&lt;br /&gt;
It goes into the singleton class of the instance. This hidden class is different from the class the instance was created from and is a Ruby implementation detail that is typically not revealed to anyone (there is only one way to get to the singleton class, which is discussed later in the article ). This is the reason it is sometimes called ghost class or anonymous class or shadow class. The singleton class is created for an object as soon as the Ruby interpreter needs to add instance-specific behavior for that object (but not before that). Going forward, if more methods need to be added to the same object, its already-created singleton class is used. Also, more instances cannot be created using a particular singleton class (its new method raises an error). Because of this one-to-one relationship between an object and its singleton class, the word 'singleton' is used.&lt;br /&gt;
&lt;br /&gt;
So, what is the way in which one can get access to an object's singleton class?&lt;br /&gt;
&lt;br /&gt;
 # ... in continuation from previous snippet &lt;br /&gt;
 obj_singleton_class = class &amp;lt;&amp;lt; obj; self; end&lt;br /&gt;
 obj_singleton_class.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
 MyClass.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
&lt;br /&gt;
Here class &amp;lt;&amp;lt; obj; self; end is the key: anything written after class &amp;lt;&amp;lt; obj and before the corresponding end is evaluated against the context of the singleton class of obj, ie, selfpoints to the singleton class.&lt;br /&gt;
&lt;br /&gt;
In the above snippet, we return self, getting a reference to it in the variable obj_singleton_class. We then see that the singleton class fakes the same ancestry as the original class of the object. This implies that when a method is invoked on an object, Ruby first looks for the method definition in the object's singleton class (if it exists), if not, Ruby then continues looking up the normal inheritance hierarchy.&lt;br /&gt;
 &lt;br /&gt;
 # ... in continuation from previous snippet&lt;br /&gt;
 obj.hi # method looked for in singleton class; found; invoked&lt;br /&gt;
 obj.blah # method looked for in singleton class; not found; looked for in MyClass; found; invoked&lt;br /&gt;
 obj.xyz # method looked for in singleton class, MyClass, Object, Kernel; not found; obj.method_missing() called, raising NoMethodError&lt;br /&gt;
&lt;br /&gt;
Let's quickly look at two other ways in which we could have added instance-specific behavior to an object:&lt;br /&gt;
 class &amp;lt;&amp;lt; obj&lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 obj.instance_eval do&lt;br /&gt;
  &lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The former one should be clear from what has already been explained. The latter is tied to how def works with instance_eval (I'll probably cover this in another blog post).&lt;br /&gt;
Now, before concluding, let's take a step back and see if we've seen the syntax discussed so far, before. You'll probably recognize their use in defining class-level methods:&lt;br /&gt;
 &lt;br /&gt;
 Class MyClass&lt;br /&gt;
&lt;br /&gt;
  def MyClass.my_class_method1&lt;br /&gt;
    'class method 1'&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def self.my_class_method2&lt;br /&gt;
    'class method 2'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class &amp;lt;&amp;lt; self&lt;br /&gt;
&lt;br /&gt;
    def my_class_method3&lt;br /&gt;
      'class method 3'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Here all class methods go into the singleton class of the object representing the class, in this case, the object referenced by the constant name:MyClass (remember classes are also objects). After all, these class method definitions need to go somewhere, and in such a way that the methods don't become part of the class's instances (ie, they aren't instance methods) nor do the methods go to the super class.&lt;br /&gt;
&lt;br /&gt;
====Defining methods on the fly:&amp;lt;ref&amp;gt;[http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/ http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Ruby has the ability to define methods on the fly using ‘define_method’&amp;lt;ref&amp;gt;[http://metaclass.org/2007/9/18/define-method http://metaclass.org/2007/9/18/define-method]&amp;lt;/ref&amp;gt;, method_missing, [http://www.infoq.com/articles/eval-options-in-ruby ‘eval’] family methods. &lt;br /&gt;
&lt;br /&gt;
=====Using 'eval' family methods :&amp;lt;ref&amp;gt;[http://ilikestuffblog.com/2009/01/09/fun-with-rubys-instance_eval-and-class_eval/]&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
This is illustrated by following example.&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      class_eval “def greet_in_#{language}; puts ‘#{greeting}’; end”&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
 alan=Person.new&lt;br /&gt;
 alan.greet_in_English&lt;br /&gt;
 #Hello!&lt;br /&gt;
&lt;br /&gt;
 p=Person&lt;br /&gt;
 p.make_greeting(“dutch”,”Hallo!”)&lt;br /&gt;
 lisa=p.new&lt;br /&gt;
 lisa.greet_in_dutch&lt;br /&gt;
 #Hallo!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above example is used to create greetings in different languages on the go. A new greeting is created in make_greeting method, which uses class_eval to evaluate the string that defines a method for a ‘language’ (argument for the make_greeting method). As the method defined using class_val it would in the scope of the entire class (Person). Now to access greet_in_English method we need to create an object and use it to invoke the method. Now to define method at runtime we can invoke make_greeting method using the class (Person.make_greeting(language,greeting)).  And now the newly defined method is available for access by any Person’s object.&lt;br /&gt;
&lt;br /&gt;
The same functionality can be achieved by define method in following was:&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      define_method  “greet_in_#{language};” do &lt;br /&gt;
        puts “#{greeting}”&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
====Defining methods using method_missing:&amp;lt;ref&amp;gt;[http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://technicalpickles.com/posts/using-method_missing-and-respond_to-to-create-dynamic-methods/&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
One of the ways Ruby is dynamic is that we can choose how to handle methods that are called, but don’t actually exist. If we have a lot of very similar methods, we can even use this to define them all at once. Ruby does this using the method_missing method, which we override in the classes where we need more dynamic method calling.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by using following example&amp;lt;ref&amp;gt;[http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/ http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/]&amp;lt;/ref&amp;gt; which creates a widget that store any attribute that is given to it.&lt;br /&gt;
&lt;br /&gt;
 # lib/widget.rb&lt;br /&gt;
 Class Widget&lt;br /&gt;
  def method_missing sym, *args&lt;br /&gt;
    if sym =~ /^(\w+)=$/&lt;br /&gt;
      instance_variable_set &amp;quot;@#{$1}&amp;quot;, args[0]&lt;br /&gt;
    else&lt;br /&gt;
      instance_variable_get &amp;quot;@#{sym}&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 widget = Widget.new&lt;br /&gt;
 #&amp;lt;Widget:0x0000010383f618&amp;gt;&lt;br /&gt;
 widget.name = 'Bob'&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age = 30&lt;br /&gt;
 # 30&lt;br /&gt;
 widget.name&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age&lt;br /&gt;
 # 30&lt;br /&gt;
&lt;br /&gt;
We have a created Widget and no methods are defined in it, so whenever a method is invoked it would call method missing. In method it is looking for a command with ‘=’ symbol that means it assigning something, so if that is the case it would put that variable into the instance variable set for later retrieval. If the command doesn’t have ‘=’ it is simply displaying the attributes from the instance variable set.&lt;br /&gt;
&lt;br /&gt;
====Aliasing:&amp;lt;ref&amp;gt;[http://pragprog.com/book/ppmetr/metaprogramming-ruby Aliasing]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
We can redefine a method in an existing class by opening it up and rewriting it, but since we cannot loose the behaviour provided by the original method, we can use alias_method.&lt;br /&gt;
alias        :new  :old&lt;br /&gt;
alias_method :new, :old&lt;br /&gt;
&lt;br /&gt;
Syntax&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.ruby-forum.com/topic/135598 http://www.ruby-forum.com/topic/135598]&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
alias method-name method-name&lt;br /&gt;
alias global-variable-name global-variable-name&lt;br /&gt;
&lt;br /&gt;
Creates a new reference to whatever old referred to. old can be any existing method, operator, global. It may not be a local, instance, constant, or class variable. Alias_method is used when there is a need to override a method but still count on its old behaviour. 	&lt;br /&gt;
 &lt;br /&gt;
Example1:&lt;br /&gt;
&lt;br /&gt;
alias foo bar  -&amp;gt; Creates a foo alias for bar&lt;br /&gt;
&lt;br /&gt;
alias $MATCH $&amp;amp; -&amp;gt; $MATCH is an alias for $&amp;amp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
&lt;br /&gt;
1.	def oldmtd  &lt;br /&gt;
2.	  &amp;quot;old method&amp;quot;  &lt;br /&gt;
3.	end  &lt;br /&gt;
4.	alias newmtd oldmtd  &lt;br /&gt;
5.	def oldmtd  &lt;br /&gt;
6.	  &amp;quot;old improved method&amp;quot;  &lt;br /&gt;
7.	end  &lt;br /&gt;
8.	puts oldmtd  &lt;br /&gt;
9.	puts newmtd  &lt;br /&gt;
&lt;br /&gt;
The output is:&lt;br /&gt;
1.	old improved method  &lt;br /&gt;
2.	old method  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local variables, instance variables, class variables and constants may not be aliased. The parameters to alias may be names or symbols.  When a method is aliased, the new name refers to a copy of the original method’s body. If the method is subsequently redefined, the aliased name will still invoke the original implementation. Aliases cannot be defined within the method body. The alias of the method keeps the current definition of the method even when the methods are overridden.&lt;br /&gt;
Making aliases for the numbered global variables ($1,$2,….) is prohibited. Overriding the built in global variables may cause serious problems.&lt;br /&gt;
&lt;br /&gt;
====Modules:====&lt;br /&gt;
&lt;br /&gt;
Module&amp;lt;ref&amp;gt;[http://www.rubyist.net/~slagell/ruby/modules.html Modules]&amp;lt;/ref&amp;gt; is just a bunch of instance methods. A class is just a module but has certain additional features like a superclass and a new() method. The main reason for having both modules and class in Ruby is to make the code more explicit. A module&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html]&amp;lt;/ref&amp;gt; is used in situations where it has to be included somewhere or when it needs to be used as a namespace. A class is used when it needs to be instantiated or inherited.&lt;br /&gt;
A module can be included by a class. A module can be shared between and included by multiple classes at the same time.  Modules can be used to organize constants in the same way as directories are used to organize files.&lt;br /&gt;
	&lt;br /&gt;
Example&amp;lt;ref&amp;gt;[http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/ http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
module Stats&lt;br /&gt;
  def max_health&lt;br /&gt;
    100&lt;br /&gt;
  end&lt;br /&gt;
  def constitution&lt;br /&gt;
    50&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Character&lt;br /&gt;
  include Stats&lt;br /&gt;
  attr_accessor:name&lt;br /&gt;
  attr_accessor:location&lt;br /&gt;
  def talk; end&lt;br /&gt;
  def walk; end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
In the above example we have extracted max_health and constitution into a module. The Character class incudes the Stats module. Whenever a method  is called on an instance of Character, that cannot be found in the referenced class, Ruby will look if the method can be found in one of the included modules. This is not the same as inheritance. Multiple modules can be included at the same time.&lt;br /&gt;
 Modules define a namespace, a sandbox in which your methods and constants can play without having to worry about being stepped on by other methods and constants.&lt;br /&gt;
include mixes a module into a class or another module. Methods from that the module are called function-style (without a receiver).&lt;br /&gt;
&lt;br /&gt;
Extend keyword can be used to extend a single functionality for the object. Adds to object the instance methods from each module given as a parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 module Mod&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 class Klass&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 k = Klass.new&lt;br /&gt;
 k.hello	»	&amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
 k.extend(Mod)	» #&amp;lt;Klass:0x401b598c&amp;gt;&lt;br /&gt;
 k.hello	» &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extend is used to include a module in an object(instance). Methods in the module become methods in the object&lt;br /&gt;
&lt;br /&gt;
The possibilities meta programing opens up seem to be endless. Joining on the way are endless possibilities to do something wrong.  “with great power comes great responsibility”&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[http://pedromtavares.wordpress.com/2010/02/24/ruby-object-model-and-metaprogramming/ More About Metaprogramming]&lt;br /&gt;
&lt;br /&gt;
[http://www.devalot.com/articles/2008/09/ruby-singleton More about Singleton Classes]&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54143</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4g ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=54143"/>
		<updated>2011-10-24T17:57:17Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Metaprogramming?==&lt;br /&gt;
&lt;br /&gt;
Metaprogramming&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]&amp;lt;/ref&amp;gt; can change the way you program in your programming language. This is the most under used programming techniques. Metaprogramming is writing computer programs that manipulate other programs, or that which  do  a part of their work at compile time that would otherwise be done at runtime. This is very advantageous because it gives greater flexibility to programs to efficiently handle new situations without recompilation. Languages which provide metaprogramming are called metalanguages.  Metaprograms treat themselves as part of data and they can modify their own structure and behaviour. &lt;br /&gt;
&lt;br /&gt;
==History of Metaprogramming:==&lt;br /&gt;
&lt;br /&gt;
Not all metaprogramming involves generative programming. If programs are modifiable at runtime or if an incremental compilation is available, then techniques can be used to perform metaprogramming without actually generating source code.&lt;br /&gt;
Template metaprogramming is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions.&lt;br /&gt;
In C-language, one of the popular examples of meta-programming is the Lex/Yacc system for generation of parsers and lexical scanners. That is, it reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in C. Instead of doing the laborious work of generating a parser in C, one can use Yacc to generate the repetitive parts of the program. Then, one can add only the code necessary to operate on the parsed entities.&lt;br /&gt;
Metaprogramming in Java comprises of three main components reflection, generics, annotations.&lt;br /&gt;
&lt;br /&gt;
==Uses of Metaprogramming:&amp;lt;ref&amp;gt;[http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Metaprogramming&amp;lt;ref&amp;gt;[http://www.ibm.com/developerworks/linux/library/l-metaprog1/index.html Uses]&amp;lt;/ref&amp;gt; allows us to write programs that will pre-generate tables of data for use at runtime. For example, if a quick lookup table for the sine of all 8-bit integers is needed, then the sin can either be calculated and hand coded or the program can be made to build the table at startup at runtime or a program can used to build the custom code for the table before compile-time. While it may make sense to build the table at runtime for such a small set of numbers, other such tasks may cause program startup to be prohibitively slow. In such cases, writing a program to build static data tables is usually the best answer.&lt;br /&gt;
* A mini language can be created when there are a lot of functions which include a lot of boilerplate code. This mini language will do the boilerplate code and lets the user code only the important parts.&lt;br /&gt;
It is best to abstract out the boilerplate portions into a function. But often the boilerplate code isn't so pretty. Maybe there's a list of variables to be declared in every instance, or maybe there are several pieces of the boilerplate that have to have code inserted in certain circumstances. All of these make a simple function call impossible. In such cases, it is often a good idea to create a mini-language that allows the developer to work with the boilerplate code in an easier fashion. This mini-language will then be converted into your regular source code language before compiling.&lt;br /&gt;
Finally, a lot of programming languages make the developer write really verbose statements to do really simple things. Code-generating programs allow the developer to abbreviate such statements and save a lot of typing, which also prevents a lot of mistakes because there is less chance of mistyping.&lt;br /&gt;
&lt;br /&gt;
==Examples of metaprograms are:==&lt;br /&gt;
&lt;br /&gt;
* Compiler or interpreter of any language&lt;br /&gt;
* Lex and Yacc&lt;br /&gt;
* CORBA's IDL compiler&lt;br /&gt;
* Quine&lt;br /&gt;
* Programs to generate EJB code and XML from database metadata&lt;br /&gt;
* Enhanced Cweb.&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming in Ruby==&lt;br /&gt;
&lt;br /&gt;
===Aspects of Ruby make it easy for metaprogramming:===&lt;br /&gt;
&lt;br /&gt;
====Everything in Ruby is an object==== &lt;br /&gt;
&lt;br /&gt;
This means even native types in other languages such as Integer, Float, String and even the null value (‘nil’ in Ruby) is an object. So ruby doesn’t really have functions, if every single data is an object then every single action on the data is a method.&lt;br /&gt;
&lt;br /&gt;
Following example demonstrates that:&lt;br /&gt;
&lt;br /&gt;
 puts &amp;quot;cat&amp;quot;.class&lt;br /&gt;
 #Here's an iterator method being called on a simple Integer (Fixnum in Ruby)&lt;br /&gt;
 5.times { puts 'hi'}&lt;br /&gt;
 puts 5.class&lt;br /&gt;
&lt;br /&gt;
 #Even nil is an object!&lt;br /&gt;
 puts nil.class&lt;br /&gt;
&lt;br /&gt;
 #You can even define methods in nil! We'll be looking more at this later.&lt;br /&gt;
 def nil.hi&lt;br /&gt;
  puts 'hi!'&lt;br /&gt;
 end&lt;br /&gt;
 nil.hi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Classes and objects are open==== &lt;br /&gt;
&lt;br /&gt;
In Ruby classes are open,it means they are open for enhancing their functionality anytime i.e even at runtime.&amp;lt;ref&amp;gt;[http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 Suppose we have an array [1,2,3,4,5] and we want to find the sum of elements, so we invoke method called ‘sum’ on it.&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 #It gives us ‘No method error’&lt;br /&gt;
&lt;br /&gt;
So now we try to enhance the functionality of Array class by defining a method called sum on it&lt;br /&gt;
&lt;br /&gt;
 Class Array&lt;br /&gt;
  def sum&lt;br /&gt;
     inject(0){|s,v| s+v}&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Now lets try to invoke sum on the array&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 Output: 15&lt;br /&gt;
&lt;br /&gt;
====Code can be manipulated as data==== &lt;br /&gt;
&lt;br /&gt;
Ruby code can evaluate the contents of the string at runtime, which can be used to define classes and methods on the go at runtime.&amp;lt;ref&amp;gt;[http://www.slideshare.net/bsbodden/ruby-metaprogramming-08 http://www.slideshare.net/bsbodden/ruby-metaprogramming-08]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 # say_hello.rb&lt;br /&gt;
 puts “puts ‘Hello World !!’ “&lt;br /&gt;
&lt;br /&gt;
Code that invokes code&lt;br /&gt;
&lt;br /&gt;
 ruby –e “ ‘ruby say_hello.rb’ “&lt;br /&gt;
 Output: Hello World !!&lt;br /&gt;
&lt;br /&gt;
Ruby provides the ‘eval’ family of methods for runtime execution of code that is stored in strings&lt;br /&gt;
&lt;br /&gt;
*‘eval’ can evaluate any string. Other important methods of this family are instance_eval and class_eval.&lt;br /&gt;
 &lt;br /&gt;
 eval(“2*2”)&lt;br /&gt;
 Output: 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Instance_eval] evaluates string or a code block in the context of the receiver (object).&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.instance_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 # ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
&lt;br /&gt;
*[http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html Class_eval] evaluates an string or a code block in the context of the class or module it is invoked on.&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.class_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 # ’hi’&lt;br /&gt;
&lt;br /&gt;
====Deep reflection capabilities==== &lt;br /&gt;
&lt;br /&gt;
In Ruby it's possible to read information about a class or object at runtime. We could use some of the methods like class(), instance_methods(), instance_variables()&amp;lt;ref&amp;gt;[http://www.khelll.com/blog/ruby/ruby-reflection/ http://www.khelll.com/blog/ruby/ruby-reflection/]&amp;lt;/ref&amp;gt; to do that.&lt;br /&gt;
&lt;br /&gt;
=====Example:=====&lt;br /&gt;
&lt;br /&gt;
 # The code in the following class definition is executed immediately&lt;br /&gt;
  &lt;br /&gt;
  Class Rubyist&lt;br /&gt;
   # the code in the following method definition is executed later,&lt;br /&gt;
   # when you eventually call the method&lt;br /&gt;
   &lt;br /&gt;
   def what_does_he_do&lt;br /&gt;
    @person = 'A Rubyist'&lt;br /&gt;
    'Ruby programming'&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  an_object = Rubyist.new&lt;br /&gt;
  puts an_object.class # =&amp;gt; Rubyist&lt;br /&gt;
  puts an_object.class.instance_methods(false) # =&amp;gt; what_does_he_do&lt;br /&gt;
  an_object.what_does_he_do&lt;br /&gt;
  puts an_object.instance_variables # =&amp;gt; @person&lt;br /&gt;
&lt;br /&gt;
===Meta programming techniques:===&lt;br /&gt;
&lt;br /&gt;
====Using Singleton Classes:&amp;lt;ref&amp;gt;[http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html http://ola-bini.blogspot.com/2006/09/ruby-singleton-class.html]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Singleton classes are used to implement instance specific behavior in Ruby.&amp;lt;ref&amp;gt;[http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/ http://www.lucasallan.com/2011/09/05/singleton-classes-on-ruby/]&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 class MyClass &lt;br /&gt;
  def blah&lt;br /&gt;
    'blah'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj = MyClass.new&lt;br /&gt;
 obj.hi # =&amp;gt; NoMethodError&lt;br /&gt;
 &lt;br /&gt;
 def obj.hi&lt;br /&gt;
  'hi'&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj.hi # =&amp;gt; 'hi'&lt;br /&gt;
 &lt;br /&gt;
 another_obj = MyClass.new&lt;br /&gt;
 another_obj.hi # =&amp;gt; NoMethodError &lt;br /&gt;
 &lt;br /&gt;
 obj.class # =&amp;gt; MyClass&lt;br /&gt;
 another_obj.class # =&amp;gt; MyClass&lt;br /&gt;
&lt;br /&gt;
The above code shows one way to add instance-specific behavior. &lt;br /&gt;
&lt;br /&gt;
Interesting thing to note is that the new method is invokable only from the instance it was defined on and not from other instances of the same class. This means that the method was not added to the class of the instance.&lt;br /&gt;
&lt;br /&gt;
Does it mean an object itself can hold method definitions?&lt;br /&gt;
&lt;br /&gt;
Well, the answer is no (unless it's an object that represents a class or a module). One of the reasons the concept of classes exists in Ruby is that they are meant to hold method definitions and act as blueprints for their instances, ie, they determine what methods can be invoked on their instances.&lt;br /&gt;
&lt;br /&gt;
So where did the method 'hi' go?&lt;br /&gt;
&lt;br /&gt;
It goes into the singleton class of the instance. This hidden class is different from the class the instance was created from and is a Ruby implementation detail that is typically not revealed to anyone (there is only one way to get to the singleton class, which is discussed later in the article ). This is the reason it is sometimes called ghost class or anonymous class or shadow class. The singleton class is created for an object as soon as the Ruby interpreter needs to add instance-specific behavior for that object (but not before that). Going forward, if more methods need to be added to the same object, its already-created singleton class is used. Also, more instances cannot be created using a particular singleton class (its new method raises an error). Because of this one-to-one relationship between an object and its singleton class, the word 'singleton' is used.&lt;br /&gt;
&lt;br /&gt;
So, what is the way in which one can get access to an object's singleton class?&lt;br /&gt;
&lt;br /&gt;
 # ... in continuation from previous snippet &lt;br /&gt;
 obj_singleton_class = class &amp;lt;&amp;lt; obj; self; end&lt;br /&gt;
 obj_singleton_class.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
 MyClass.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
&lt;br /&gt;
Here class &amp;lt;&amp;lt; obj; self; end is the key: anything written after class &amp;lt;&amp;lt; obj and before the corresponding end is evaluated against the context of the singleton class of obj, ie, selfpoints to the singleton class.&lt;br /&gt;
&lt;br /&gt;
In the above snippet, we return self, getting a reference to it in the variable obj_singleton_class. We then see that the singleton class fakes the same ancestry as the original class of the object. This implies that when a method is invoked on an object, Ruby first looks for the method definition in the object's singleton class (if it exists), if not, Ruby then continues looking up the normal inheritance hierarchy.&lt;br /&gt;
 &lt;br /&gt;
 # ... in continuation from previous snippet&lt;br /&gt;
 obj.hi # method looked for in singleton class; found; invoked&lt;br /&gt;
 obj.blah # method looked for in singleton class; not found; looked for in MyClass; found; invoked&lt;br /&gt;
 obj.xyz # method looked for in singleton class, MyClass, Object, Kernel; not found; obj.method_missing() called, raising NoMethodError&lt;br /&gt;
&lt;br /&gt;
Let's quickly look at two other ways in which we could have added instance-specific behavior to an object:&lt;br /&gt;
 class &amp;lt;&amp;lt; obj&lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 obj.instance_eval do&lt;br /&gt;
  &lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The former one should be clear from what has already been explained. The latter is tied to how def works with instance_eval (I'll probably cover this in another blog post).&lt;br /&gt;
Now, before concluding, let's take a step back and see if we've seen the syntax discussed so far, before. You'll probably recognize their use in defining class-level methods:&lt;br /&gt;
 &lt;br /&gt;
 Class MyClass&lt;br /&gt;
&lt;br /&gt;
  def MyClass.my_class_method1&lt;br /&gt;
    'class method 1'&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def self.my_class_method2&lt;br /&gt;
    'class method 2'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class &amp;lt;&amp;lt; self&lt;br /&gt;
&lt;br /&gt;
    def my_class_method3&lt;br /&gt;
      'class method 3'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Here all class methods go into the singleton class of the object representing the class, in this case, the object referenced by the constant name:MyClass (remember classes are also objects). After all, these class method definitions need to go somewhere, and in such a way that the methods don't become part of the class's instances (ie, they aren't instance methods) nor do the methods go to the super class.&lt;br /&gt;
&lt;br /&gt;
====Defining methods on the fly:&amp;lt;ref&amp;gt;[http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/ http://gregmoreno.ca/how-to-create-a-class-on-the-fly-in-ruby/]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
Ruby has the ability to define methods on the fly using ‘define_method’&amp;lt;ref&amp;gt;[http://metaclass.org/2007/9/18/define-method http://metaclass.org/2007/9/18/define-method]&amp;lt;/ref&amp;gt;, method_missing, [http://www.infoq.com/articles/eval-options-in-ruby ‘eval’] family methods. &lt;br /&gt;
&lt;br /&gt;
=====Using 'eval' family methods :&amp;lt;ref&amp;gt;[http://ilikestuffblog.com/2009/01/09/fun-with-rubys-instance_eval-and-class_eval/]&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
This is illustrated by following example.&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      class_eval “def greet_in_#{language}; puts ‘#{greeting}’; end”&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
 alan=Person.new&lt;br /&gt;
 alan.greet_in_English&lt;br /&gt;
 #Hello!&lt;br /&gt;
&lt;br /&gt;
 p=Person&lt;br /&gt;
 p.make_greeting(“dutch”,”Hallo!”)&lt;br /&gt;
 lisa=p.new&lt;br /&gt;
 lisa.greet_in_dutch&lt;br /&gt;
 #Hallo!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above example is used to create greetings in different languages on the go. A new greeting is created in make_greeting method, which uses class_eval to evaluate the string that defines a method for a ‘language’ (argument for the make_greeting method). As the method defined using class_val it would in the scope of the entire class (Person). Now to access greet_in_English method we need to create an object and use it to invoke the method. Now to define method at runtime we can invoke make_greeting method using the class (Person.make_greeting(language,greeting)).  And now the newly defined method is available for access by any Person’s object.&lt;br /&gt;
&lt;br /&gt;
The same functionality can be achieved by define method in following was:&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      define_method  “greet_in_#{language};” do &lt;br /&gt;
        puts “#{greeting}”&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
====Defining methods using method_missing:&amp;lt;ref&amp;gt;[http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html http://www.trottercashion.com/2011/02/08/rubys-define_method-method_missing-and-instance_eval.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://technicalpickles.com/posts/using-method_missing-and-respond_to-to-create-dynamic-methods/&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
One of the ways Ruby is dynamic is that we can choose how to handle methods that are called, but don’t actually exist. If we have a lot of very similar methods, we can even use this to define them all at once. Ruby does this using the method_missing method, which we override in the classes where we need more dynamic method calling.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by using following example&amp;lt;ref&amp;gt;[http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/ http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/]&amp;lt;/ref&amp;gt; which creates a widget that store any attribute that is given to it.&lt;br /&gt;
&lt;br /&gt;
 # lib/widget.rb&lt;br /&gt;
 Class Widget&lt;br /&gt;
  def method_missing sym, *args&lt;br /&gt;
    if sym =~ /^(\w+)=$/&lt;br /&gt;
      instance_variable_set &amp;quot;@#{$1}&amp;quot;, args[0]&lt;br /&gt;
    else&lt;br /&gt;
      instance_variable_get &amp;quot;@#{sym}&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 widget = Widget.new&lt;br /&gt;
 #&amp;lt;Widget:0x0000010383f618&amp;gt;&lt;br /&gt;
 widget.name = 'Bob'&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age = 30&lt;br /&gt;
 # 30&lt;br /&gt;
 widget.name&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age&lt;br /&gt;
 # 30&lt;br /&gt;
&lt;br /&gt;
We have a created Widget and no methods are defined in it, so whenever a method is invoked it would call method missing. In method it is looking for a command with ‘=’ symbol that means it assigning something, so if that is the case it would put that variable into the instance variable set for later retrieval. If the command doesn’t have ‘=’ it is simply displaying the attributes from the instance variable set.&lt;br /&gt;
&lt;br /&gt;
====Aliasing:&amp;lt;ref&amp;gt;[http://pragprog.com/book/ppmetr/metaprogramming-ruby Aliasing]&amp;lt;/ref&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
We can redefine a method in an existing class by opening it up and rewriting it, but since we cannot loose the behaviour provided by the original method, we can use alias_method.&lt;br /&gt;
alias        :new  :old&lt;br /&gt;
alias_method :new, :old&lt;br /&gt;
&lt;br /&gt;
Syntax&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.ruby-forum.com/topic/135598 http://www.ruby-forum.com/topic/135598]&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
alias method-name method-name&lt;br /&gt;
alias global-variable-name global-variable-name&lt;br /&gt;
&lt;br /&gt;
Creates a new reference to whatever old referred to. old can be any existing method, operator, global. It may not be a local, instance, constant, or class variable. Alias_method is used when there is a need to override a method but still count on its old behaviour. 	&lt;br /&gt;
 &lt;br /&gt;
Example1:&lt;br /&gt;
&lt;br /&gt;
alias foo bar  -&amp;gt; Creates a foo alias for bar&lt;br /&gt;
&lt;br /&gt;
alias $MATCH $&amp;amp; -&amp;gt; $MATCH is an alias for $&amp;amp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
&lt;br /&gt;
1.	def oldmtd  &lt;br /&gt;
2.	  &amp;quot;old method&amp;quot;  &lt;br /&gt;
3.	end  &lt;br /&gt;
4.	alias newmtd oldmtd  &lt;br /&gt;
5.	def oldmtd  &lt;br /&gt;
6.	  &amp;quot;old improved method&amp;quot;  &lt;br /&gt;
7.	end  &lt;br /&gt;
8.	puts oldmtd  &lt;br /&gt;
9.	puts newmtd  &lt;br /&gt;
&lt;br /&gt;
The output is:&lt;br /&gt;
1.	old improved method  &lt;br /&gt;
2.	old method  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local variables, instance variables, class variables and constants may not be aliased. The parameters to alias may be names or symbols.  When a method is aliased, the new name refers to a copy of the original method’s body. If the method is subsequently redefined, the aliased name will still invoke the original implementation. Aliases cannot be defined within the method body. The alias of the method keeps the current definition of the method even when the methods are overridden.&lt;br /&gt;
Making aliases for the numbered global variables ($1,$2,….) is prohibited. Overriding the built in global variables may cause serious problems.&lt;br /&gt;
&lt;br /&gt;
====Modules:====&lt;br /&gt;
&lt;br /&gt;
Module&amp;lt;ref&amp;gt;[http://www.rubyist.net/~slagell/ruby/modules.html Modules]&amp;lt;/ref&amp;gt; is just a bunch of instance methods. A class is just a module but has certain additional features like a superclass and a new() method. The main reason for having both modules and class in Ruby is to make the code more explicit. A module&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html]&amp;lt;/ref&amp;gt; is used in situations where it has to be included somewhere or when it needs to be used as a namespace. A class is used when it needs to be instantiated or inherited.&lt;br /&gt;
A module can be included by a class. A module can be shared between and included by multiple classes at the same time.  Modules can be used to organize constants in the same way as directories are used to organize files.&lt;br /&gt;
	&lt;br /&gt;
Example&amp;lt;ref&amp;gt;[http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/ http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
module Stats&lt;br /&gt;
  def max_health&lt;br /&gt;
    100&lt;br /&gt;
  end&lt;br /&gt;
  def constitution&lt;br /&gt;
    50&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Character&lt;br /&gt;
  include Stats&lt;br /&gt;
  attr_accessor:name&lt;br /&gt;
  attr_accessor:location&lt;br /&gt;
  def talk; end&lt;br /&gt;
  def walk; end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
In the above example we have extracted max_health and constitution into a module. The Character class incudes the Stats module. Whenever a method  is called on an instance of Character, that cannot be found in the referenced class, Ruby will look if the method can be found in one of the included modules. This is not the same as inheritance. Multiple modules can be included at the same time.&lt;br /&gt;
 Modules define a namespace, a sandbox in which your methods and constants can play without having to worry about being stepped on by other methods and constants.&lt;br /&gt;
include mixes a module into a class or another module. Methods from that the module are called function-style (without a receiver).&lt;br /&gt;
&lt;br /&gt;
Extend keyword can be used to extend a single functionality for the object. Adds to object the instance methods from each module given as a parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 module Mod&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 class Klass&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 k = Klass.new&lt;br /&gt;
 k.hello	»	&amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
 k.extend(Mod)	» #&amp;lt;Klass:0x401b598c&amp;gt;&lt;br /&gt;
 k.hello	» &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extend is used to include a module in an object(instance). Methods in the module become methods in the object&lt;br /&gt;
&lt;br /&gt;
The possibilities meta programing opens up seem to be endless. Joining on the way are endless possibilities to do something wrong.  “with great power comes great responsibility”&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[http://pedromtavares.wordpress.com/2010/02/24/ruby-object-model-and-metaprogramming/ More About Metaprogramming]&lt;br /&gt;
&lt;br /&gt;
[http://www.devalot.com/articles/2008/09/ruby-singleton More about Singleton Classes]&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=53429</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4g ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=53429"/>
		<updated>2011-10-20T23:59:12Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Metaprogramming?==&lt;br /&gt;
&lt;br /&gt;
Metaprogramming&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]&amp;lt;/ref&amp;gt; can change the way you program in your programming language. This is the most under used programming techniques is writing programs that generate programs ro program parts. Metaprogramming is writing computer programs that manipulate other programs or that which  do  a part of their work at compile time that would otherwise be done at runtime. This is very advantageous because it gives greater flexibility to programs to efficiently handle new situations without recompilation. Languages which provide metaprogramming are called metalanguages.  Metaprograms treat themselves as part of data and they can modify their own structure and behaviour. &lt;br /&gt;
&lt;br /&gt;
==History of Metaprogramming:==&lt;br /&gt;
&lt;br /&gt;
Not all metaprogramming involves generative programming. If programs are modifiable at runtime or if an incremental compilation is available, then techniques can be used to perform metaprogramming without actually generating source code.&lt;br /&gt;
Template metaprogramming is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions.&lt;br /&gt;
In C-language, one of the popular examples of meta-programming is the Lex/Yacc system for generation of parsers and lexical scanners. That is, it reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in C. Instead of doing the laborious work of generating a parser in C, one can use Yacc to generate the repetitive parts of the program. Then, one can add only the code necessary to operate on the parsed entities.&lt;br /&gt;
Metaprogramming in Java comprises of three main components reflection, generics, annotations.&lt;br /&gt;
&lt;br /&gt;
==Uses of Metaprogramming:&amp;lt;ref&amp;gt;[http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Metaprogramming&amp;lt;ref&amp;gt;[http://www.ibm.com/developerworks/linux/library/l-metaprog1/index.html Uses]&amp;lt;/ref&amp;gt; allows us to write programs that will pre-generate tables of data for use at runtime. For example, if a quick lookup table for the sine of all 8-bit integers is needed, then the sin can either be calculated and hand coded or the program can be made to build the table at startup at runtime or a program can used to build the custom code for the table before compile-time. While it may make sense to build the table at runtime for such a small set of numbers, other such tasks may cause program startup to be prohibitively slow. In such cases, writing a program to build static data tables is usually the best answer.&lt;br /&gt;
* A mini language can be created when there are a lot of functions which include a lot of boilerplate code. This mini language will do the boilerplate code and lets the user code only the important parts.&lt;br /&gt;
It is best to abstract out the boilerplate portions into a function. But often the boilerplate code isn't so pretty. Maybe there's a list of variables to be declared in every instance, or maybe there are several pieces of the boilerplate that have to have code inserted in certain circumstances. All of these make a simple function call impossible. In such cases, it is often a good idea to create a mini-language that allows the developer to work with the boilerplate code in an easier fashion. This mini-language will then be converted into your regular source code language before compiling.&lt;br /&gt;
Finally, a lot of programming languages make the developer write really verbose statements to do really simple things. Code-generating programs allow the developer to abbreviate such statements and save a lot of typing, which also prevents a lot of mistakes because there is less chance of mistyping.&lt;br /&gt;
&lt;br /&gt;
==Examples of metaprograms are:==&lt;br /&gt;
&lt;br /&gt;
* Compiler or interpreter of any language&lt;br /&gt;
* Lex and Yacc&lt;br /&gt;
* CORBA's IDL compiler&lt;br /&gt;
* Quine&lt;br /&gt;
* Programs to generate EJB code and XML from database metadata&lt;br /&gt;
* Enhanced Cweb.&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming in Ruby==&lt;br /&gt;
&lt;br /&gt;
===Aspects of Ruby make it easy for metaprogramming:===&lt;br /&gt;
&lt;br /&gt;
====Everything in Ruby is an object==== &lt;br /&gt;
&lt;br /&gt;
This means even native types in other languages such as Integer, Float, String and even the null value (‘nil’ in Ruby) is an object. So ruby doesn’t really have functions, if every single data is an object then every single action on the data is a method.&lt;br /&gt;
&lt;br /&gt;
Following example demonstrates that:&lt;br /&gt;
&lt;br /&gt;
 puts &amp;quot;cat&amp;quot;.class&lt;br /&gt;
 #Here's an iterator method being called on a simple Integer (Fixnum in Ruby)&lt;br /&gt;
 5.times { puts 'hi'}&lt;br /&gt;
 puts 5.class&lt;br /&gt;
&lt;br /&gt;
 #Even nil is an object!&lt;br /&gt;
 puts nil.class&lt;br /&gt;
&lt;br /&gt;
 #You can even define methods in nil! We'll be looking more at this later.&lt;br /&gt;
 def nil.hi&lt;br /&gt;
  puts 'hi!'&lt;br /&gt;
 end&lt;br /&gt;
 nil.hi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Classes and objects are open==== &lt;br /&gt;
&lt;br /&gt;
In Ruby classes are open that means open for enhancing their functionality anytime i.e even at runtime.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 Suppose we have an array [1,2,3,4,5] and we want to find the sum of elements, so we invoke method called ‘sum’ on it.&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 #It gives us ‘No method error’&lt;br /&gt;
&lt;br /&gt;
So we try to enhance the functionality of Array class by defining a method called sum on it&lt;br /&gt;
&lt;br /&gt;
 Class Array&lt;br /&gt;
  def sum&lt;br /&gt;
     inject(0){|s,v| s+v}&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Now lets try to invoke sum on the array&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 Output: 15&lt;br /&gt;
&lt;br /&gt;
====Code can be manipulated as data==== &lt;br /&gt;
&lt;br /&gt;
Ruby code can evaluate the contents of the string.&lt;br /&gt;
&lt;br /&gt;
This will illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 # say_hello.rb&lt;br /&gt;
 puts “puts ‘Hello World !!’ “&lt;br /&gt;
&lt;br /&gt;
Code that invokes code&lt;br /&gt;
&lt;br /&gt;
 ruby –e “ ‘ruby say_hello.rb’ “&lt;br /&gt;
 Output: Hello World !!&lt;br /&gt;
&lt;br /&gt;
Ruby provides the ‘eval’ family of methods for runtime execution of code stored in strings&lt;br /&gt;
&lt;br /&gt;
*‘eval’ can evaluate any string. Other important methods of this family are instance_eval and class_eval.&lt;br /&gt;
 &lt;br /&gt;
 eval(“2*2”)&lt;br /&gt;
 Output: 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Instance_eval evaluates string or a code block in the context of the receiver (object).&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.instance_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 # ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
&lt;br /&gt;
*Class_eval evaluates an string or a code block in the context of the class or module it is invoked on.&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.class_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 # ’hi’  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Deep reflection capabilities==== &lt;br /&gt;
&lt;br /&gt;
In Ruby it's possible to read information about a class or object at runtime. We could use some of the methods like class(), instance_methods(), instance_variables() to do that.&lt;br /&gt;
&lt;br /&gt;
=====Example:=====&lt;br /&gt;
&lt;br /&gt;
 # The code in the following class definition is executed immediately&lt;br /&gt;
  &lt;br /&gt;
  Class Rubyist&lt;br /&gt;
   # the code in the following method definition is executed later,&lt;br /&gt;
   # when you eventually call the method&lt;br /&gt;
   &lt;br /&gt;
   def what_does_he_do&lt;br /&gt;
    @person = 'A Rubyist'&lt;br /&gt;
    'Ruby programming'&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  an_object = Rubyist.new&lt;br /&gt;
  puts an_object.class # =&amp;gt; Rubyist&lt;br /&gt;
  puts an_object.class.instance_methods(false) # =&amp;gt; what_does_he_do&lt;br /&gt;
  an_object.what_does_he_do&lt;br /&gt;
  puts an_object.instance_variables # =&amp;gt; @person&lt;br /&gt;
&lt;br /&gt;
===Meta programming techniques:===&lt;br /&gt;
&lt;br /&gt;
====Using Singleton Classes:====&lt;br /&gt;
&lt;br /&gt;
Singleton classes are used to implement instance specific behavior in Ruby. &lt;br /&gt;
&lt;br /&gt;
 class MyClass &lt;br /&gt;
  def blah&lt;br /&gt;
    'blah'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj = MyClass.new&lt;br /&gt;
 obj.hi # =&amp;gt; NoMethodError&lt;br /&gt;
 &lt;br /&gt;
 def obj.hi&lt;br /&gt;
  'hi'&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj.hi # =&amp;gt; 'hi'&lt;br /&gt;
 &lt;br /&gt;
 another_obj = MyClass.new&lt;br /&gt;
 another_obj.hi # =&amp;gt; NoMethodError &lt;br /&gt;
 &lt;br /&gt;
 obj.class # =&amp;gt; MyClass&lt;br /&gt;
 another_obj.class # =&amp;gt; MyClass&lt;br /&gt;
&lt;br /&gt;
The above code shows one way to add instance-specific behavior. Interesting thing to note is that the new method is invokable only from the instance it was defined on and not from other instances of the same class. This means that the method was not added to the class of the instance.&lt;br /&gt;
&lt;br /&gt;
Does that mean that an object itself can hold method definitions?&lt;br /&gt;
Well, the answer is no (unless it's an object that represents a class or a module). One of the reasons the concept of classes exists in Ruby is that they are meant to hold method definitions and act as blueprints for their instances, ie, they determine what methods can be invoked on their instances.&lt;br /&gt;
&lt;br /&gt;
So where did the method hi go?&lt;br /&gt;
Yes, that's correct, it went into the singleton class of the instance. This hidden class is different from the class the instance was created from and is a Ruby implementation detail that is typically not revealed to anyone (there is only one way to get to the singleton class, which is discussed later in the article ). This is the reason it is sometimes called ghost class or anonymous class or shadow class. The singleton class is created for an object as soon as the Ruby interpreter needs to add instance-specific behavior for that object (but not before that). Going forward, if more methods need to be added to the same object, its already-created singleton class is used. Also, more instances cannot be created using a particular singleton class (its newmethod raises an error). Because of this one-to-one relationship between an object and its singleton class, the word 'singleton' is used.&lt;br /&gt;
&lt;br /&gt;
So, what is the way in which one can get access to an object's singleton class?&lt;br /&gt;
&lt;br /&gt;
 # ... in continuation from previous snippet &lt;br /&gt;
 obj_singleton_class = class &amp;lt;&amp;lt; obj; self; end&lt;br /&gt;
 obj_singleton_class.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
 MyClass.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
&lt;br /&gt;
Here class &amp;lt;&amp;lt; obj; self; end is the key: anything written after class &amp;lt;&amp;lt; obj and before the corresponding end is evaluated against the context of the singleton class of obj, ie, selfpoints to the singleton class.&lt;br /&gt;
&lt;br /&gt;
In the above snippet, we return self, getting a reference to it in the variable obj_singleton_class. We then see that the singleton class fakes the same ancestry as the original class of the object. This implies that when a method is invoked on an object, Ruby first looks for the method definition in the object's singleton class (if it exists), if not, Ruby then continues looking up the normal inheritance hierarchy.&lt;br /&gt;
 &lt;br /&gt;
 # ... in continuation from previous snippet&lt;br /&gt;
 obj.hi # method looked for in singleton class; found; invoked&lt;br /&gt;
 obj.blah # method looked for in singleton class; not found; looked for in MyClass; found; invoked&lt;br /&gt;
 obj.xyz # method looked for in singleton class, MyClass, Object, Kernel; not found; obj.method_missing() called, raising NoMethodError&lt;br /&gt;
&lt;br /&gt;
Now hopefully we have understood how singleton classes work.&lt;br /&gt;
Let's quickly look at two other ways in which we could have added instance-specific behavior to an object:&lt;br /&gt;
 class &amp;lt;&amp;lt; obj&lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 obj.instance_eval do&lt;br /&gt;
  &lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The former one should be clear from what has already been explained. The latter is tied to how def works with instance_eval (I'll probably cover this in another blog post).&lt;br /&gt;
Now, before concluding, let's take a step back and see if we've seen the syntax discussed so far, before. You'll probably recognize their use in defining class-level methods:&lt;br /&gt;
 &lt;br /&gt;
 Class MyClass&lt;br /&gt;
&lt;br /&gt;
  def MyClass.my_class_method1&lt;br /&gt;
    'class method 1'&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def self.my_class_method2&lt;br /&gt;
    'class method 2'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class &amp;lt;&amp;lt; self&lt;br /&gt;
&lt;br /&gt;
    def my_class_method3&lt;br /&gt;
      'class method 3'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And yes, you've guessed right: all class methods go into the singleton class of the object representing the class, in this case, the object referenced by the constant name:MyClass (remember classes are also objects). After all, these class method definitions need to go somewhere, and in such a way that the methods don't become part of the class's instances (ie, they aren't instance methods) nor do the methods go to the super class.&lt;br /&gt;
&lt;br /&gt;
====Defining methods on the fly:====&lt;br /&gt;
&lt;br /&gt;
Ruby has the ability to define methods on the fly using ‘define_method’, method_missing, ‘eval’ family methods. &lt;br /&gt;
&lt;br /&gt;
This is illustrated by following example.&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      class_eval “def greet_in_#{language}; puts ‘#{greeting}’; end”&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
 alan=Person.new&lt;br /&gt;
 alan.greet_in_English&lt;br /&gt;
 #Hello!&lt;br /&gt;
&lt;br /&gt;
 p=Person&lt;br /&gt;
 p.make_greeting(“dutch”,”Hallo!”)&lt;br /&gt;
 lisa=p.new&lt;br /&gt;
 lisa.greet_in_dutch&lt;br /&gt;
 #Hallo!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above example is used to create greetings in different languages on the go. A new greeting is created in make_greeting method, which uses class_eval to evaluate the string that defines a method for a ‘language’ (argument for the make_greeting method). As the method defined using class_val it would in the scope of the entire class (Person). Now to access greet_in_English method we need to create an object and use it to invoke the method. Now to define method at runtime we can invoke make_greeting method using the class (Person.make_greeting(language,greeting)).  And now the newly defined method is available for access by any Person’s object.&lt;br /&gt;
&lt;br /&gt;
The same functionality can be achieved by define method in following was:&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      define_method  “greet_in_#{language};” do &lt;br /&gt;
        puts “#{greeting}”&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
====Defining methods using method_missing:====&lt;br /&gt;
&lt;br /&gt;
One of the ways Ruby is dynamic is that we can choose how to handle methods that are called, but don’t actually exist. If we have a lot of very similar methods, we can even use this to define them all at once. Ruby does this using the method_missing method, which we override in the classes where we need more dynamic method calling.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by using following example which creates a widget that store any attribute that is given to it.&lt;br /&gt;
&lt;br /&gt;
 # lib/widget.rb&lt;br /&gt;
 Class Widget&lt;br /&gt;
  def method_missing sym, *args&lt;br /&gt;
    if sym =~ /^(\w+)=$/&lt;br /&gt;
      instance_variable_set &amp;quot;@#{$1}&amp;quot;, args[0]&lt;br /&gt;
    else&lt;br /&gt;
      instance_variable_get &amp;quot;@#{sym}&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 widget = Widget.new&lt;br /&gt;
 #&amp;lt;Widget:0x0000010383f618&amp;gt;&lt;br /&gt;
 widget.name = 'Bob'&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age = 30&lt;br /&gt;
 # 30&lt;br /&gt;
 widget.name&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age&lt;br /&gt;
 # 30&lt;br /&gt;
&lt;br /&gt;
We have a created Widget and no methods are defined in it, so whenever a method is invoked it would call method missing. In method it is looking for a command with ‘=’ symbol that means it assigning something, so if that is the case it would put that variable into the instance variable set for later retrieval. If the command doesn’t have ‘=’ it is simply displaying the attributes from the instance variable set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/&lt;br /&gt;
&lt;br /&gt;
==Aliasing:&amp;lt;ref&amp;gt;[http://pragprog.com/book/ppmetr/metaprogramming-ruby Aliasing]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
We can redefine a method in an existing class by opening it up and rewriting it, but since we cannot loose the behaviour provided by the original method, we can use alias_method.&lt;br /&gt;
alias        :new  :old&lt;br /&gt;
alias_method :new, :old&lt;br /&gt;
&lt;br /&gt;
Syntax&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.ruby-forum.com/topic/135598 http://www.ruby-forum.com/topic/135598]&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
alias method-name method-name&lt;br /&gt;
alias global-variable-name global-variable-name&lt;br /&gt;
&lt;br /&gt;
Creates a new reference to whatever old referred to. old can be any existing method, operator, global. It may not be a local, instance, constant, or class variable. Alias_method is used when there is a need to override a method but still count on its old behaviour. 	&lt;br /&gt;
 &lt;br /&gt;
Example1:&lt;br /&gt;
&lt;br /&gt;
alias foo bar   Creates a foo alias for bar&lt;br /&gt;
alias $MATCH $&amp;amp;  $MATCH is an alias for $&amp;amp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
&lt;br /&gt;
1.	def oldmtd  &lt;br /&gt;
2.	  &amp;quot;old method&amp;quot;  &lt;br /&gt;
3.	end  &lt;br /&gt;
4.	alias newmtd oldmtd  &lt;br /&gt;
5.	def oldmtd  &lt;br /&gt;
6.	  &amp;quot;old improved method&amp;quot;  &lt;br /&gt;
7.	end  &lt;br /&gt;
8.	puts oldmtd  &lt;br /&gt;
9.	puts newmtd  &lt;br /&gt;
&lt;br /&gt;
The output is:&lt;br /&gt;
1.	old improved method  &lt;br /&gt;
2.	old method  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local variables, instance variables, class variables and constants may not be aliased. The parameters to alias may be names or symbols.  When a method is aliased, the new name refers to a copy of the original method’s body. If the method is subsequently redefined, the aliased name will still invoke the original implementation. Aliases cannot be defined within the method body. The alias of the method keeps the current definition of the method even when the methods are overridden.&lt;br /&gt;
Making aliases for the numbered global variables ($1,$2,….) is prohibited. Overriding the built in global variables may cause serious problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Modules:==&lt;br /&gt;
Module&amp;lt;ref&amp;gt;[http://www.rubyist.net/~slagell/ruby/modules.html Modules]&amp;lt;/ref&amp;gt; is just a bunch of instance methods. A class is just a module but has certain additional features like a superclass and a new() method. The main reason for having both modules and class in Ruby is to make the code more explicit. A module&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html]&amp;lt;/ref&amp;gt; is used in situations where it has to be included somewhere or when it needs to be used as a namespace. A class is used when it needs to be instantiated or inherited.&lt;br /&gt;
A module can be included by a class. A module can be shared between and included by multiple classes at the same time.  Modules can be used to organize constants in the same way as directories are used to organize files.&lt;br /&gt;
	&lt;br /&gt;
Example&amp;lt;ref&amp;gt;[http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/ http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
module Stats&lt;br /&gt;
  def max_health&lt;br /&gt;
    100&lt;br /&gt;
  end&lt;br /&gt;
  def constitution&lt;br /&gt;
    50&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Character&lt;br /&gt;
  include Stats&lt;br /&gt;
  attr_accessor:name&lt;br /&gt;
  attr_accessor:location&lt;br /&gt;
  def talk; end&lt;br /&gt;
  def walk; end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
In the above example we have extracted max_health and constitution into a module. The Character class incudes the Stats module. Whenever a method  is called on an instance of Character, that cannot be found in the referenced class, Ruby will look if the method can be found in one of the included modules. This is not the same as inheritance. Multiple modules can be included at the same time.&lt;br /&gt;
 Modules define a namespace, a sandbox in which your methods and constants can play without having to worry about being stepped on by other methods and constants.&lt;br /&gt;
include mixes a module into a class or another module. Methods from that the module are called function-style (without a receiver).&lt;br /&gt;
&lt;br /&gt;
Extend keyword can be used to extend a single functionality for the object. Adds to object the instance methods from each module given as a parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 module Mod&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 class Klass&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 k = Klass.new&lt;br /&gt;
 k.hello	»	&amp;quot;Hello from Klass.&amp;quot;&lt;br /&gt;
 k.extend(Mod)	» #&amp;lt;Klass:0x401b598c&amp;gt;&lt;br /&gt;
 k.hello	» &amp;quot;Hello from Mod.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extend is used to include a module in an object(instance). Methods in the module become methods in the object&lt;br /&gt;
&lt;br /&gt;
The possibilities meta programing opens up seem to be endless. Joining on the way are endless possibilities to do something wrong.  “with great power comes great responsibility”&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=53416</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4g ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=53416"/>
		<updated>2011-10-20T23:55:16Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Metaprogramming?==&lt;br /&gt;
&lt;br /&gt;
Metaprogramming&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]&amp;lt;/ref&amp;gt; can change the way you program in your programming language. This is the most under used programming techniques is writing programs that generate programs ro program parts. Metaprogramming is writing computer programs that manipulate other programs or that which  do  a part of their work at compile time that would otherwise be done at runtime. This is very advantageous because it gives greater flexibility to programs to efficiently handle new situations without recompilation. Languages which provide metaprogramming are called metalanguages.  Metaprograms treat themselves as part of data and they can modify their own structure and behaviour. &lt;br /&gt;
&lt;br /&gt;
==History of Metaprogramming:==&lt;br /&gt;
&lt;br /&gt;
Not all metaprogramming involves generative programming. If programs are modifiable at runtime or if an incremental compilation is available, then techniques can be used to perform metaprogramming without actually generating source code.&lt;br /&gt;
Template metaprogramming is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions.&lt;br /&gt;
In C-language, one of the popular examples of meta-programming is the Lex/Yacc system for generation of parsers and lexical scanners. That is, it reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in C. Instead of doing the laborious work of generating a parser in C, one can use Yacc to generate the repetitive parts of the program. Then, one can add only the code necessary to operate on the parsed entities.&lt;br /&gt;
Metaprogramming in Java comprises of three main components reflection, generics, annotations.&lt;br /&gt;
&lt;br /&gt;
==Uses of Metaprogramming:&amp;lt;ref&amp;gt;[http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Metaprogramming&amp;lt;ref&amp;gt;[http://www.ibm.com/developerworks/linux/library/l-metaprog1/index.html Uses]&amp;lt;/ref&amp;gt; allows us to write programs that will pre-generate tables of data for use at runtime. For example, if a quick lookup table for the sine of all 8-bit integers is needed, then the sin can either be calculated and hand coded or the program can be made to build the table at startup at runtime or a program can used to build the custom code for the table before compile-time. While it may make sense to build the table at runtime for such a small set of numbers, other such tasks may cause program startup to be prohibitively slow. In such cases, writing a program to build static data tables is usually the best answer.&lt;br /&gt;
* A mini language can be created when there are a lot of functions which include a lot of boilerplate code. This mini language will do the boilerplate code and lets the user code only the important parts.&lt;br /&gt;
It is best to abstract out the boilerplate portions into a function. But often the boilerplate code isn't so pretty. Maybe there's a list of variables to be declared in every instance, or maybe there are several pieces of the boilerplate that have to have code inserted in certain circumstances. All of these make a simple function call impossible. In such cases, it is often a good idea to create a mini-language that allows the developer to work with the boilerplate code in an easier fashion. This mini-language will then be converted into your regular source code language before compiling.&lt;br /&gt;
Finally, a lot of programming languages make the developer write really verbose statements to do really simple things. Code-generating programs allow the developer to abbreviate such statements and save a lot of typing, which also prevents a lot of mistakes because there is less chance of mistyping.&lt;br /&gt;
&lt;br /&gt;
==Examples of metaprograms are:==&lt;br /&gt;
&lt;br /&gt;
* Compiler or interpreter of any language&lt;br /&gt;
* Lex and Yacc&lt;br /&gt;
* CORBA's IDL compiler&lt;br /&gt;
* Quine&lt;br /&gt;
* Programs to generate EJB code and XML from database metadata&lt;br /&gt;
* Enhanced Cweb.&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming in Ruby==&lt;br /&gt;
&lt;br /&gt;
===Aspects of Ruby make it easy for metaprogramming:===&lt;br /&gt;
&lt;br /&gt;
====Everything in Ruby is an object==== &lt;br /&gt;
&lt;br /&gt;
This means even native types in other languages such as Integer, Float, String and even the null value (‘nil’ in Ruby) is an object. So ruby doesn’t really have functions, if every single data is an object then every single action on the data is a method.&lt;br /&gt;
&lt;br /&gt;
Following example demonstrates that:&lt;br /&gt;
&lt;br /&gt;
 puts &amp;quot;cat&amp;quot;.class&lt;br /&gt;
 #Here's an iterator method being called on a simple Integer (Fixnum in Ruby)&lt;br /&gt;
 5.times { puts 'hi'}&lt;br /&gt;
 puts 5.class&lt;br /&gt;
&lt;br /&gt;
 #Even nil is an object!&lt;br /&gt;
 puts nil.class&lt;br /&gt;
&lt;br /&gt;
 #You can even define methods in nil! We'll be looking more at this later.&lt;br /&gt;
 def nil.hi&lt;br /&gt;
  puts 'hi!'&lt;br /&gt;
 end&lt;br /&gt;
 nil.hi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Classes and objects are open==== &lt;br /&gt;
&lt;br /&gt;
In Ruby classes are open that means open for enhancing their functionality anytime i.e even at runtime.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 Suppose we have an array [1,2,3,4,5] and we want to find the sum of elements, so we invoke method called ‘sum’ on it.&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 #It gives us ‘No method error’&lt;br /&gt;
&lt;br /&gt;
So we try to enhance the functionality of Array class by defining a method called sum on it&lt;br /&gt;
&lt;br /&gt;
 Class Array&lt;br /&gt;
  def sum&lt;br /&gt;
     inject(0){|s,v| s+v}&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Now lets try to invoke sum on the array&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 Output: 15&lt;br /&gt;
&lt;br /&gt;
====Code can be manipulated as data==== &lt;br /&gt;
&lt;br /&gt;
Ruby code can evaluate the contents of the string.&lt;br /&gt;
&lt;br /&gt;
This will illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 # say_hello.rb&lt;br /&gt;
 puts “puts ‘Hello World !!’ “&lt;br /&gt;
&lt;br /&gt;
Code that invokes code&lt;br /&gt;
&lt;br /&gt;
 ruby –e “ ‘ruby say_hello.rb’ “&lt;br /&gt;
 Output: Hello World !!&lt;br /&gt;
&lt;br /&gt;
Ruby provides the ‘eval’ family of methods for runtime execution of code stored in strings&lt;br /&gt;
&lt;br /&gt;
*‘eval’ can evaluate any string. Other important methods of this family are instance_eval and class_eval.&lt;br /&gt;
 &lt;br /&gt;
 eval(“2*2”)&lt;br /&gt;
 Output: 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Instance_eval evaluates string or a code block in the context of the receiver (object).&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.instance_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 # ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
&lt;br /&gt;
*Class_eval evaluates an string or a code block in the context of the class or module it is invoked on.&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.class_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 # ’hi’  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Deep reflection capabilities==== &lt;br /&gt;
&lt;br /&gt;
In Ruby it's possible to read information about a class or object at runtime. We could use some of the methods like class(), instance_methods(), instance_variables() to do that.&lt;br /&gt;
&lt;br /&gt;
=====Example:=====&lt;br /&gt;
&lt;br /&gt;
 # The code in the following class definition is executed immediately&lt;br /&gt;
  &lt;br /&gt;
  Class Rubyist&lt;br /&gt;
   # the code in the following method definition is executed later,&lt;br /&gt;
   # when you eventually call the method&lt;br /&gt;
   &lt;br /&gt;
   def what_does_he_do&lt;br /&gt;
    @person = 'A Rubyist'&lt;br /&gt;
    'Ruby programming'&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  an_object = Rubyist.new&lt;br /&gt;
  puts an_object.class # =&amp;gt; Rubyist&lt;br /&gt;
  puts an_object.class.instance_methods(false) # =&amp;gt; what_does_he_do&lt;br /&gt;
  an_object.what_does_he_do&lt;br /&gt;
  puts an_object.instance_variables # =&amp;gt; @person&lt;br /&gt;
&lt;br /&gt;
===Meta programming techniques:===&lt;br /&gt;
&lt;br /&gt;
====Using Singleton Classes:====&lt;br /&gt;
&lt;br /&gt;
Singleton classes are used to implement instance specific behavior in Ruby. &lt;br /&gt;
&lt;br /&gt;
 class MyClass &lt;br /&gt;
  def blah&lt;br /&gt;
    'blah'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj = MyClass.new&lt;br /&gt;
 obj.hi # =&amp;gt; NoMethodError&lt;br /&gt;
 &lt;br /&gt;
 def obj.hi&lt;br /&gt;
  'hi'&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj.hi # =&amp;gt; 'hi'&lt;br /&gt;
 &lt;br /&gt;
 another_obj = MyClass.new&lt;br /&gt;
 another_obj.hi # =&amp;gt; NoMethodError &lt;br /&gt;
 &lt;br /&gt;
 obj.class # =&amp;gt; MyClass&lt;br /&gt;
 another_obj.class # =&amp;gt; MyClass&lt;br /&gt;
&lt;br /&gt;
The above code shows one way to add instance-specific behavior. Interesting thing to note is that the new method is invokable only from the instance it was defined on and not from other instances of the same class. This means that the method was not added to the class of the instance.&lt;br /&gt;
&lt;br /&gt;
Does that mean that an object itself can hold method definitions?&lt;br /&gt;
Well, the answer is no (unless it's an object that represents a class or a module). One of the reasons the concept of classes exists in Ruby is that they are meant to hold method definitions and act as blueprints for their instances, ie, they determine what methods can be invoked on their instances.&lt;br /&gt;
&lt;br /&gt;
So where did the method hi go?&lt;br /&gt;
Yes, that's correct, it went into the singleton class of the instance. This hidden class is different from the class the instance was created from and is a Ruby implementation detail that is typically not revealed to anyone (there is only one way to get to the singleton class, which is discussed later in the article ). This is the reason it is sometimes called ghost class or anonymous class or shadow class. The singleton class is created for an object as soon as the Ruby interpreter needs to add instance-specific behavior for that object (but not before that). Going forward, if more methods need to be added to the same object, its already-created singleton class is used. Also, more instances cannot be created using a particular singleton class (its newmethod raises an error). Because of this one-to-one relationship between an object and its singleton class, the word 'singleton' is used.&lt;br /&gt;
&lt;br /&gt;
So, what is the way in which one can get access to an object's singleton class?&lt;br /&gt;
&lt;br /&gt;
 # ... in continuation from previous snippet &lt;br /&gt;
 obj_singleton_class = class &amp;lt;&amp;lt; obj; self; end&lt;br /&gt;
 obj_singleton_class.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
 MyClass.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
&lt;br /&gt;
Here class &amp;lt;&amp;lt; obj; self; end is the key: anything written after class &amp;lt;&amp;lt; obj and before the corresponding end is evaluated against the context of the singleton class of obj, ie, selfpoints to the singleton class.&lt;br /&gt;
&lt;br /&gt;
In the above snippet, we return self, getting a reference to it in the variable obj_singleton_class. We then see that the singleton class fakes the same ancestry as the original class of the object. This implies that when a method is invoked on an object, Ruby first looks for the method definition in the object's singleton class (if it exists), if not, Ruby then continues looking up the normal inheritance hierarchy.&lt;br /&gt;
 &lt;br /&gt;
 # ... in continuation from previous snippet&lt;br /&gt;
 obj.hi # method looked for in singleton class; found; invoked&lt;br /&gt;
 obj.blah # method looked for in singleton class; not found; looked for in MyClass; found; invoked&lt;br /&gt;
 obj.xyz # method looked for in singleton class, MyClass, Object, Kernel; not found; obj.method_missing() called, raising NoMethodError&lt;br /&gt;
&lt;br /&gt;
Now hopefully we have understood how singleton classes work.&lt;br /&gt;
Let's quickly look at two other ways in which we could have added instance-specific behavior to an object:&lt;br /&gt;
 class &amp;lt;&amp;lt; obj&lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 obj.instance_eval do&lt;br /&gt;
  &lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The former one should be clear from what has already been explained. The latter is tied to how def works with instance_eval (I'll probably cover this in another blog post).&lt;br /&gt;
Now, before concluding, let's take a step back and see if we've seen the syntax discussed so far, before. You'll probably recognize their use in defining class-level methods:&lt;br /&gt;
 &lt;br /&gt;
 Class MyClass&lt;br /&gt;
&lt;br /&gt;
  def MyClass.my_class_method1&lt;br /&gt;
    'class method 1'&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def self.my_class_method2&lt;br /&gt;
    'class method 2'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class &amp;lt;&amp;lt; self&lt;br /&gt;
&lt;br /&gt;
    def my_class_method3&lt;br /&gt;
      'class method 3'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And yes, you've guessed right: all class methods go into the singleton class of the object representing the class, in this case, the object referenced by the constant name:MyClass (remember classes are also objects). After all, these class method definitions need to go somewhere, and in such a way that the methods don't become part of the class's instances (ie, they aren't instance methods) nor do the methods go to the super class.&lt;br /&gt;
&lt;br /&gt;
====Defining methods on the fly:====&lt;br /&gt;
&lt;br /&gt;
Ruby has the ability to define methods on the fly using ‘define_method’, method_missing, ‘eval’ family methods. &lt;br /&gt;
&lt;br /&gt;
This is illustrated by following example.&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      class_eval “def greet_in_#{language}; puts ‘#{greeting}’; end”&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
 alan=Person.new&lt;br /&gt;
 alan.greet_in_English&lt;br /&gt;
 #Hello!&lt;br /&gt;
&lt;br /&gt;
 p=Person&lt;br /&gt;
 p.make_greeting(“dutch”,”Hallo!”)&lt;br /&gt;
 lisa=p.new&lt;br /&gt;
 lisa.greet_in_dutch&lt;br /&gt;
 #Hallo!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above example is used to create greetings in different languages on the go. A new greeting is created in make_greeting method, which uses class_eval to evaluate the string that defines a method for a ‘language’ (argument for the make_greeting method). As the method defined using class_val it would in the scope of the entire class (Person). Now to access greet_in_English method we need to create an object and use it to invoke the method. Now to define method at runtime we can invoke make_greeting method using the class (Person.make_greeting(language,greeting)).  And now the newly defined method is available for access by any Person’s object.&lt;br /&gt;
&lt;br /&gt;
The same functionality can be achieved by define method in following was:&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      define_method  “greet_in_#{language};” do &lt;br /&gt;
        puts “#{greeting}”&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
====Defining methods using method_missing:====&lt;br /&gt;
&lt;br /&gt;
One of the ways Ruby is dynamic is that we can choose how to handle methods that are called, but don’t actually exist. If we have a lot of very similar methods, we can even use this to define them all at once. Ruby does this using the method_missing method, which we override in the classes where we need more dynamic method calling.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by using following example which creates a widget that store any attribute that is given to it.&lt;br /&gt;
&lt;br /&gt;
 # lib/widget.rb&lt;br /&gt;
 Class Widget&lt;br /&gt;
  def method_missing sym, *args&lt;br /&gt;
    if sym =~ /^(\w+)=$/&lt;br /&gt;
      instance_variable_set &amp;quot;@#{$1}&amp;quot;, args[0]&lt;br /&gt;
    else&lt;br /&gt;
      instance_variable_get &amp;quot;@#{sym}&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 widget = Widget.new&lt;br /&gt;
 #&amp;lt;Widget:0x0000010383f618&amp;gt;&lt;br /&gt;
 widget.name = 'Bob'&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age = 30&lt;br /&gt;
 # 30&lt;br /&gt;
 widget.name&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age&lt;br /&gt;
 # 30&lt;br /&gt;
&lt;br /&gt;
We have a created Widget and no methods are defined in it, so whenever a method is invoked it would call method missing. In method it is looking for a command with ‘=’ symbol that means it assigning something, so if that is the case it would put that variable into the instance variable set for later retrieval. If the command doesn’t have ‘=’ it is simply displaying the attributes from the instance variable set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/&lt;br /&gt;
&lt;br /&gt;
==Aliasing:&amp;lt;ref&amp;gt;[http://pragprog.com/book/ppmetr/metaprogramming-ruby Aliasing]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
We can redefine a method in an existing class by opening it up and rewriting it, but since we cannot loose the behaviour provided by the original method, we can use alias_method.&lt;br /&gt;
alias        :new  :old&lt;br /&gt;
alias_method :new, :old&lt;br /&gt;
&lt;br /&gt;
Syntax&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.ruby-forum.com/topic/135598 http://www.ruby-forum.com/topic/135598]&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
alias method-name method-name&lt;br /&gt;
alias global-variable-name global-variable-name&lt;br /&gt;
&lt;br /&gt;
Creates a new reference to whatever old referred to. old can be any existing method, operator, global. It may not be a local, instance, constant, or class variable. Alias_method is used when there is a need to override a method but still count on its old behaviour. 	&lt;br /&gt;
 &lt;br /&gt;
Example1:&lt;br /&gt;
&lt;br /&gt;
alias foo bar   Creates a foo alias for bar&lt;br /&gt;
alias $MATCH $&amp;amp;  $MATCH is an alias for $&amp;amp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
&lt;br /&gt;
1.	def oldmtd  &lt;br /&gt;
2.	  &amp;quot;old method&amp;quot;  &lt;br /&gt;
3.	end  &lt;br /&gt;
4.	alias newmtd oldmtd  &lt;br /&gt;
5.	def oldmtd  &lt;br /&gt;
6.	  &amp;quot;old improved method&amp;quot;  &lt;br /&gt;
7.	end  &lt;br /&gt;
8.	puts oldmtd  &lt;br /&gt;
9.	puts newmtd  &lt;br /&gt;
&lt;br /&gt;
The output is:&lt;br /&gt;
1.	old improved method  &lt;br /&gt;
2.	old method  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local variables, instance variables, class variables and constants may not be aliased. The parameters to alias may be names or symbols.  When a method is aliased, the new name refers to a copy of the original method’s body. If the method is subsequently redefined, the aliased name will still invoke the original implementation. Aliases cannot be defined within the method body. The alias of the method keeps the current definition of the method even when the methods are overridden.&lt;br /&gt;
Making aliases for the numbered global variables ($1,$2,….) is prohibited. Overriding the built in global variables may cause serious problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Modules:==&lt;br /&gt;
Module&amp;lt;ref&amp;gt;[http://www.rubyist.net/~slagell/ruby/modules.html Modules]&amp;lt;/ref&amp;gt; is just a bunch of instance methods. A class is just a module but has certain additional features like a superclass and a new() method. The main reason for having both modules and class in Ruby is to make the code more explicit. A module&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html http://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html]&amp;lt;/ref&amp;gt; is used in situations where it has to be included somewhere or when it needs to be used as a namespace. A class is used when it needs to be instantiated or inherited.&lt;br /&gt;
A module can be included by a class. A module can be shared between and included by multiple classes at the same time.  Modules can be used to organize constants in the same way as directories are used to organize files.&lt;br /&gt;
	&lt;br /&gt;
Example&amp;lt;ref&amp;gt;[http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/ http://mousebender.wordpress.com/2007/11/18/including-a-module-in-ruby/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
module Stats&lt;br /&gt;
  def max_health&lt;br /&gt;
    100&lt;br /&gt;
  end&lt;br /&gt;
  def constitution&lt;br /&gt;
    50&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Character&lt;br /&gt;
  include Stats&lt;br /&gt;
  attr_accessor:name&lt;br /&gt;
  attr_accessor:location&lt;br /&gt;
  def talk; end&lt;br /&gt;
  def walk; end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
In the above example we have extracted max_health and constitution into a module. The Character class incudes the Stats module. Whenever a method  is called on an instance of Character, that cannot be found in the referenced class, Ruby will look if the method can be found in one of the included modules. This is not the same as inheritance. Multiple modules can be included at the same time.&lt;br /&gt;
 Modules define a namespace, a sandbox in which your methods and constants can play without having to worry about being stepped on by other methods and constants.&lt;br /&gt;
include mixes a module into a class or another module. Methods from that the module are called function-style (without a receiver).&lt;br /&gt;
&lt;br /&gt;
Extend keyword can be used to extend a single functionality for the object. Adds to object the instance methods from each module given as a parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
module Mod&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Mod.\n&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class Klass&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Klass.\n&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
k = Klass.new&lt;br /&gt;
k.hello	»	&amp;quot;Hello from Klass.\n&amp;quot;&lt;br /&gt;
k.extend(Mod)	»	#&amp;lt;Klass:0x401b598c&amp;gt;&lt;br /&gt;
k.hello		&lt;br /&gt;
&lt;br /&gt;
extend is used to include a module in an object(instance). Methods in the module become methods in the object&lt;br /&gt;
&lt;br /&gt;
The possibilities meta programing opens up seem to be endless. Joining on the way are endless possibilities to do something wrong.  “with great power comes great responsibility”&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=53401</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4g ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=53401"/>
		<updated>2011-10-20T23:49:35Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Metaprogramming?==&lt;br /&gt;
&lt;br /&gt;
Metaprogramming&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]&amp;lt;/ref&amp;gt; can change the way you program in your programming language. This is the most under used programming techniques is writing programs that generate programs ro program parts. Metaprogramming is writing computer programs that manipulate other programs or that which  do  a part of their work at compile time that would otherwise be done at runtime. This is very advantageous because it gives greater flexibility to programs to efficiently handle new situations without recompilation. Languages which provide metaprogramming are called metalanguages.  Metaprograms treat themselves as part of data and they can modify their own structure and behaviour. &lt;br /&gt;
&lt;br /&gt;
==History of Metaprogramming:==&lt;br /&gt;
&lt;br /&gt;
Not all metaprogramming involves generative programming. If programs are modifiable at runtime or if an incremental compilation is available, then techniques can be used to perform metaprogramming without actually generating source code.&lt;br /&gt;
Template metaprogramming is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions.&lt;br /&gt;
In C-language, one of the popular examples of meta-programming is the Lex/Yacc system for generation of parsers and lexical scanners. That is, it reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in C. Instead of doing the laborious work of generating a parser in C, one can use Yacc to generate the repetitive parts of the program. Then, one can add only the code necessary to operate on the parsed entities.&lt;br /&gt;
Metaprogramming in Java comprises of three main components reflection, generics, annotations.&lt;br /&gt;
&lt;br /&gt;
==Uses of Metaprogramming:&amp;lt;ref&amp;gt;[http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Metaprogramming&amp;lt;ref&amp;gt;[http://www.ibm.com/developerworks/linux/library/l-metaprog1/index.html Uses]&amp;lt;/ref&amp;gt; allows us to write programs that will pre-generate tables of data for use at runtime. For example, if a quick lookup table for the sine of all 8-bit integers is needed, then the sin can either be calculated and hand coded or the program can be made to build the table at startup at runtime or a program can used to build the custom code for the table before compile-time. While it may make sense to build the table at runtime for such a small set of numbers, other such tasks may cause program startup to be prohibitively slow. In such cases, writing a program to build static data tables is usually the best answer.&lt;br /&gt;
* A mini language can be created when there are a lot of functions which include a lot of boilerplate code. This mini language will do the boilerplate code and lets the user code only the important parts.&lt;br /&gt;
It is best to abstract out the boilerplate portions into a function. But often the boilerplate code isn't so pretty. Maybe there's a list of variables to be declared in every instance, or maybe there are several pieces of the boilerplate that have to have code inserted in certain circumstances. All of these make a simple function call impossible. In such cases, it is often a good idea to create a mini-language that allows the developer to work with the boilerplate code in an easier fashion. This mini-language will then be converted into your regular source code language before compiling.&lt;br /&gt;
Finally, a lot of programming languages make the developer write really verbose statements to do really simple things. Code-generating programs allow the developer to abbreviate such statements and save a lot of typing, which also prevents a lot of mistakes because there is less chance of mistyping.&lt;br /&gt;
&lt;br /&gt;
==Examples of metaprograms are:==&lt;br /&gt;
&lt;br /&gt;
* Compiler or interpreter of any language&lt;br /&gt;
* Lex and Yacc&lt;br /&gt;
* CORBA's IDL compiler&lt;br /&gt;
* Quine&lt;br /&gt;
* Programs to generate EJB code and XML from database metadata&lt;br /&gt;
* Enhanced Cweb.&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming in Ruby==&lt;br /&gt;
&lt;br /&gt;
===Aspects of Ruby make it easy for metaprogramming:===&lt;br /&gt;
&lt;br /&gt;
====Everything in Ruby is an object==== &lt;br /&gt;
&lt;br /&gt;
This means even native types in other languages such as Integer, Float, String and even the null value (‘nil’ in Ruby) is an object. So ruby doesn’t really have functions, if every single data is an object then every single action on the data is a method.&lt;br /&gt;
&lt;br /&gt;
Following example demonstrates that:&lt;br /&gt;
&lt;br /&gt;
 puts &amp;quot;cat&amp;quot;.class&lt;br /&gt;
 #Here's an iterator method being called on a simple Integer (Fixnum in Ruby)&lt;br /&gt;
 5.times { puts 'hi'}&lt;br /&gt;
 puts 5.class&lt;br /&gt;
&lt;br /&gt;
 #Even nil is an object!&lt;br /&gt;
 puts nil.class&lt;br /&gt;
&lt;br /&gt;
 #You can even define methods in nil! We'll be looking more at this later.&lt;br /&gt;
 def nil.hi&lt;br /&gt;
  puts 'hi!'&lt;br /&gt;
 end&lt;br /&gt;
 nil.hi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Classes and objects are open==== &lt;br /&gt;
&lt;br /&gt;
In Ruby classes are open that means open for enhancing their functionality anytime i.e even at runtime.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 Suppose we have an array [1,2,3,4,5] and we want to find the sum of elements, so we invoke method called ‘sum’ on it.&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 #It gives us ‘No method error’&lt;br /&gt;
&lt;br /&gt;
So we try to enhance the functionality of Array class by defining a method called sum on it&lt;br /&gt;
&lt;br /&gt;
 Class Array&lt;br /&gt;
  def sum&lt;br /&gt;
     inject(0){|s,v| s+v}&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Now lets try to invoke sum on the array&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 Output: 15&lt;br /&gt;
&lt;br /&gt;
====Code can be manipulated as data==== &lt;br /&gt;
&lt;br /&gt;
Ruby code can evaluate the contents of the string.&lt;br /&gt;
&lt;br /&gt;
This will illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 # say_hello.rb&lt;br /&gt;
 puts “puts ‘Hello World !!’ “&lt;br /&gt;
&lt;br /&gt;
Code that invokes code&lt;br /&gt;
&lt;br /&gt;
 ruby –e “ ‘ruby say_hello.rb’ “&lt;br /&gt;
 Output: Hello World !!&lt;br /&gt;
&lt;br /&gt;
Ruby provides the ‘eval’ family of methods for runtime execution of code stored in strings&lt;br /&gt;
&lt;br /&gt;
*‘eval’ can evaluate any string. Other important methods of this family are instance_eval and class_eval.&lt;br /&gt;
 &lt;br /&gt;
 eval(“2*2”)&lt;br /&gt;
 Output: 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Instance_eval evaluates string or a code block in the context of the receiver (object).&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.instance_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 # ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
&lt;br /&gt;
*Class_eval evaluates an string or a code block in the context of the class or module it is invoked on.&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.class_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 # ’hi’  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Deep reflection capabilities==== &lt;br /&gt;
&lt;br /&gt;
In Ruby it's possible to read information about a class or object at runtime. We could use some of the methods like class(), instance_methods(), instance_variables() to do that.&lt;br /&gt;
&lt;br /&gt;
=====Example:=====&lt;br /&gt;
&lt;br /&gt;
 # The code in the following class definition is executed immediately&lt;br /&gt;
  &lt;br /&gt;
  Class Rubyist&lt;br /&gt;
   # the code in the following method definition is executed later,&lt;br /&gt;
   # when you eventually call the method&lt;br /&gt;
   &lt;br /&gt;
   def what_does_he_do&lt;br /&gt;
    @person = 'A Rubyist'&lt;br /&gt;
    'Ruby programming'&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  an_object = Rubyist.new&lt;br /&gt;
  puts an_object.class # =&amp;gt; Rubyist&lt;br /&gt;
  puts an_object.class.instance_methods(false) # =&amp;gt; what_does_he_do&lt;br /&gt;
  an_object.what_does_he_do&lt;br /&gt;
  puts an_object.instance_variables # =&amp;gt; @person&lt;br /&gt;
&lt;br /&gt;
===Meta programming techniques:===&lt;br /&gt;
&lt;br /&gt;
====Using Singleton Classes:====&lt;br /&gt;
&lt;br /&gt;
Singleton classes are used to implement instance specific behavior in Ruby. &lt;br /&gt;
&lt;br /&gt;
 class MyClass &lt;br /&gt;
  def blah&lt;br /&gt;
    'blah'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj = MyClass.new&lt;br /&gt;
 obj.hi # =&amp;gt; NoMethodError&lt;br /&gt;
 &lt;br /&gt;
 def obj.hi&lt;br /&gt;
  'hi'&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj.hi # =&amp;gt; 'hi'&lt;br /&gt;
 &lt;br /&gt;
 another_obj = MyClass.new&lt;br /&gt;
 another_obj.hi # =&amp;gt; NoMethodError &lt;br /&gt;
 &lt;br /&gt;
 obj.class # =&amp;gt; MyClass&lt;br /&gt;
 another_obj.class # =&amp;gt; MyClass&lt;br /&gt;
&lt;br /&gt;
The above code shows one way to add instance-specific behavior. Interesting thing to note is that the new method is invokable only from the instance it was defined on and not from other instances of the same class. This means that the method was not added to the class of the instance.&lt;br /&gt;
&lt;br /&gt;
Does that mean that an object itself can hold method definitions?&lt;br /&gt;
Well, the answer is no (unless it's an object that represents a class or a module). One of the reasons the concept of classes exists in Ruby is that they are meant to hold method definitions and act as blueprints for their instances, ie, they determine what methods can be invoked on their instances.&lt;br /&gt;
&lt;br /&gt;
So where did the method hi go?&lt;br /&gt;
Yes, that's correct, it went into the singleton class of the instance. This hidden class is different from the class the instance was created from and is a Ruby implementation detail that is typically not revealed to anyone (there is only one way to get to the singleton class, which is discussed later in the article ). This is the reason it is sometimes called ghost class or anonymous class or shadow class. The singleton class is created for an object as soon as the Ruby interpreter needs to add instance-specific behavior for that object (but not before that). Going forward, if more methods need to be added to the same object, its already-created singleton class is used. Also, more instances cannot be created using a particular singleton class (its newmethod raises an error). Because of this one-to-one relationship between an object and its singleton class, the word 'singleton' is used.&lt;br /&gt;
&lt;br /&gt;
So, what is the way in which one can get access to an object's singleton class?&lt;br /&gt;
&lt;br /&gt;
 # ... in continuation from previous snippet &lt;br /&gt;
 obj_singleton_class = class &amp;lt;&amp;lt; obj; self; end&lt;br /&gt;
 obj_singleton_class.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
 MyClass.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
&lt;br /&gt;
Here class &amp;lt;&amp;lt; obj; self; end is the key: anything written after class &amp;lt;&amp;lt; obj and before the corresponding end is evaluated against the context of the singleton class of obj, ie, selfpoints to the singleton class.&lt;br /&gt;
&lt;br /&gt;
In the above snippet, we return self, getting a reference to it in the variable obj_singleton_class. We then see that the singleton class fakes the same ancestry as the original class of the object. This implies that when a method is invoked on an object, Ruby first looks for the method definition in the object's singleton class (if it exists), if not, Ruby then continues looking up the normal inheritance hierarchy.&lt;br /&gt;
 &lt;br /&gt;
 # ... in continuation from previous snippet&lt;br /&gt;
 obj.hi # method looked for in singleton class; found; invoked&lt;br /&gt;
 obj.blah # method looked for in singleton class; not found; looked for in MyClass; found; invoked&lt;br /&gt;
 obj.xyz # method looked for in singleton class, MyClass, Object, Kernel; not found; obj.method_missing() called, raising NoMethodError&lt;br /&gt;
&lt;br /&gt;
Now hopefully we have understood how singleton classes work.&lt;br /&gt;
Let's quickly look at two other ways in which we could have added instance-specific behavior to an object:&lt;br /&gt;
 class &amp;lt;&amp;lt; obj&lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 obj.instance_eval do&lt;br /&gt;
  &lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The former one should be clear from what has already been explained. The latter is tied to how def works with instance_eval (I'll probably cover this in another blog post).&lt;br /&gt;
Now, before concluding, let's take a step back and see if we've seen the syntax discussed so far, before. You'll probably recognize their use in defining class-level methods:&lt;br /&gt;
 &lt;br /&gt;
 Class MyClass&lt;br /&gt;
&lt;br /&gt;
  def MyClass.my_class_method1&lt;br /&gt;
    'class method 1'&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def self.my_class_method2&lt;br /&gt;
    'class method 2'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class &amp;lt;&amp;lt; self&lt;br /&gt;
&lt;br /&gt;
    def my_class_method3&lt;br /&gt;
      'class method 3'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And yes, you've guessed right: all class methods go into the singleton class of the object representing the class, in this case, the object referenced by the constant name:MyClass (remember classes are also objects). After all, these class method definitions need to go somewhere, and in such a way that the methods don't become part of the class's instances (ie, they aren't instance methods) nor do the methods go to the super class.&lt;br /&gt;
&lt;br /&gt;
====Defining methods on the fly:====&lt;br /&gt;
&lt;br /&gt;
Ruby has the ability to define methods on the fly using ‘define_method’, method_missing, ‘eval’ family methods. &lt;br /&gt;
&lt;br /&gt;
This is illustrated by following example.&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      class_eval “def greet_in_#{language}; puts ‘#{greeting}’; end”&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
 alan=Person.new&lt;br /&gt;
 alan.greet_in_English&lt;br /&gt;
 #Hello!&lt;br /&gt;
&lt;br /&gt;
 p=Person&lt;br /&gt;
 p.make_greeting(“dutch”,”Hallo!”)&lt;br /&gt;
 lisa=p.new&lt;br /&gt;
 lisa.greet_in_dutch&lt;br /&gt;
 #Hallo!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above example is used to create greetings in different languages on the go. A new greeting is created in make_greeting method, which uses class_eval to evaluate the string that defines a method for a ‘language’ (argument for the make_greeting method). As the method defined using class_val it would in the scope of the entire class (Person). Now to access greet_in_English method we need to create an object and use it to invoke the method. Now to define method at runtime we can invoke make_greeting method using the class (Person.make_greeting(language,greeting)).  And now the newly defined method is available for access by any Person’s object.&lt;br /&gt;
&lt;br /&gt;
The same functionality can be achieved by define method in following was:&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      define_method  “greet_in_#{language};” do &lt;br /&gt;
        puts “#{greeting}”&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
====Defining methods using method_missing:====&lt;br /&gt;
&lt;br /&gt;
One of the ways Ruby is dynamic is that we can choose how to handle methods that are called, but don’t actually exist. If we have a lot of very similar methods, we can even use this to define them all at once. Ruby does this using the method_missing method, which we override in the classes where we need more dynamic method calling.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by using following example which creates a widget that store any attribute that is given to it.&lt;br /&gt;
&lt;br /&gt;
 # lib/widget.rb&lt;br /&gt;
 Class Widget&lt;br /&gt;
  def method_missing sym, *args&lt;br /&gt;
    if sym =~ /^(\w+)=$/&lt;br /&gt;
      instance_variable_set &amp;quot;@#{$1}&amp;quot;, args[0]&lt;br /&gt;
    else&lt;br /&gt;
      instance_variable_get &amp;quot;@#{sym}&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 widget = Widget.new&lt;br /&gt;
 #&amp;lt;Widget:0x0000010383f618&amp;gt;&lt;br /&gt;
 widget.name = 'Bob'&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age = 30&lt;br /&gt;
 # 30&lt;br /&gt;
 widget.name&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age&lt;br /&gt;
 # 30&lt;br /&gt;
&lt;br /&gt;
We have a created Widget and no methods are defined in it, so whenever a method is invoked it would call method missing. In method it is looking for a command with ‘=’ symbol that means it assigning something, so if that is the case it would put that variable into the instance variable set for later retrieval. If the command doesn’t have ‘=’ it is simply displaying the attributes from the instance variable set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/&lt;br /&gt;
&lt;br /&gt;
==Aliasing:&amp;lt;ref&amp;gt;[http://pragprog.com/book/ppmetr/metaprogramming-ruby Aliasing]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
We can redefine a method in an existing class by opening it up and rewriting it, but since we cannot loose the behaviour provided by the original method, we can use alias_method.&lt;br /&gt;
alias        :new  :old&lt;br /&gt;
alias_method :new, :old&lt;br /&gt;
&lt;br /&gt;
Syntax&amp;lt;ref&amp;gt;[http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html http://blog.jayfields.com/2006/12/ruby-alias-method-alternative.html]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.ruby-forum.com/topic/135598 http://www.ruby-forum.com/topic/135598]&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
alias method-name method-name&lt;br /&gt;
alias global-variable-name global-variable-name&lt;br /&gt;
&lt;br /&gt;
Creates a new reference to whatever old referred to. old can be any existing method, operator, global. It may not be a local, instance, constant, or class variable. Alias_method is used when there is a need to override a method but still count on its old behaviour. 	&lt;br /&gt;
 &lt;br /&gt;
Example1:&lt;br /&gt;
&lt;br /&gt;
alias foo bar   Creates a foo alias for bar&lt;br /&gt;
alias $MATCH $&amp;amp;  $MATCH is an alias for $&amp;amp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
&lt;br /&gt;
1.	def oldmtd  &lt;br /&gt;
2.	  &amp;quot;old method&amp;quot;  &lt;br /&gt;
3.	end  &lt;br /&gt;
4.	alias newmtd oldmtd  &lt;br /&gt;
5.	def oldmtd  &lt;br /&gt;
6.	  &amp;quot;old improved method&amp;quot;  &lt;br /&gt;
7.	end  &lt;br /&gt;
8.	puts oldmtd  &lt;br /&gt;
9.	puts newmtd  &lt;br /&gt;
&lt;br /&gt;
The output is:&lt;br /&gt;
1.	old improved method  &lt;br /&gt;
2.	old method  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local variables, instance variables, class variables and constants may not be aliased. The parameters to alias may be names or symbols.  When a method is aliased, the new name refers to a copy of the original method’s body. If the method is subsequently redefined, the aliased name will still invoke the original implementation. Aliases cannot be defined within the method body. The alias of the method keeps the current definition of the method even when the methods are overridden.&lt;br /&gt;
Making aliases for the numbered global variables ($1,$2,….) is prohibited. Overriding the built in global variables may cause serious problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Modules:==&lt;br /&gt;
Module is just a bunch of instance methods. A class is just a module but has certain additional features like a superclass and a new() method. The main reason for having both modules and class in Ruby is to make the code more explicit. A module is used in situations where it has to be included somewhere or when it needs to be used as a namespace. A class is used when it needs to be instantiated or inherited.&lt;br /&gt;
A module can be included by a class. A module can be shared between and included by multiple classes at the same time.  Modules can be used to organize constants in the same way as directories are used to organize files.	&lt;br /&gt;
Example&lt;br /&gt;
module Stats&lt;br /&gt;
  def max_health&lt;br /&gt;
    100&lt;br /&gt;
  end&lt;br /&gt;
  def constitution&lt;br /&gt;
    50&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Character&lt;br /&gt;
  include Stats&lt;br /&gt;
  attr_accessor:name&lt;br /&gt;
  attr_accessor:location&lt;br /&gt;
  def talk; end&lt;br /&gt;
  def walk; end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
In the above example we have extracted max_health and constitution into a module. The Character class incudes the Stats module. Whenever a method  is called on an instance of Character, that cannot be found in the referenced class, Ruby will look if the method can be found in one of the included modules. This is not the same as inheritance. Multiple modules can be included at the same time.&lt;br /&gt;
 Modules define a namespace, a sandbox in which your methods and constants can play without having to worry about being stepped on by other methods and constants.&lt;br /&gt;
include mixes a module into a class or another module. Methods from that the module are called function-style (without a receiver).&lt;br /&gt;
&lt;br /&gt;
Extend keyword can be used to extend a single functionality for the object. Adds to object the instance methods from each module given as a parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
module Mod&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Mod.\n&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class Klass&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Klass.\n&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
k = Klass.new&lt;br /&gt;
k.hello	»	&amp;quot;Hello from Klass.\n&amp;quot;&lt;br /&gt;
k.extend(Mod)	»	#&amp;lt;Klass:0x401b598c&amp;gt;&lt;br /&gt;
k.hello		&lt;br /&gt;
&lt;br /&gt;
extend is used to include a module in an object(instance). Methods in the module become methods in the object&lt;br /&gt;
&lt;br /&gt;
The possibilities meta programing opens up seem to be endless. Joining on the way are endless possibilities to do something wrong.  “with great power comes great responsibility”&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=53369</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4g ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4g_ms&amp;diff=53369"/>
		<updated>2011-10-20T23:37:53Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Metaprogramming?==&lt;br /&gt;
&lt;br /&gt;
Metaprogramming&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]&amp;lt;/ref&amp;gt; can change the way you program in your programming language. This is the most under used programming techniques is writing programs that generate programs ro program parts. Metaprogramming is writing computer programs that manipulate other programs or that which  do  a part of their work at compile time that would otherwise be done at runtime. This is very advantageous because it gives greater flexibility to programs to efficiently handle new situations without recompilation. Languages which provide metaprogramming are called metalanguages.  Metaprograms treat themselves as part of data and they can modify their own structure and behaviour. &lt;br /&gt;
&lt;br /&gt;
==History of Metaprogramming:==&lt;br /&gt;
&lt;br /&gt;
Not all metaprogramming involves generative programming. If programs are modifiable at runtime or if an incremental compilation is available, then techniques can be used to perform metaprogramming without actually generating source code.&lt;br /&gt;
Template metaprogramming is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these templates include compile-time constants, data structures, and complete functions.&lt;br /&gt;
In C-language, one of the popular examples of meta-programming is the Lex/Yacc system for generation of parsers and lexical scanners. That is, it reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in C. Instead of doing the laborious work of generating a parser in C, one can use Yacc to generate the repetitive parts of the program. Then, one can add only the code necessary to operate on the parsed entities.&lt;br /&gt;
Metaprogramming in Java comprises of three main components reflection, generics, annotations.&lt;br /&gt;
&lt;br /&gt;
==Uses of Metaprogramming:==&lt;br /&gt;
&lt;br /&gt;
* Metaprogramming allows us to write programs that will pre-generate tables of data for use at runtime. For example, if a quick lookup table for the sine of all 8-bit integers is needed, then the sin can either be calculated and hand coded or the program can be made to build the table at startup at runtime or a program can used to build the custom code for the table before compile-time. While it may make sense to build the table at runtime for such a small set of numbers, other such tasks may cause program startup to be prohibitively slow. In such cases, writing a program to build static data tables is usually the best answer.&lt;br /&gt;
* A mini language can be created when there are a lot of functions which include a lot of boilerplate code. This mini language will do the boilerplate code and lets the user code only the important parts.&lt;br /&gt;
It is best to abstract out the boilerplate portions into a function. But often the boilerplate code isn't so pretty. Maybe there's a list of variables to be declared in every instance, or maybe there are several pieces of the boilerplate that have to have code inserted in certain circumstances. All of these make a simple function call impossible. In such cases, it is often a good idea to create a mini-language that allows the developer to work with the boilerplate code in an easier fashion. This mini-language will then be converted into your regular source code language before compiling.&lt;br /&gt;
Finally, a lot of programming languages make the developer write really verbose statements to do really simple things. Code-generating programs allow the developer to abbreviate such statements and save a lot of typing, which also prevents a lot of mistakes because there is less chance of mistyping.&lt;br /&gt;
&lt;br /&gt;
==Examples of metaprograms are:==&lt;br /&gt;
&lt;br /&gt;
* Compiler or interpreter of any language&lt;br /&gt;
* Lex and Yacc&lt;br /&gt;
* CORBA's IDL compiler&lt;br /&gt;
* Quine&lt;br /&gt;
* Programs to generate EJB code and XML from database metadata&lt;br /&gt;
* Enhanced Cweb.&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming in Ruby==&lt;br /&gt;
&lt;br /&gt;
===Aspects of Ruby make it easy for metaprogramming:===&lt;br /&gt;
&lt;br /&gt;
====Everything in Ruby is an object==== &lt;br /&gt;
&lt;br /&gt;
This means even native types in other languages such as Integer, Float, String and even the null value (‘nil’ in Ruby) is an object. So ruby doesn’t really have functions, if every single data is an object then every single action on the data is a method.&lt;br /&gt;
&lt;br /&gt;
Following example demonstrates that:&lt;br /&gt;
&lt;br /&gt;
 puts &amp;quot;cat&amp;quot;.class&lt;br /&gt;
 #Here's an iterator method being called on a simple Integer (Fixnum in Ruby)&lt;br /&gt;
 5.times { puts 'hi'}&lt;br /&gt;
 puts 5.class&lt;br /&gt;
&lt;br /&gt;
 #Even nil is an object!&lt;br /&gt;
 puts nil.class&lt;br /&gt;
&lt;br /&gt;
 #You can even define methods in nil! We'll be looking more at this later.&lt;br /&gt;
 def nil.hi&lt;br /&gt;
  puts 'hi!'&lt;br /&gt;
 end&lt;br /&gt;
 nil.hi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Classes and objects are open==== &lt;br /&gt;
&lt;br /&gt;
In Ruby classes are open that means open for enhancing their functionality anytime i.e even at runtime.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 Suppose we have an array [1,2,3,4,5] and we want to find the sum of elements, so we invoke method called ‘sum’ on it.&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 #It gives us ‘No method error’&lt;br /&gt;
&lt;br /&gt;
So we try to enhance the functionality of Array class by defining a method called sum on it&lt;br /&gt;
&lt;br /&gt;
 Class Array&lt;br /&gt;
  def sum&lt;br /&gt;
     inject(0){|s,v| s+v}&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Now lets try to invoke sum on the array&lt;br /&gt;
&lt;br /&gt;
 [1,2,3,4,5].sum&lt;br /&gt;
 Output: 15&lt;br /&gt;
&lt;br /&gt;
====Code can be manipulated as data==== &lt;br /&gt;
&lt;br /&gt;
Ruby code can evaluate the contents of the string.&lt;br /&gt;
&lt;br /&gt;
This will illustrated by following example:&lt;br /&gt;
&lt;br /&gt;
 # say_hello.rb&lt;br /&gt;
 puts “puts ‘Hello World !!’ “&lt;br /&gt;
&lt;br /&gt;
Code that invokes code&lt;br /&gt;
&lt;br /&gt;
 ruby –e “ ‘ruby say_hello.rb’ “&lt;br /&gt;
 Output: Hello World !!&lt;br /&gt;
&lt;br /&gt;
Ruby provides the ‘eval’ family of methods for runtime execution of code stored in strings&lt;br /&gt;
&lt;br /&gt;
*‘eval’ can evaluate any string. Other important methods of this family are instance_eval and class_eval.&lt;br /&gt;
 &lt;br /&gt;
 eval(“2*2”)&lt;br /&gt;
 Output: 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Instance_eval evaluates string or a code block in the context of the receiver (object).&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.instance_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 # ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
&lt;br /&gt;
*Class_eval evaluates an string or a code block in the context of the class or module it is invoked on.&lt;br /&gt;
&lt;br /&gt;
 Class MyClass&lt;br /&gt;
 end&lt;br /&gt;
 MyClass.class_eval(“def hi; ‘hi’; end; “)&lt;br /&gt;
 MyClass.hi&lt;br /&gt;
 #NoMethoError : e=undefined method ‘hi’&lt;br /&gt;
 Obj =MyClass.new&lt;br /&gt;
 Obj.hi&lt;br /&gt;
 # ’hi’  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Deep reflection capabilities==== &lt;br /&gt;
&lt;br /&gt;
In Ruby it's possible to read information about a class or object at runtime. We could use some of the methods like class(), instance_methods(), instance_variables() to do that.&lt;br /&gt;
&lt;br /&gt;
=====Example:=====&lt;br /&gt;
&lt;br /&gt;
 # The code in the following class definition is executed immediately&lt;br /&gt;
  &lt;br /&gt;
  Class Rubyist&lt;br /&gt;
   # the code in the following method definition is executed later,&lt;br /&gt;
   # when you eventually call the method&lt;br /&gt;
   &lt;br /&gt;
   def what_does_he_do&lt;br /&gt;
    @person = 'A Rubyist'&lt;br /&gt;
    'Ruby programming'&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  an_object = Rubyist.new&lt;br /&gt;
  puts an_object.class # =&amp;gt; Rubyist&lt;br /&gt;
  puts an_object.class.instance_methods(false) # =&amp;gt; what_does_he_do&lt;br /&gt;
  an_object.what_does_he_do&lt;br /&gt;
  puts an_object.instance_variables # =&amp;gt; @person&lt;br /&gt;
&lt;br /&gt;
===Meta programming techniques:===&lt;br /&gt;
&lt;br /&gt;
====Using Singleton Classes:====&lt;br /&gt;
&lt;br /&gt;
Singleton classes are used to implement instance specific behavior in Ruby. &lt;br /&gt;
&lt;br /&gt;
 class MyClass &lt;br /&gt;
  def blah&lt;br /&gt;
    'blah'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj = MyClass.new&lt;br /&gt;
 obj.hi # =&amp;gt; NoMethodError&lt;br /&gt;
 &lt;br /&gt;
 def obj.hi&lt;br /&gt;
  'hi'&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 obj.hi # =&amp;gt; 'hi'&lt;br /&gt;
 &lt;br /&gt;
 another_obj = MyClass.new&lt;br /&gt;
 another_obj.hi # =&amp;gt; NoMethodError &lt;br /&gt;
 &lt;br /&gt;
 obj.class # =&amp;gt; MyClass&lt;br /&gt;
 another_obj.class # =&amp;gt; MyClass&lt;br /&gt;
&lt;br /&gt;
The above code shows one way to add instance-specific behavior. Interesting thing to note is that the new method is invokable only from the instance it was defined on and not from other instances of the same class. This means that the method was not added to the class of the instance.&lt;br /&gt;
&lt;br /&gt;
Does that mean that an object itself can hold method definitions?&lt;br /&gt;
Well, the answer is no (unless it's an object that represents a class or a module). One of the reasons the concept of classes exists in Ruby is that they are meant to hold method definitions and act as blueprints for their instances, ie, they determine what methods can be invoked on their instances.&lt;br /&gt;
&lt;br /&gt;
So where did the method hi go?&lt;br /&gt;
Yes, that's correct, it went into the singleton class of the instance. This hidden class is different from the class the instance was created from and is a Ruby implementation detail that is typically not revealed to anyone (there is only one way to get to the singleton class, which is discussed later in the article ). This is the reason it is sometimes called ghost class or anonymous class or shadow class. The singleton class is created for an object as soon as the Ruby interpreter needs to add instance-specific behavior for that object (but not before that). Going forward, if more methods need to be added to the same object, its already-created singleton class is used. Also, more instances cannot be created using a particular singleton class (its newmethod raises an error). Because of this one-to-one relationship between an object and its singleton class, the word 'singleton' is used.&lt;br /&gt;
&lt;br /&gt;
So, what is the way in which one can get access to an object's singleton class?&lt;br /&gt;
&lt;br /&gt;
 # ... in continuation from previous snippet &lt;br /&gt;
 obj_singleton_class = class &amp;lt;&amp;lt; obj; self; end&lt;br /&gt;
 obj_singleton_class.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
 MyClass.ancestors # =&amp;gt; [MyClass, Object, Kernel]&lt;br /&gt;
&lt;br /&gt;
Here class &amp;lt;&amp;lt; obj; self; end is the key: anything written after class &amp;lt;&amp;lt; obj and before the corresponding end is evaluated against the context of the singleton class of obj, ie, selfpoints to the singleton class.&lt;br /&gt;
&lt;br /&gt;
In the above snippet, we return self, getting a reference to it in the variable obj_singleton_class. We then see that the singleton class fakes the same ancestry as the original class of the object. This implies that when a method is invoked on an object, Ruby first looks for the method definition in the object's singleton class (if it exists), if not, Ruby then continues looking up the normal inheritance hierarchy.&lt;br /&gt;
 &lt;br /&gt;
 # ... in continuation from previous snippet&lt;br /&gt;
 obj.hi # method looked for in singleton class; found; invoked&lt;br /&gt;
 obj.blah # method looked for in singleton class; not found; looked for in MyClass; found; invoked&lt;br /&gt;
 obj.xyz # method looked for in singleton class, MyClass, Object, Kernel; not found; obj.method_missing() called, raising NoMethodError&lt;br /&gt;
&lt;br /&gt;
Now hopefully we have understood how singleton classes work.&lt;br /&gt;
Let's quickly look at two other ways in which we could have added instance-specific behavior to an object:&lt;br /&gt;
 class &amp;lt;&amp;lt; obj&lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 obj.instance_eval do&lt;br /&gt;
  &lt;br /&gt;
  def hi&lt;br /&gt;
    'hi'&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
The former one should be clear from what has already been explained. The latter is tied to how def works with instance_eval (I'll probably cover this in another blog post).&lt;br /&gt;
Now, before concluding, let's take a step back and see if we've seen the syntax discussed so far, before. You'll probably recognize their use in defining class-level methods:&lt;br /&gt;
 &lt;br /&gt;
 Class MyClass&lt;br /&gt;
&lt;br /&gt;
  def MyClass.my_class_method1&lt;br /&gt;
    'class method 1'&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def self.my_class_method2&lt;br /&gt;
    'class method 2'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class &amp;lt;&amp;lt; self&lt;br /&gt;
&lt;br /&gt;
    def my_class_method3&lt;br /&gt;
      'class method 3'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And yes, you've guessed right: all class methods go into the singleton class of the object representing the class, in this case, the object referenced by the constant name:MyClass (remember classes are also objects). After all, these class method definitions need to go somewhere, and in such a way that the methods don't become part of the class's instances (ie, they aren't instance methods) nor do the methods go to the super class.&lt;br /&gt;
&lt;br /&gt;
====Defining methods on the fly:====&lt;br /&gt;
&lt;br /&gt;
Ruby has the ability to define methods on the fly using ‘define_method’, method_missing, ‘eval’ family methods. &lt;br /&gt;
&lt;br /&gt;
This is illustrated by following example.&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      class_eval “def greet_in_#{language}; puts ‘#{greeting}’; end”&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
 alan=Person.new&lt;br /&gt;
 alan.greet_in_English&lt;br /&gt;
 #Hello!&lt;br /&gt;
&lt;br /&gt;
 p=Person&lt;br /&gt;
 p.make_greeting(“dutch”,”Hallo!”)&lt;br /&gt;
 lisa=p.new&lt;br /&gt;
 lisa.greet_in_dutch&lt;br /&gt;
 #Hallo!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above example is used to create greetings in different languages on the go. A new greeting is created in make_greeting method, which uses class_eval to evaluate the string that defines a method for a ‘language’ (argument for the make_greeting method). As the method defined using class_val it would in the scope of the entire class (Person). Now to access greet_in_English method we need to create an object and use it to invoke the method. Now to define method at runtime we can invoke make_greeting method using the class (Person.make_greeting(language,greeting)).  And now the newly defined method is available for access by any Person’s object.&lt;br /&gt;
&lt;br /&gt;
The same functionality can be achieved by define method in following was:&lt;br /&gt;
&lt;br /&gt;
 Class Person&lt;br /&gt;
  def  self.make_greeting (language, greeting)&lt;br /&gt;
      define_method  “greet_in_#{language};” do &lt;br /&gt;
        puts “#{greeting}”&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  make_greeting(“Spanish”,”Hola!”)&lt;br /&gt;
  make_greeting(“English”,”Hello!”)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Defining methods using method_missing:&lt;br /&gt;
&lt;br /&gt;
One of the ways Ruby is dynamic is that we can choose how to handle methods that are called, but don’t actually exist. If we have a lot of very similar methods, we can even use this to define them all at once. Ruby does this using the method_missing method, which we override in the classes where we need more dynamic method calling.&lt;br /&gt;
&lt;br /&gt;
This can be illustrated by using following example which creates a widget that store any attribute that is given to it.&lt;br /&gt;
&lt;br /&gt;
 # lib/widget.rb&lt;br /&gt;
 Class Widget&lt;br /&gt;
  def method_missing sym, *args&lt;br /&gt;
    if sym =~ /^(\w+)=$/&lt;br /&gt;
      instance_variable_set &amp;quot;@#{$1}&amp;quot;, args[0]&lt;br /&gt;
    else&lt;br /&gt;
      instance_variable_get &amp;quot;@#{sym}&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 widget = Widget.new&lt;br /&gt;
 #&amp;lt;Widget:0x0000010383f618&amp;gt;&lt;br /&gt;
 widget.name = 'Bob'&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age = 30&lt;br /&gt;
 # 30&lt;br /&gt;
 widget.name&lt;br /&gt;
 # &amp;quot;Bob&amp;quot;&lt;br /&gt;
 widget.age&lt;br /&gt;
 # 30&lt;br /&gt;
&lt;br /&gt;
We have a created Widget and no methods are defined in it, so whenever a method is invoked it would call method missing. In method it is looking for a command with ‘=’ symbol that means it assigning something, so if that is the case it would put that variable into the instance variable set for later retrieval. If the command doesn’t have ‘=’ it is simply displaying the attributes from the instance variable set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://kconrails.com/2010/12/21/dynamic-methods-in-ruby-with-method_missing/&lt;br /&gt;
&lt;br /&gt;
==Aliasing:==&lt;br /&gt;
&lt;br /&gt;
We can redefine a method in an existing class by opening it up and rewriting it, but since we cannot loose the behaviour provided by the original method, we can use alias_method.&lt;br /&gt;
alias        :new  :old&lt;br /&gt;
alias_method :new, :old&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
alias method-name method-name&lt;br /&gt;
alias global-variable-name global-variable-name&lt;br /&gt;
&lt;br /&gt;
Creates a new reference to whatever old referred to. old can be any existing method, operator, global. It may not be a local, instance, constant, or class variable. Alias_method is used when there is a need to override a method but still count on its old behaviour. 	&lt;br /&gt;
 &lt;br /&gt;
Example1:&lt;br /&gt;
&lt;br /&gt;
alias foo bar   Creates a foo alias for bar&lt;br /&gt;
alias $MATCH $&amp;amp;  $MATCH is an alias for $&amp;amp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
&lt;br /&gt;
1.	def oldmtd  &lt;br /&gt;
2.	  &amp;quot;old method&amp;quot;  &lt;br /&gt;
3.	end  &lt;br /&gt;
4.	alias newmtd oldmtd  &lt;br /&gt;
5.	def oldmtd  &lt;br /&gt;
6.	  &amp;quot;old improved method&amp;quot;  &lt;br /&gt;
7.	end  &lt;br /&gt;
8.	puts oldmtd  &lt;br /&gt;
9.	puts newmtd  &lt;br /&gt;
&lt;br /&gt;
The output is:&lt;br /&gt;
1.	old improved method  &lt;br /&gt;
2.	old method  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Local variables, instance variables, class variables and constants may not be aliased. The parameters to alias may be names or symbols.  When a method is aliased, the new name refers to a copy of the original method’s body. If the method is subsequently redefined, the aliased name will still invoke the original implementation. Aliases cannot be defined within the method body. The alias of the method keeps the current definition of the method even when the methods are overridden.&lt;br /&gt;
Making aliases for the numbered global variables ($1,$2,….) is prohibited. Overriding the built in global variables may cause serious problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Modules:==&lt;br /&gt;
Module is just a bunch of instance methods. A class is just a module but has certain additional features like a superclass and a new() method. The main reason for having both modules and class in Ruby is to make the code more explicit. A module is used in situations where it has to be included somewhere or when it needs to be used as a namespace. A class is used when it needs to be instantiated or inherited.&lt;br /&gt;
A module can be included by a class. A module can be shared between and included by multiple classes at the same time.  Modules can be used to organize constants in the same way as directories are used to organize files.	&lt;br /&gt;
Example&lt;br /&gt;
module Stats&lt;br /&gt;
  def max_health&lt;br /&gt;
    100&lt;br /&gt;
  end&lt;br /&gt;
  def constitution&lt;br /&gt;
    50&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Character&lt;br /&gt;
  include Stats&lt;br /&gt;
  attr_accessor:name&lt;br /&gt;
  attr_accessor:location&lt;br /&gt;
  def talk; end&lt;br /&gt;
  def walk; end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
In the above example we have extracted max_health and constitution into a module. The Character class incudes the Stats module. Whenever a method  is called on an instance of Character, that cannot be found in the referenced class, Ruby will look if the method can be found in one of the included modules. This is not the same as inheritance. Multiple modules can be included at the same time.&lt;br /&gt;
 Modules define a namespace, a sandbox in which your methods and constants can play without having to worry about being stepped on by other methods and constants.&lt;br /&gt;
include mixes a module into a class or another module. Methods from that the module are called function-style (without a receiver).&lt;br /&gt;
&lt;br /&gt;
Extend keyword can be used to extend a single functionality for the object. Adds to object the instance methods from each module given as a parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
module Mod&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Mod.\n&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class Klass&lt;br /&gt;
  def hello&lt;br /&gt;
    &amp;quot;Hello from Klass.\n&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
k = Klass.new&lt;br /&gt;
k.hello	»	&amp;quot;Hello from Klass.\n&amp;quot;&lt;br /&gt;
k.extend(Mod)	»	#&amp;lt;Klass:0x401b598c&amp;gt;&lt;br /&gt;
k.hello		&lt;br /&gt;
&lt;br /&gt;
extend is used to include a module in an object(instance). Methods in the module become methods in the object&lt;br /&gt;
&lt;br /&gt;
The possibilities meta programing opens up seem to be endless. Joining on the way are endless possibilities to do something wrong.  “with great power comes great responsibility”&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50865</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50865"/>
		<updated>2011-09-25T22:51:31Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Comparison notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article analyzes and compares different Integrated development environments [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of features such as:&lt;br /&gt;
&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Source_code_editor source code editor].&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Compiler compiler] and/or an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter].&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.Some IDE's support multiple languages support for some alternate languages is provided through plugins.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ RUBY]is a dynamic, reflective, open source, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ Ruby] supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing&amp;lt;ref&amp;gt;[http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails Editing]&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://netbeans.org/features/ide/editor.html NetBeans Editor]&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  [http://www.eclipse.org/mylyn/ Mylyn Integration]&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting&amp;lt;ref&amp;gt;[http://vimeo.com/channels/radrails#9895797 Radrails features]&amp;lt;/ref&amp;gt;. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine&amp;lt;ref&amp;gt;[http://www.jetbrains.com/ruby/features/ruby_ide.html RubyMine]&amp;lt;/ref&amp;gt; is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring&amp;lt;ref&amp;gt;[http://r2.ifs.hsr.ch/rubyrefactoring.pdf Refactoring]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
Netbeans&amp;lt;ref&amp;gt;[http://netbeans.org/features/java/debugger.html Netbeans]&amp;lt;/ref&amp;gt; supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect. [http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.rdt.doc.user%2Fhtml%2Ftoc.html RDT] is a standard Eclipse plug-in, with features and plug-ins, so you can expand the zip file directly into the Eclipse folder. The paths in the archive take care of the rest.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50864</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50864"/>
		<updated>2011-09-25T22:51:07Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Comparison notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article analyzes and compares different Integrated development environments [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of features such as:&lt;br /&gt;
&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Source_code_editor source code editor].&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Compiler compiler] and/or an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter].&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.Some IDE's support multiple languages support for some alternate languages is provided through plugins.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ RUBY]is a dynamic, reflective, open source, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ Ruby] supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing&amp;lt;ref&amp;gt;[http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails Editing]&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://netbeans.org/features/ide/editor.html NetBeans Editor]&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  [http://www.eclipse.org/mylyn/ Mylyn Integration]&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans&amp;lt;ref&amp;gt;[http://netbeans.org/features/ide/editor.html NetBeans Editor]&amp;lt;/ref&amp;gt; provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting&amp;lt;ref&amp;gt;[http://vimeo.com/channels/radrails#9895797 Radrails features]&amp;lt;/ref&amp;gt;. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine&amp;lt;ref&amp;gt;[http://www.jetbrains.com/ruby/features/ruby_ide.html RubyMine]&amp;lt;/ref&amp;gt; is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring&amp;lt;ref&amp;gt;[http://r2.ifs.hsr.ch/rubyrefactoring.pdf Refactoring]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
Netbeans&amp;lt;ref&amp;gt;[http://netbeans.org/features/java/debugger.html Netbeans]&amp;lt;/ref&amp;gt; supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect. [http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.rdt.doc.user%2Fhtml%2Ftoc.html RDT] is a standard Eclipse plug-in, with features and plug-ins, so you can expand the zip file directly into the Eclipse folder. The paths in the archive take care of the rest.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50861</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50861"/>
		<updated>2011-09-25T22:50:23Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Comparison notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article analyzes and compares different Integrated development environments [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of features such as:&lt;br /&gt;
&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Source_code_editor source code editor].&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Compiler compiler] and/or an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter].&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.Some IDE's support multiple languages support for some alternate languages is provided through plugins.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ RUBY]is a dynamic, reflective, open source, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ Ruby] supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing&amp;lt;ref&amp;gt;[http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails Editing]&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://netbeans.org/features/ide/editor.html NetBeans Editor]&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  [http://www.eclipse.org/mylyn/ Mylyn Integration]&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans&amp;lt;ref&amp;gt;[http://netbeans.org/features/ide/editor.html]&amp;lt;/ref&amp;gt; provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting&amp;lt;ref&amp;gt;[http://vimeo.com/channels/radrails#9895797 Radrails features]&amp;lt;/ref&amp;gt;. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine&amp;lt;ref&amp;gt;[http://www.jetbrains.com/ruby/features/ruby_ide.html RubyMine]&amp;lt;/ref&amp;gt; is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring&amp;lt;ref&amp;gt;[http://r2.ifs.hsr.ch/rubyrefactoring.pdf Refactoring]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
Netbeans&amp;lt;ref&amp;gt;[http://netbeans.org/features/java/debugger.html Netbeans]&amp;lt;/ref&amp;gt; supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect. [http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.rdt.doc.user%2Fhtml%2Ftoc.html RDT] is a standard Eclipse plug-in, with features and plug-ins, so you can expand the zip file directly into the Eclipse folder. The paths in the archive take care of the rest.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50859</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50859"/>
		<updated>2011-09-25T22:49:51Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Comparison notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article analyzes and compares different Integrated development environments [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of features such as:&lt;br /&gt;
&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Source_code_editor source code editor].&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Compiler compiler] and/or an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter].&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.Some IDE's support multiple languages support for some alternate languages is provided through plugins.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ RUBY]is a dynamic, reflective, open source, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ Ruby] supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing&amp;lt;ref&amp;gt;[http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails Editing]&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://netbeans.org/features/ide/editor.html NetBeans Editor]&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  [http://www.eclipse.org/mylyn/ Mylyn Integration]&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans&amp;lt;ref&amp;gt;[http://netbeans.org/features/ide/editor.html NetBeans Editor]&amp;lt;/ref&amp;gt; provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting&amp;lt;ref&amp;gt;[http://vimeo.com/channels/radrails#9895797 Radrails features]&amp;lt;/ref&amp;gt;. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine&amp;lt;ref&amp;gt;[http://www.jetbrains.com/ruby/features/ruby_ide.html RubyMine]&amp;lt;/ref&amp;gt; is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring&amp;lt;ref&amp;gt;[http://r2.ifs.hsr.ch/rubyrefactoring.pdf Refactoring]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
Netbeans&amp;lt;ref&amp;gt;[http://netbeans.org/features/java/debugger.html Netbeans]&amp;lt;/ref&amp;gt; supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect. [http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.rdt.doc.user%2Fhtml%2Ftoc.html RDT] is a standard Eclipse plug-in, with features and plug-ins, so you can expand the zip file directly into the Eclipse folder. The paths in the archive take care of the rest.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50857</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50857"/>
		<updated>2011-09-25T22:48:57Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* EditingEditing[http://netbeans.org/features/ide/editor.html] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article analyzes and compares different Integrated development environments [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of features such as:&lt;br /&gt;
&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Source_code_editor source code editor].&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Compiler compiler] and/or an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter].&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.Some IDE's support multiple languages support for some alternate languages is provided through plugins.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ RUBY]is a dynamic, reflective, open source, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ Ruby] supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing&amp;lt;ref&amp;gt;[http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails Editing]&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://netbeans.org/features/ide/editor.html NetBeans Editor]&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  [http://www.eclipse.org/mylyn/ Mylyn Integration]&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting&amp;lt;ref&amp;gt;[http://vimeo.com/channels/radrails#9895797 Radrails features]&amp;lt;/ref&amp;gt;. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine&amp;lt;ref&amp;gt;[http://www.jetbrains.com/ruby/features/ruby_ide.html RubyMine]&amp;lt;/ref&amp;gt; is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring&amp;lt;ref&amp;gt;[http://r2.ifs.hsr.ch/rubyrefactoring.pdf Refactoring]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
Netbeans&amp;lt;ref&amp;gt;[http://netbeans.org/features/java/debugger.html Netbeans]&amp;lt;/ref&amp;gt; supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect. [http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.rdt.doc.user%2Fhtml%2Ftoc.html RDT] is a standard Eclipse plug-in, with features and plug-ins, so you can expand the zip file directly into the Eclipse folder. The paths in the archive take care of the rest.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50854</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50854"/>
		<updated>2011-09-25T22:48:12Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* EditingEditing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article analyzes and compares different Integrated development environments [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of features such as:&lt;br /&gt;
&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Source_code_editor source code editor].&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Compiler compiler] and/or an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter].&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.Some IDE's support multiple languages support for some alternate languages is provided through plugins.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ RUBY]is a dynamic, reflective, open source, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ Ruby] supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing&amp;lt;ref&amp;gt;[http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails Editing]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://netbeans.org/features/ide/editor.html]&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  [http://www.eclipse.org/mylyn/ Mylyn Integration]&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine&amp;lt;ref&amp;gt;[http://www.jetbrains.com/ruby/features/ruby_ide.html RubyMine]&amp;lt;/ref&amp;gt; is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring&amp;lt;ref&amp;gt;[http://r2.ifs.hsr.ch/rubyrefactoring.pdf Refactoring]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
Netbeans&amp;lt;ref&amp;gt;[http://netbeans.org/features/java/debugger.html Netbeans]&amp;lt;/ref&amp;gt; supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect. [http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.rdt.doc.user%2Fhtml%2Ftoc.html RDT] is a standard Eclipse plug-in, with features and plug-ins, so you can expand the zip file directly into the Eclipse folder. The paths in the archive take care of the rest.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50845</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50845"/>
		<updated>2011-09-25T22:46:45Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Comparison notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article analyzes and compares different Integrated development environments [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of features such as:&lt;br /&gt;
&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Source_code_editor source code editor].&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Compiler compiler] and/or an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter].&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.Some IDE's support multiple languages support for some alternate languages is provided through plugins.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ RUBY]is a dynamic, reflective, open source, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ Ruby] supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing&amp;lt;ref&amp;gt;[http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails Editing]&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  [http://www.eclipse.org/mylyn/ Mylyn Integration]&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine&amp;lt;ref&amp;gt;[http://www.jetbrains.com/ruby/features/ruby_ide.html RubyMine]&amp;lt;/ref&amp;gt; is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
Netbeans&amp;lt;ref&amp;gt;[http://netbeans.org/features/java/debugger.html Netbeans]&amp;lt;/ref&amp;gt; supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect. [http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.rdt.doc.user%2Fhtml%2Ftoc.html RDT] is a standard Eclipse plug-in, with features and plug-ins, so you can expand the zip file directly into the Eclipse folder. The paths in the archive take care of the rest.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50838</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50838"/>
		<updated>2011-09-25T22:45:20Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Debugging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article analyzes and compares different Integrated development environments [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of features such as:&lt;br /&gt;
&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Source_code_editor source code editor].&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Compiler compiler] and/or an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter].&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.Some IDE's support multiple languages support for some alternate languages is provided through plugins.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ RUBY]is a dynamic, reflective, open source, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ Ruby] supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing&amp;lt;ref&amp;gt;[http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails Editing]&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  [http://www.eclipse.org/mylyn/ Mylyn Integration]&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
Netbeans&amp;lt;ref&amp;gt;[http://netbeans.org/features/java/debugger.html Netbeans]&amp;lt;/ref&amp;gt; supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect. [http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.rdt.doc.user%2Fhtml%2Ftoc.html RDT] is a standard Eclipse plug-in, with features and plug-ins, so you can expand the zip file directly into the Eclipse folder. The paths in the archive take care of the rest.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50834</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50834"/>
		<updated>2011-09-25T22:44:39Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Debugging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article analyzes and compares different Integrated development environments [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of features such as:&lt;br /&gt;
&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Source_code_editor source code editor].&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Compiler compiler] and/or an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter].&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.Some IDE's support multiple languages support for some alternate languages is provided through plugins.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ RUBY]is a dynamic, reflective, open source, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ Ruby] supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;ref&amp;gt;[http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails Editing]&amp;lt;/ref&amp;gt; Editing==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  [http://www.eclipse.org/mylyn/ Mylyn Integration]&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref&amp;gt;[http://netbeans.org/features/java/debugger.html Netbeans]&amp;lt;/ref&amp;gt; supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect. [http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.rdt.doc.user%2Fhtml%2Ftoc.html RDT] is a standard Eclipse plug-in, with features and plug-ins, so you can expand the zip file directly into the Eclipse folder. The paths in the archive take care of the rest.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50796</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50796"/>
		<updated>2011-09-25T22:35:11Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article analyzes and compares different Integrated development environments &amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] &amp;lt;/ref&amp;gt; that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of features such as:&lt;br /&gt;
&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Source_code_editor source code editor].&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Compiler compiler] and/or an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter].&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.Some IDE's support multiple languages support for some alternate languages is provided through plugins.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ RUBY]is a dynamic, reflective, open source, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ Ruby] supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  [http://www.eclipse.org/mylyn/ Mylyn Integration]&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ Netbeans] supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect. [http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.rdt.doc.user%2Fhtml%2Ftoc.html RDT] is a standard Eclipse plug-in, with features and plug-ins, so you can expand the zip file directly into the Eclipse folder. The paths in the archive take care of the rest.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50794</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50794"/>
		<updated>2011-09-25T22:34:15Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article analyzes and compares different Integrated development environments &amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] &amp;lt;/ref&amp;gt; that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of features such as:&lt;br /&gt;
&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Source_code_editor source code editor].&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Compiler compiler] and/or an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter].&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.Some IDE's support multiple languages support for some alternate languages is provided through plugins.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ RUBY]is a dynamic, reflective, open source, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ Ruby] supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  [http://www.eclipse.org/mylyn/ Mylyn Integration]&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ Netbeans] supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect. [http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.rdt.doc.user%2Fhtml%2Ftoc.html RDT] is a standard Eclipse plug-in, with features and plug-ins, so you can expand the zip file directly into the Eclipse folder. The paths in the archive take care of the rest.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
1. http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails/&lt;br /&gt;
&lt;br /&gt;
2. http://devnet.jetbrains.net/docs/DOC-1146&lt;br /&gt;
&lt;br /&gt;
3. http://netbeans.org/features/java/debugger.html&lt;br /&gt;
&lt;br /&gt;
4. http://r2.ifs.hsr.ch/rubyrefactoring.pdf&lt;br /&gt;
&lt;br /&gt;
5. http://www.jetbrains.com/ruby/features/ruby_ide.html&lt;br /&gt;
&lt;br /&gt;
6. http://netbeans.org/features/ide/editor.html&lt;br /&gt;
&lt;br /&gt;
7. http://vimeo.com/channels/radrails#9895797&lt;br /&gt;
&lt;br /&gt;
8. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_11_f1%2C&lt;br /&gt;
&lt;br /&gt;
9. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_22&lt;br /&gt;
&lt;br /&gt;
10. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_rf&lt;br /&gt;
&lt;br /&gt;
11. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_aa&lt;br /&gt;
&lt;br /&gt;
12. http://www.aptana.com/products/radrails&lt;br /&gt;
&lt;br /&gt;
13. http://netbeans.org/features/all.html#ruby&lt;br /&gt;
&lt;br /&gt;
14. http://www.jetbrains.com/ruby/documentation/index.html&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50782</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50782"/>
		<updated>2011-09-25T22:30:57Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article analyzes and compares different [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of features such as:&lt;br /&gt;
&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Source_code_editor source code editor].&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Compiler compiler] and/or an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter].&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.Some IDE's support multiple languages support for some alternate languages is provided through plugins.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ RUBY]is a dynamic, reflective, open source, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
[http://www.ruby-lang.org/en/ Ruby] supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  [http://www.eclipse.org/mylyn/ Mylyn Integration]&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ Netbeans] supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect. [http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.rdt.doc.user%2Fhtml%2Ftoc.html RDT] is a standard Eclipse plug-in, with features and plug-ins, so you can expand the zip file directly into the Eclipse folder. The paths in the archive take care of the rest.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
1. http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails/&lt;br /&gt;
&lt;br /&gt;
2. http://devnet.jetbrains.net/docs/DOC-1146&lt;br /&gt;
&lt;br /&gt;
3. http://netbeans.org/features/java/debugger.html&lt;br /&gt;
&lt;br /&gt;
4. http://r2.ifs.hsr.ch/rubyrefactoring.pdf&lt;br /&gt;
&lt;br /&gt;
5. http://www.jetbrains.com/ruby/features/ruby_ide.html&lt;br /&gt;
&lt;br /&gt;
6. http://netbeans.org/features/ide/editor.html&lt;br /&gt;
&lt;br /&gt;
7. http://vimeo.com/channels/radrails#9895797&lt;br /&gt;
&lt;br /&gt;
8. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_11_f1%2C&lt;br /&gt;
&lt;br /&gt;
9. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_22&lt;br /&gt;
&lt;br /&gt;
10. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_rf&lt;br /&gt;
&lt;br /&gt;
11. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_aa&lt;br /&gt;
&lt;br /&gt;
12. http://www.aptana.com/products/radrails&lt;br /&gt;
&lt;br /&gt;
13. http://netbeans.org/features/all.html#ruby&lt;br /&gt;
&lt;br /&gt;
14. http://www.jetbrains.com/ruby/documentation/index.html&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50754</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50754"/>
		<updated>2011-09-25T22:15:05Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Debugging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article is trying to analyze and compare different [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An IDE is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of:&lt;br /&gt;
&lt;br /&gt;
* A source code editor.&lt;br /&gt;
* A compiler and/or an interpreter.&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
RUBY is a dynamic, reflective, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
Ruby supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mylyn Integration&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ Netbeans] supports a configurable [http://en.wikipedia.org/wiki/Debugger debugger] which can be used to set [http://en.wikipedia.org/wiki/Breakpoint breakpoints], look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
[http://www.aptana.com/products/radrails Aptana RadRails] has an integrated Debugger which allows us to set breakpoints, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/idea/ IntelliJ] supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in [http://en.wikipedia.org/wiki/Debugger debugger]. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for [http://www.eclipse.org/ Eclipse] broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
1. http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails/&lt;br /&gt;
&lt;br /&gt;
2. http://devnet.jetbrains.net/docs/DOC-1146&lt;br /&gt;
&lt;br /&gt;
3. http://netbeans.org/features/java/debugger.html&lt;br /&gt;
&lt;br /&gt;
4. http://r2.ifs.hsr.ch/rubyrefactoring.pdf&lt;br /&gt;
&lt;br /&gt;
5. http://www.jetbrains.com/ruby/features/ruby_ide.html&lt;br /&gt;
&lt;br /&gt;
6. http://netbeans.org/features/ide/editor.html&lt;br /&gt;
&lt;br /&gt;
7. http://vimeo.com/channels/radrails#9895797&lt;br /&gt;
&lt;br /&gt;
8. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_11_f1%2C&lt;br /&gt;
&lt;br /&gt;
9. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_22&lt;br /&gt;
&lt;br /&gt;
10. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_rf&lt;br /&gt;
&lt;br /&gt;
11. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_aa&lt;br /&gt;
&lt;br /&gt;
12. http://www.aptana.com/products/radrails&lt;br /&gt;
&lt;br /&gt;
13. http://netbeans.org/features/all.html#ruby&lt;br /&gt;
&lt;br /&gt;
14. http://www.jetbrains.com/ruby/documentation/index.html&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50744</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=50744"/>
		<updated>2011-09-25T22:06:14Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article is trying to analyze and compare different [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated development environments] that are in use for software development in [http://www.ruby-lang.org/en/ Ruby]. We will be comparing [http://www.aptana.com/products/radrails Aptana RadRails], [http://www.jetbrains.com/ruby/ Ruby Mine], [http://www.eclipse.org/ Eclipse] and [http://netbeans.org/ NetBeans].&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An IDE is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of:&lt;br /&gt;
&lt;br /&gt;
* A source code editor.&lt;br /&gt;
* A compiler and/or an interpreter.&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A [http://en.wikipedia.org/wiki/Debugger debugger].&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
RUBY is a dynamic, reflective, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
Ruby supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Functional_programming Functional]: Computation is evaluation of a mathematical function.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Imperative_programming Imperative]: Computation in terms of statements that change the program stare.&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Reflective_programming Reflective]: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mylyn Integration&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''[http://netbeans.org NetBeans]'''&lt;br /&gt;
&lt;br /&gt;
NetBeans provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.eclipse.org/ Eclipse]'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/idea/features/ruby_rails.html Idea]'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.aptana.com/products/radrails RadRails]'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''[http://www.jetbrains.com/ruby/ Rubymine]'''&lt;br /&gt;
&lt;br /&gt;
Rubymine is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support [http://subversion.tigris.org/ SVN], [http://git-scm.com/ Git], [http://www.nongnu.org/cvs/ CVS] version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
Netbeans supports a configurable debugger which can be used to set breakpoints, look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
Aptana RadRails has an integrated Debugger which allows us to set breakpoitns, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
RubyMine supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
It supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in debugger. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for Eclipse broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in [http://www.eclipse.org/ Eclipse] can continue using the [http://www.aptana.com/products/radrails RadRails] plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
[http://netbeans.org/ NetBeans] supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/ruby/ RubyMine] is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility.RubyMine pops open any file with just a few key strokes. It also provides instantaneous formatting and project navigation [http://www.jetbrains.com/idea/ IntelliJ] is known to be the most intelligent IDE, it understands the code and makes right suggestions and helps in shaping the code.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
1. http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails/&lt;br /&gt;
&lt;br /&gt;
2. http://devnet.jetbrains.net/docs/DOC-1146&lt;br /&gt;
&lt;br /&gt;
3. http://netbeans.org/features/java/debugger.html&lt;br /&gt;
&lt;br /&gt;
4. http://r2.ifs.hsr.ch/rubyrefactoring.pdf&lt;br /&gt;
&lt;br /&gt;
5. http://www.jetbrains.com/ruby/features/ruby_ide.html&lt;br /&gt;
&lt;br /&gt;
6. http://netbeans.org/features/ide/editor.html&lt;br /&gt;
&lt;br /&gt;
7. http://vimeo.com/channels/radrails#9895797&lt;br /&gt;
&lt;br /&gt;
8. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_11_f1%2C&lt;br /&gt;
&lt;br /&gt;
9. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_22&lt;br /&gt;
&lt;br /&gt;
10. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_rf&lt;br /&gt;
&lt;br /&gt;
11. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_aa&lt;br /&gt;
&lt;br /&gt;
12. http://www.aptana.com/products/radrails&lt;br /&gt;
&lt;br /&gt;
13. http://netbeans.org/features/all.html#ruby&lt;br /&gt;
&lt;br /&gt;
14. http://www.jetbrains.com/ruby/documentation/index.html&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=47878</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=47878"/>
		<updated>2011-09-08T19:49:56Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: Undo revision 47576 by Hsun6 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This article is trying to analyze and compare different Integrated Development Environments(IDE) that are in use for software development in Ruby. We will be comparing Aptana RadRails, Ruby Mine, Eclipse and NetBeans.&lt;br /&gt;
&lt;br /&gt;
==What is an IDE?==&lt;br /&gt;
&lt;br /&gt;
An IDE is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of:&lt;br /&gt;
&lt;br /&gt;
* A source code editor.&lt;br /&gt;
* A compiler and/or an interpreter.&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A debugger.&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.&lt;br /&gt;
&lt;br /&gt;
==What is RUBY and its features?==&lt;br /&gt;
&lt;br /&gt;
RUBY is a dynamic, reflective, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
Ruby supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*Functional: Computation is evaluation of a mathematical function.&lt;br /&gt;
*Object oriented: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*Imperative: Computation in terms of statements that change the program stare.&lt;br /&gt;
*Reflective: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
== System requirements ==&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
| Helios 3.6&lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| P4 or higher&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
| Mac OS X 10.4.10 minimum&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Dual-Core Intel, PowerPC G5&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 512 MB of RAM (2 GB recommended)&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 122MB&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin.&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned.&lt;br /&gt;
| GNOME or KDE Desktop.&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
| Linux x86&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent.&lt;br /&gt;
| Pentium 4-level processor.&lt;br /&gt;
| Intel Pentium III 800 MHz or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 64 MB&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 58 MB&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Eclipse&lt;br /&gt;
! RadRails&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Rubymine&lt;br /&gt;
|-&lt;br /&gt;
|  Code Analysis&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Call Hierarchy View&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Regular Expression Tester&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mark Occurences&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Smart Indent&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Mylyn Integration&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Comparison notes==&lt;br /&gt;
&lt;br /&gt;
'''NetBeans'''&lt;br /&gt;
&lt;br /&gt;
NetBeans provides effective and clear sytnax highlighting. The autocompletion provided is more advanced than Idea and Eclipse. However NetBeans misses a finalized installation configuration and live coding templates. NetBeans makes it easy to add plugins. It includes a complete editing assistance. &lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
Eclipse provides advance refactoring tools developed by students and also comes with a well done documentation and explanations. The biggest advantage of Eclipse is its Debugging ability. &lt;br /&gt;
&lt;br /&gt;
'''Idea'''&lt;br /&gt;
&lt;br /&gt;
Idea has a nice syntax highlighting and interactivity with the coder. Autocompletion in Idea is limited to keywords and statements only.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
It supports syntax highlighting, auto completion, code assist and error reporting. It also supports refactoring but it is limited to instance variables, inlining and renaming. It also supports fast and integrated debugger.&lt;br /&gt;
&lt;br /&gt;
'''Rubymine'''&lt;br /&gt;
&lt;br /&gt;
Rubymine is an intelligent full featured code editor. It also performs automatic Ruby code styling with brace matching.It also provides code completion and navigation. RubyMine allows quick rake tasks execution.&lt;br /&gt;
&lt;br /&gt;
==Refactoring==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
! Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As it can be concluded from the above table, Eclipse IDE with the Ruby development tools plugin is far better for editing than the other IDE's .&lt;br /&gt;
&lt;br /&gt;
==Version Control Integration==&lt;br /&gt;
&lt;br /&gt;
All the IDE's under comparison (Aptana RadRails, Ruby Mine, Eclipse and NetBeans) support SVN, Git, CVS control version systems.&lt;br /&gt;
&lt;br /&gt;
Individual features are:&lt;br /&gt;
&lt;br /&gt;
*Recognition of existing version-controlled directories.&lt;br /&gt;
*Versioning window shows new, removed, or modified files.&lt;br /&gt;
*Color-coded status of lines, files and folders: New, removed, up-to-date, or modified.&lt;br /&gt;
*Color-coded Diff Viewer for intuitive merge conflict resolution.&lt;br /&gt;
*Export Diff Patch action.&lt;br /&gt;
*Sharable project metadata.&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
'''Netbeans 7.0'''&lt;br /&gt;
&lt;br /&gt;
Netbeans supports a configurable debugger which can be used to set breakpoints, look at the local variables, navigate the call stack and switch threads. The Netbeans debugger also supports expression evaluation, expression steping, multi-session debugging, multi- threaded Debugging etc. It also allows us to attach the debugger to any remote process started from the command line.&lt;br /&gt;
&lt;br /&gt;
'''RadRails'''&lt;br /&gt;
&lt;br /&gt;
Aptana RadRails has an integrated Debugger which allows us to set breakpoitns, inspect variables and control execution. &lt;br /&gt;
&lt;br /&gt;
'''RubyMine'''&lt;br /&gt;
&lt;br /&gt;
RubyMine supports an advanced graphical debugger. It provides a convenient user interface with a fully customizable UI. It also allows us to define hit conditions for breakpoints and determine whether to stop or continue the execution.&lt;br /&gt;
&lt;br /&gt;
'''IntelliJ'''&lt;br /&gt;
&lt;br /&gt;
It supports a highly fast and powerful debugger which is capable of executing multiple profiles. It also displays custom objects in debugger. Remote debugging, variable modifications and expression evaluations are other important debugging options supported.&lt;br /&gt;
&lt;br /&gt;
'''Eclipse'''&lt;br /&gt;
&lt;br /&gt;
The Ruby interpreter for Eclipse broadcasts debugging information over a specific (configurable) port, and tools like the RDT can listen over that port and supply the types of debugging support developers expect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Users accustomed on working in Eclipse can continue using the RadRails plugin. Eclipse provides excellent debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
NetBeans supports multiple languages like C++, Java.&lt;br /&gt;
&lt;br /&gt;
RubyMine is exceptionally good when it comes to refactoring and can be chosen over other IDE's if this is of greater utility. RubyMine also has an intelligent code editor which others don't.&lt;br /&gt;
&lt;br /&gt;
The document covers some of the major IDE's in the market for Ruby. Every IDE has its own advantages and disadvantages. The criteria for choosing a specific IDE solely depends on the perspective of a Ruby programmer and which features he wants the most from the IDE as compared to others.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
1. http://tnlessone.wordpress.com/2007/02/28/ruby-rails-ide-comparison-idea-netbeans-radrails/&lt;br /&gt;
&lt;br /&gt;
2. http://devnet.jetbrains.net/docs/DOC-1146&lt;br /&gt;
&lt;br /&gt;
3. http://netbeans.org/features/java/debugger.html&lt;br /&gt;
&lt;br /&gt;
4. http://r2.ifs.hsr.ch/rubyrefactoring.pdf&lt;br /&gt;
&lt;br /&gt;
5. http://www.jetbrains.com/ruby/features/ruby_ide.html&lt;br /&gt;
&lt;br /&gt;
6. http://netbeans.org/features/ide/editor.html&lt;br /&gt;
&lt;br /&gt;
7. http://vimeo.com/channels/radrails#9895797&lt;br /&gt;
&lt;br /&gt;
8. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_11_f1%2C&lt;br /&gt;
&lt;br /&gt;
9. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_22&lt;br /&gt;
&lt;br /&gt;
10. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_rf&lt;br /&gt;
&lt;br /&gt;
11. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1a_6_aa&lt;br /&gt;
&lt;br /&gt;
12. http://www.aptana.com/products/radrails&lt;br /&gt;
&lt;br /&gt;
13. http://netbeans.org/features/all.html#ruby&lt;br /&gt;
&lt;br /&gt;
14. http://www.jetbrains.com/ruby/documentation/index.html&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=45597</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1a_ms&amp;diff=45597"/>
		<updated>2011-08-31T18:47:25Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
This article is trying to analyze and compare different Integrated Development Environments(IDE) that are in use for software development in Ruby. We will be comparing Aptana RadRails, Ruby Mine, Eclipse and NetBeans.&lt;br /&gt;
&lt;br /&gt;
=What is an IDE?=&lt;br /&gt;
&lt;br /&gt;
An IDE is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of:&lt;br /&gt;
&lt;br /&gt;
* A source code editor.&lt;br /&gt;
* A compiler and/or an interpreter.&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A debugger.&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.&lt;br /&gt;
&lt;br /&gt;
=What is RUBY and its features?=&lt;br /&gt;
&lt;br /&gt;
RUBY is a dynamic, reflective, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
Ruby supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*Functional: Computation is evaluation of a mathematical function.&lt;br /&gt;
*Object oriented: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*Imperative: Computation in terms of statements that change the program stare.&lt;br /&gt;
*Reflective: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
= System requirements =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
! Eclipse &lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 150 MB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
|&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
|&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
|&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
|&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned&lt;br /&gt;
| GNOME or KDE Desktop&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
|&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent&lt;br /&gt;
| Pentium 4-level processor&lt;br /&gt;
| Intel Pentium III 800 MHz or higher&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
|&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
|&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=General=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Refactoring=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Version Control Integration=&lt;br /&gt;
&lt;br /&gt;
All the IDE support SVN, Git, CVS control version systems.&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011&amp;diff=45596</id>
		<title>CSC/ECE 517 Fall 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011&amp;diff=45596"/>
		<updated>2011-08-31T18:46:04Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[CSC/ECE 517 Fall 2011/ch1 1a ms]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2010/ch1 1e vs]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1e aa]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1d sr]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1e dm]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1b sa]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1b ds]]&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch1_1a_ms&amp;diff=45448</id>
		<title>CSC/ECE 517 Fall 2010/ch1 1a ms</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch1_1a_ms&amp;diff=45448"/>
		<updated>2011-08-29T02:05:50Z</updated>

		<summary type="html">&lt;p&gt;Mvkantra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2010/ch1 1a ms&lt;br /&gt;
----&lt;br /&gt;
=Introduction=&lt;br /&gt;
This article is trying to analyze and compare different Integrated Development Environments(IDE) that are in use for software development in Ruby. We will be comparing Aptana RadRails, Ruby Mine, Eclipse and NetBeans.&lt;br /&gt;
&lt;br /&gt;
=What is an IDE?=&lt;br /&gt;
&lt;br /&gt;
An IDE is a software application which provides comprehensive facilities to maximize computer programmers' productivity. An IDE consists of:&lt;br /&gt;
&lt;br /&gt;
* A source code editor.&lt;br /&gt;
* A compiler and/or an interpreter.&lt;br /&gt;
* Build automation tools.&lt;br /&gt;
* A debugger.&lt;br /&gt;
&lt;br /&gt;
The aim is to abstract the configuration necessary to piece together command line utilities in a cohesive unit. Most IDE's are graphical to improve interaction.&lt;br /&gt;
&lt;br /&gt;
=What is RUBY and its features?=&lt;br /&gt;
&lt;br /&gt;
RUBY is a dynamic, reflective, general-purpose object-oriented programming language.&lt;br /&gt;
&lt;br /&gt;
Ruby supports multiple programming paradigms, including: &lt;br /&gt;
&lt;br /&gt;
*Functional: Computation is evaluation of a mathematical function.&lt;br /&gt;
*Object oriented: Data structures consisting of data fields and methods are used.&lt;br /&gt;
*Imperative: Computation in terms of statements that change the program stare.&lt;br /&gt;
*Reflective: Computer program can evaluate and modify its structure.&lt;br /&gt;
&lt;br /&gt;
Additionally, it has a dynamic type system and automatic memory management.&lt;br /&gt;
&lt;br /&gt;
= Comparison =&lt;br /&gt;
&lt;br /&gt;
= System requirements =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! Eclipse&lt;br /&gt;
! NetBeans&lt;br /&gt;
! Aptana RadRails&lt;br /&gt;
! RubyMine&lt;br /&gt;
|-&lt;br /&gt;
! Version&lt;br /&gt;
! Eclipse &lt;br /&gt;
| NetBeans 7.0.1&lt;br /&gt;
| Aptana 2.0.5&lt;br /&gt;
| RubyMine 3.2.3&lt;br /&gt;
|-&lt;br /&gt;
! Windows XP/Vista/7&lt;br /&gt;
| Windows XP/Vista/7&lt;br /&gt;
| Windows XP/ more&lt;br /&gt;
| Windows 2003/XP/Vista/7&lt;br /&gt;
|-&lt;br /&gt;
! Windows Processor&lt;br /&gt;
| 500 MHZ Intel Pentium 3&lt;br /&gt;
| Pentium Level 4&lt;br /&gt;
| Intel Pentium 3 or higher.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
| 1 GB*&lt;br /&gt;
| 2GB&lt;br /&gt;
| 512 MB&lt;br /&gt;
| 2GB RAM recommended.&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 150 MB free disk space.&lt;br /&gt;
| 1GB free disk space.&lt;br /&gt;
| 71.9MB  for an Eclipse Plugin&lt;br /&gt;
| 91.5MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Mac OS X&lt;br /&gt;
|&lt;br /&gt;
| Mac OS 10.5 Intel&lt;br /&gt;
| Mac OS 10.4 +&lt;br /&gt;
| Mac OS 10.5 or higher&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
|&lt;br /&gt;
| Dual Core Intel(32 or 64 bit)&lt;br /&gt;
| Power PC G4/G5&lt;br /&gt;
| 1.42GHz Intel based Mac recommended.&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
|&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
| 650MB of free disk space.&lt;br /&gt;
| 71.9MB for an Eclipse Plugin&lt;br /&gt;
| 84.7MB or more.&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
|&lt;br /&gt;
| Ubuntu 9.10&lt;br /&gt;
| No preferences mentioned&lt;br /&gt;
| GNOME or KDE Desktop&lt;br /&gt;
|-&lt;br /&gt;
! Processor&lt;br /&gt;
|&lt;br /&gt;
| 800MHz Intel Pentium III or equivalent&lt;br /&gt;
| Pentium 4-level processor&lt;br /&gt;
| Intel Pentium III 800 MHz or higher&lt;br /&gt;
|-&lt;br /&gt;
! RAM&lt;br /&gt;
|&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 512 MB RAM&lt;br /&gt;
| 2GB RAM recommended&lt;br /&gt;
|-&lt;br /&gt;
! Disk Space&lt;br /&gt;
|&lt;br /&gt;
| 650 MB of free disk space&lt;br /&gt;
| 71.9 MB for an Eclipse Plugin&lt;br /&gt;
| 82.1MB or more&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=General=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Statements and keyword completion&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Generate Type Constructor&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Override Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Code Formatting&lt;br /&gt;
|  Yes&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Brace Matching&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Go to symbol&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Refactoring=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Netbeans&lt;br /&gt;
! RadRails&lt;br /&gt;
! Rubymine&lt;br /&gt;
! IDEA IntelliJ&lt;br /&gt;
|-&lt;br /&gt;
|  Rename&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|-&lt;br /&gt;
|  Convert Local variable to field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Encapsulate field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
| Extract Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Class&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Inline Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Merge Class Parts in file&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Merge with external Class Parts&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Move Field&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Move Method&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Push Down&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
|-&lt;br /&gt;
|  Split Local Variable&lt;br /&gt;
|  NO&lt;br /&gt;
|  YES&lt;br /&gt;
|  NO&lt;br /&gt;
|  NO&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Version Control Integration=&lt;br /&gt;
&lt;br /&gt;
All the IDE support SVN, Git, CVS control version systems.&lt;/div&gt;</summary>
		<author><name>Mvkantra</name></author>
	</entry>
</feed>