20 April 2014

The Ruby Reflector


Unix shell

  Source Favicon

Like most general purpose Unix shells, gitsh also provides environment variables. You can set a variable using the :set command, and read them using a $ prefix: gitsh@ :set message "A commit message" gitsh@ commit -m $message

If the variable name contains a dot, it will temporarily override one of your git config settings, until the end of your gitsh session. This is useful when pair programming: gitsh@ :set user.name "George Brocklehurst & Mike Burns" gitsh@ …

robots.thoughtbot.com Read
  Source Favicon

To help shed light on the power and subtlety that is the Unix shell, I'd like to take a deep dive into just one of its many features: the humble if statement.


The general syntax of an if statement in any POSIX shell is as follows: if command ; then expressions

elif command ; then # optionally expressions

else command # optionally expressions


The if statement executes command and determines if it exited successfully or not. If so, …

robots.thoughtbot.com Read
  Source Favicon
By Peter Cooper of Ruby Inside 2 years ago.

Building A Unix Shell in Ruby

The first article in a series where 'Working with Unix Processes' author Jesse Storimer implements a Unix shell in pure Ruby code.

Is Ruby Interpreted or Compiled?

Pat Shaughnessy returns with yet another great article diving into the world of Ruby intepreters and execution. This time he looks at the compilers in Rubinius and JRuby and what they're producing.

Rails Went Off The Rails: Why I'm …

rubyinside.com Read
  Source Favicon
By Mark of Heroku over 2 years ago.

Tasks are any command that can be run in your application or even the Unix shell.

For Rails, the convention is to set up rake tasks. To create your scheduled tasks in Rails, copy the code below into lib/tasks/scheduler.rake and customize it to fit your needs. desc "This task is called by the Heroku scheduler add-on" task :update_feed => :environment do puts "Updating feed..." NewsFeed.update puts "done." end

task :send_reminders => :environment …

blog.heroku.com Read
  Source Favicon
By Ryan Tomayko of Ryan Tomayko almost 3 years ago.

The Shell Hater's Handbook , an introductory talk on UNIX shell programming for Ruby hackers given at GoGaRuCo 2010 . Alas, the post-conference wrap up magazine will not be published this year and so I'm making the essay available here instead.

Ruby, like most successful languages, was assembled from pieces of things that came before it: Smalltalk's consistent object system, Perl's practical syntax, UNIX's sensibilities. Not that it didn't …

tomayko.com Read
  Source Favicon
By wycats of Katz Got Your Tongue? over 3 years ago.

I asked around, and some people had the vague idea that there was a $PATH cache in Unix shells. Someone pointed me at this post about clearing the cache .

Sure enough, running hash -r fixed the output of which . I alerted Wayne of rvm to this problem, and he threw in a fix to rvm that cleared the cache when switching rvms. Momentarily, everything seemed fine.

Digging Further

I still didn't exactly understand how this condition could happen in the first place. …

yehudakatz.com Read
  Source Favicon
By scottswigart of How Software is Built 4 years ago.

…framework on the next project, so I could learn more. And so, over the years I have explored all kinds of UNIX shell commands, scripting languages Tcl/Tk, web-development languages, low-level C++ and more.

PHP is really as much here to stay as it's ever been. Why do you think it has been so successful and long lived?

Zeev: I don't pretend to know the complete answer to that question, because at the end of the day, a lot of this has to do with dynamics that are too big to …

howsoftwareisbuilt.com Read
  Source Favicon
By Arild Shirazi of On the Path 4 years ago.

Quite simple for anyone familiar with Unix shell scripting. A normal exit status of zero indicates success, anything else indicates a problem. I have also added the option of specifying the required test coverage number. When the other developers see how easy it is, it will naturally rise to 100%, no? namespace :test do ... desc 'Ensure that existing tests cover a required percentage of the code.' # task :coverage_minimum_met => 'test:coverage' do task …

blog.codesherpas.com Read