-
The new rake task assets:clean removes precompiled assets. [fxn]
-
Application and plugin generation run bundle install unless
--skip-gemfile
or--skip-bundle
. [fxn] -
Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]
-
Template generation for jdbcpostgresql #jruby [Vishnu Atrai]
This file contains 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
def tip(msg); puts; puts msg; puts "-"*100; end | |
# | |
# 30 Ruby 1.9 Tips, Tricks & Features: | |
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
# | |
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
tip "Ruby 1.9 supports named captures in regular expressions!" |
This file contains 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
# Add fixture-generation methods to ControllerExampleGroup. We load | |
# this file within our spec_helper.rb | |
Spec::Rails::Example::ControllerExampleGroup.class_eval do | |
# Saves the markup to a fixture file using the given name | |
def save_fixture(markup, name) | |
fixture_path = File.join(RAILS_ROOT, '/tmp/js_dom_fixtures') | |
Dir.mkdir(fixture_path) unless File.exists?(fixture_path) |
This file contains 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
Debugger.settings[:autoeval] = true | |
Debugger.settings[:autolist] = 1 | |
Debugger.settings[:reload_source_on_change] = true | |
Debugger.start_remote |
This file contains 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
class PeopleController < ApplicationController | |
before_filter :authenticate_user!, :except => [:index, :show] | |
... | |
end |
Below are steps I followed to get ruby debugger ruby-debug
running with Pow. Based on info from this thread basecamp/pow#43 and this blog post http://flochip.com/2011/04/13/running-pow-with-rdebug/
Assuming you're writing your app in Ruby 1.9 and using Bundler, just add the dependency to your development gems:
This file contains 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
Factory.define :item do |f| | |
include ActionDispatch::TestProcess | |
f.name "Macbook Pro 15" | |
f.price_in_dollars 1500 | |
f.photo fixture_file_upload('/files/avatar.jpg', 'image/jpg') | |
end |
This file contains 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
import sublime, sublime_plugin | |
import os | |
class DetectFileTypeCommand(sublime_plugin.EventListener): | |
""" Detects current file type if the file's extension isn't conclusive """ | |
""" Modified for Ruby on Rails and Sublime Text 2 """ | |
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
def on_load(self, view): | |
filename = view.file_name() |
This file contains 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 matcher to spec delegations. | |
# | |
# Usage: | |
# | |
# describe Post do | |
# it { should delegate(:name).to(:author).with_prefix } # post.author_name | |
# it { should delegate(:month).to(:created_at) } | |
# it { should delegate(:year).to(:created_at) } | |
# end |
OlderNewer