Posts

Showing posts with the label RubyGem

Tab-Completion and Syntax coloring for irb (Ruby Interpreter)

Image
Wirble is a Ruby Gem that provides Tab-Completion and syntax coloring for the Ruby interpreter, irb . In this article we'll see how to install it and configure it. irb with Tab-Completion and Syntax coloring Install Open a terminal window and run: sudo gem install wirble && echo -n "require 'rubygems'\nrequire 'wirble'\nWirble.init\nWirble.colorize" >> ~/.irbrc Usage Now that Wirble is installed and irbrc is properly configured, (re)open irb and then you can start using the "TAB" key to auto-complete while typing a Ruby instruction. Only the results will be colorized, not the instructions typed. References Wirble: Tab-Completion and Syntax Coloring for irb | Ruby Inside

[HOW TO] Install gtk-webkit-ruby Gem

WebKit is an open source web browser engine. gtk-webkit-ruby is a Ruby Gem that provides Gtk Webkit bindings for ruby, making it possible to embed a webview (class that has the ability to render a webpage) in a Ruby-GNOME2 application. In this article we'll see how to install it in any Ubuntu distribution. Install Open a terminal window and run: sudo apt-get install ruby-gnome2-dev -y && sudo apt-get install libwebkitgtk-dev -y && sudo gem install gtk-webkit-ruby -y Usage Bellow are the main instructions that should be added to a program in order to render a webpage within a Ruby-GNOME2 application. Please note that this is not a runnable example. require "gtk2" require "webkit" webview = WebKit::WebView.new webview.show webview.open(url) # url is a string Note While I was trying to install the Gem I encountered some errors that were caused by dependencies not being installed in my system: ruby-gnome2-dev and libwebkitgtk...