This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Dir.glob('app/views/**/*.rhtml').each do |file| | |
| puts `git mv #{file} #{file.gsub(/\.rhtml$/, '.erb')}` | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'spork' | |
| Spork.prefork do | |
| # Sets up the Rails environment for Cucumber | |
| ENV["RAILS_ENV"] ||= "cucumber" | |
| require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') | |
| require 'webrat' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| apt-get -y update | |
| apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev | |
| cd /tmp | |
| wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
| tar -xvzf ruby-1.9.3-p125.tar.gz | |
| cd ruby-1.9.3-p125/ | |
| ./configure --prefix=/usr/local | |
| make | |
| make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #To install ruby-debug on Ubuntu ruby-1.9.3 you need to download from http://rubyforge.org/frs/?group_id=8883 | |
| linecache19-0.5.13.gem | |
| ruby_core_source-0.1.5.gem | |
| ruby-debug19-0.11.6.gem | |
| ruby-debug-base19-0.11.26.gem | |
| #Then in your console | |
| export RVM_SRC=/your/path/to/ruby-1.9.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WKHTMLTOPDF : HTML to PDF | |
| Linux: | |
| wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2 | |
| tar xvjf wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2 | |
| sudo mv wkhtmltopdf-amd64 /usr/local/bin/wkhtmltopdf | |
| chmod +x /usr/local/bin/wkhtmltopdf | |
| OSX: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # yes, sometimes you need to do this. you get pilloried in a forum if you | |
| # ask about it, though! | |
| # this code taken from | |
| # http://wholemeal.co.nz/blog/2011/04/05/rendering-from-a-model-in-rails-3/ | |
| class MyModel < ActiveRecord::Base | |
| # Use the my_models/_my_model.txt.erb view to render this object as a string | |
| def to_s | |
| ActionView::Base.new(Rails.configuration.paths.app.views.first).render( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| include ActionController::UrlWriter | |
| users_path | |
| users_url |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Re: Rails and MS Word | |
| Posted by Paul Corcoran (Guest) | |
| on 2006-12-29 18:24 | |
| (Received via mailing list) | |
| Here is an example of creating a Word and Excel file from a Ruby | |
| application. Win32ole is bundled with Ruby 1.8 and above so no need to | |
| install it if your current on Ruby. | |
| -Paul |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
| # defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
| module Player | |
| describe MovieList, "with optional description" do | |
| it "is pending example, so that you can write ones quickly" | |
| it "is already working example that we want to suspend from failing temporarily" do | |
| pending("working on another feature that temporarily breaks this one") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| describe "Artists to releases relationship" do | |
| before(:all) do | |
| @kanye = FactoryGirl.create(:artist, :name => 'Kanye West') | |
| @jz = FactoryGirl.create(:artist, :name => 'Jay Z') | |
| @watch_the_throne = FactoryGirl.create(:release, :name => 'Watch the Throne') | |
| @dropout = FactoryGirl.create(:release, :name => 'The College Dropout') | |
| end |
OlderNewer