About Jason Noble

  • Website: http://jasonnoble.org
  • Email: email
  • Biography: Jason Noble is a Linux systems engineer with over 10 years experience configuring Linux, Apache, MySQL, Perl, Ruby and Ruby on Rails technologies.

Posts by Jason Noble:

Rubymine print current line

Posted by Jason Noble on 01/28/2012 in Uncategorized |

One way of debugging your ruby scripts is to print out the value of variables in different sections of your code.

Rubymine has a feature called live templates that allows you to type a short command and have RubyMine extract it in to full blown code. Some built in shortcuts exist, such as def (creates a method), desc (create a RSpec test), it (RSpec test), etc.

To create your own, go to RubyMine -> Preferences -> Live Templates. Click one of the existing templates and hit Copy.

I named mine pl (Put Line Number) and put the following content in:

puts “#{__FILE__:#{__LINE__}”

Now when I’m typing code, I can hit the following:

pl<TAB>
p “Hello”

And it will print out the following:

/Users/jasonn/source/project/junk.rb:1
“Hello”

I’ve found this helpful for tracking down where a specific print statement is located.

Updated: Rails3 Custom Environment Variables

Posted by Jason Noble on 12/03/2011 in ruby on rails |

A while back, I wrote a blog post on adding custom environment variables to Rails3. This has gotten much easier with a change made by Jose Valim back in March. The change allows you to create your own custom configuration variables like so: [ruby] # config/environments/development.rb Demo::Application.configure do […] config.json_url = "http://www.domain.com" […] end [/ruby] […]

6

Visiting Pivotal Labs in Boulder, CO

Posted by Jason Noble on 02/17/2011 in Uncategorized |

I recently had the opportunity to visit Boulder, CO (Wiki, Map). The reason for my visit was to visit the Pivotal Labs office and spend a day pairing with them. One of the cool/interesting features of the Pivotal office is that the company provides breakfast in the morning. I walked into the office to find […]

3

Rails3 Custom Environment Variables

Posted by Jason Noble on 02/14/2011 in ruby, ruby on rails |

I recently saw a question on Stack Overflow regarding custom variables that have different values based on which environment you are running for Rails. It turns out it’s very easy to accomplish. [ruby] # config/initializers/configuration.rb class Configuration class << self attr_accessor :json_url end end [/ruby] This gives you access to a Rails variable called Configuration.json_url. […]

Pushing Depot to Heroku

Posted by Jason Noble on 10/31/2010 in ruby on rails |

I’m working my way through Agile Web Development with Rails, 4th edition by Sam Ruby. I just finished up with Chapter 6: Creating the Application. It’s working fine on my machine, but I wanted to push it to Heroku. Here’s how I did it: [plain] echo "gem ‘heroku’" >> Gemfile bundle install git init git […]

Tags: , ,

1

Playing around with Conductor by DHH

Posted by Jason Noble on 10/30/2010 in ruby on rails |

A while back, I saw that DHH had published a rails engine called Conductor. I added it to my list of things to look at and tonight, I got some time to take a look. I’m using RVM with 1.9.2p0 and rails 3.0.1. [plain] rails new conductor && cd conductor [/plain] I edited my Gemfile […]

Tags: ,

Straight HTML/CSS for a change of pace

Posted by Jason Noble on 09/29/2010 in Uncategorized |

I recently worked on a personal project involving HTML and CSS. My wife’s family is trying to sell a 52 acre parcel of land in Noxon, MT. They wanted a website that showed the property better than the real estate agent was able to provide (short summary, only one photo). The site I came up […]

Cruise control.rb refusing to build a project

Posted by Jason Noble on 12/02/2009 in cruise control.rb, git |

I ran into an interesting problem at work today. I had a cruise control project that would not build the project after a commit was made. Other projects in CruiseControl.rb were working properly. Here’s the steps I used to debug: Login to your Cruise Control box and cd to $BUILD_DIR/projects/$PROJ_NAME/work Run the following command. This […]

Tags: , ,

Testing syntax highlighting

Posted by Jason Noble on 09/10/2009 in Uncategorized |

[java] public class HelloBlogger { public static void main(String [] args) { System.out.println("Hello Blogger!!"); } } [/java]

rspec file is newer than

Posted by Jason Noble on 09/10/2009 in rspec simple_matcher custom_matcher be_newer_than |

My pair and I were working on implementing LessCSS at work this week and we ran into an interesting problem. We wanted to write RSpec tests that would figure out if the .less file was newer than the .css file, and if so provide a good error message. We discussed this with Hosh and he […]

Copyright © 2008-2024 Jason Noble's Technical Adventures All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.