Txt

Byte sized tech know-how.

  • Home
  • About

Category Archives: Ruby

11 May

Delete Leading Whitespace

Delete leading whitespace (spaces/tabs/etc) from beginning of each line


ruby -pe 'gsub(/^\s+/, "")' < file.txt
admin Posted in Command Line, Linux, Ruby command, delete, filler, line, Linux, whitespace 1 Comment
23 Apr

Double space a file using Ruby

Double space a file with Ruby using the command


ruby -pe 'puts' < file.txt
admin Posted in Command Line, Linux, Ruby command, double, file, filler, Linux, Ruby, space Leave a comment
06 Jun

Installing Rails

You can install Rails in a Fedora system with these commands…


yum -y install ruby ruby-devel ruby-irb ruby-libs ruby-rdoc ruby-ri rubygems
sudo gem update
sudo gem install rails --include-dependencies
admin Posted in Command Line, Linux, Ruby command, fedora, gem, install, Linux, rails, Ruby, yum Leave a comment
03 Dec

Find if a Variable is Defined in Ruby

This will let you find whether a variable is defined in ruby.


if(defined? var_name) then
    print var_name + " is set"
end
admin Posted in Ruby Code, define, defined, rails, Ruby, undef, undefined, variable Leave a comment
01 Nov

Installing a Ruby Gem

Use this command to install a ruby gem in Linux – you must be connected to the net


sudo gem install ruport -y
admin Posted in Command Line, Linux, Ruby command, gem, install, Linux, rails, Ruby Leave a comment

Post navigation

Categories

  • Code
  • Command Line
  • Configuration
  • CSS
  • HTML
  • internet
  • JavaScript
  • Linux
  • Mobile
  • Perl
  • PHP
  • Python
  • Ruby
  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Fruitful theme by fruitfulcode Powered by: WordPress
↑