Skip to content

Category Archives: Ruby

Rails without welcome screen Aboard

30-Apr-09

First remove the file , public/index.html and add a route (to config/routes.rb) like:
then …
For example map.connect’ ‘ :controller => ‘Home’, :action => ‘ index’
To specify the Controller and Action for the initial you application Rails.

Share on Facebook

var button = document.getElementById(’facebook_share_link_261′) || document.getElementById(’facebook_share_icon_261′) || document.getElementById(’facebook_share_both_261′) || document.getElementById(’facebook_share_button_261′);
if (button) {
button.onclick = function(e) {
var [...]

Share on Facebook

Why Ruby…??? My Reasonable Question

27-Apr-09

Why would any self-respecting Java developer care about Ruby? Ruby is a general-purpose scripting language created 10 years ago in Japan. Contrary to popular belief, it is a pure object-oriented language. Unlike Java technology, Ruby has no scalars, so everything, including integers, are first-class objects. Ruby’s syntax borrows heavily from Smalltalk, Python, and Ada. Like [...]

Share on Facebook

Locos x Rails second part…

14-Apr-09

This is video by  locos x rails Conference Buenos Aires Argentina

We are in the Video  Juan Ayup and Me

Tinix./

Share on Facebook

var button = document.getElementById(’facebook_share_link_240′) || document.getElementById(’facebook_share_icon_240′) || document.getElementById(’facebook_share_both_240′) || document.getElementById(’facebook_share_button_240′);
if (button) {
button.onclick = function(e) {
var url = this.href.replace(/share\.php/, ’sharer.php’);
window.open(url,’sharer’,'toolbar=0,status=0,width=626,height=436′);
return false;
}

if (button.id === ‘facebook_share_button_240′) {
button.onmouseover = function(){
this.style.color=’#fff’;
this.style.borderColor = ‘#295582′;
this.style.backgroundColor = ‘#3b5998′;
}
button.onmouseout = function(){
this.style.color = ‘#3b5998′;
this.style.borderColor = [...]

Share on Facebook

Ruby-debugger Second part

07-Apr-09

The package needed is the ruby1.8-dev …then install

tinix@Creek:/#sudo gem install ruby-debug
Building native extensions. This could take a while…
Building native extensions. This could take a while…
Successfully installed linecache-0.43
Successfully installed ruby-debug-base-0.10.3
Successfully installed ruby-debug-0.10.3
3 gems installed
Installing ri documentation for linecache-0.43…
Installing ri documentation for ruby-debug-base-0.10.3…
Installing ri documentation for ruby-debug-0.10.3…
Installing RDoc documentation for linecache-0.43…
Installing RDoc documentation for ruby-debug-base-0.10.3…
Installing [...]

Share on Facebook

Ruby-debugger

07-Apr-09

I needed install ruby-debug but the package could a take Error
tinix@Creek:/home/tinix/test# gem install ruby-debug
Building native extensions. This could take a while…
ERROR: Error installing ruby-debug:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install ruby-debug
extconf.rb:1:in `require’: no such file to load — mkmf (LoadError)
from extconf.rb:1

Gem files will remain installed in /var/lib/gems/1.8/gems/linecache-0.43
for [...]

Share on Facebook

Locos x Rails finished

06-Apr-09

Finished the Conference in Buenos Aires locosxrails.com all very good, where I served well and I learned a lot more with different speakers,
I like the talk Obie Fernandez was …
that he wanted to rescue Rio Cuarto developers who are working on Ruby on Rails as well,
this moment not remenber his names…
everything was great thanks again [...]

Share on Facebook

Gem Install Twitter

06-Mar-09

Gem install does not want twitter I have trouble now for created application with rubyonrails and twitter.
debian:/home/tinix# gem install twitter
Building native extensions. This could take a while…
ERROR: Error installing twitter:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb install twitter
extconf.rb:1:in `require’: no such file to load [...]

Share on Facebook

Convert documents from the Internet “html” in plain text -Second Part

09-Oct-08

I could clean the html code to plain text with the methods sub gsub….everything is very clean and truly brilliant….my pesonal Savior ….SUB and  GSUB…
see you Tinix./
Share on Facebook

var button = document.getElementById(’facebook_share_link_122′) || document.getElementById(’facebook_share_icon_122′) || document.getElementById(’facebook_share_both_122′) || document.getElementById(’facebook_share_button_122′);
if (button) {
button.onclick = function(e) {
var url = this.href.replace(/share\.php/, ’sharer.php’);
window.open(url,’sharer’,'toolbar=0,status=0,width=626,height=436′);
return false;
}

if (button.id === ‘facebook_share_button_122′) {
button.onmouseover = function(){
this.style.color=’#fff’;
this.style.borderColor = [...]

Share on Facebook

Convert documents from the Internet “html” in plain text - First Part

03-Oct-08

I thought to use the library open-uri which is the easiest way to obtain the contents of html
require ‘open-uri’
example = open(’htp:/http://www.ruby-lang.org/)
=> #<File:/tmp/open-uri20081002-7271-1exa3en-0>
html = example.read
but the Read method returns an entire chain and not what I want is a plain text….I have to do everything to return ordered
Share on Facebook

var button = document.getElementById(’facebook_share_link_120′) || document.getElementById(’facebook_share_icon_120′) || [...]

Share on Facebook

Ruby standardizes the user permits

04-Sep-08

I wanted to ensure that users do not contain directories of directories that may be modified from the outside, directories that might belong to other users or any other potential security issue
I leave the script…
#!/usr/bin/ruby
#normalize_home.rb
require ‘etc’
require ‘find’
require ‘optparse’
def normalize_home(pwd_entry, maximun_0775, dry_run=true)
uid, home = pwd_entry.uid, pwd_entry.dir
usernme = pwd_entry.name
puts “Scanning #{usename}’s home of {home}
Find.find(home) do |f|
next unless [...]

Share on Facebook