-
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
require 'rubygems' | |
require 'rspec/core/rake_task' | |
require "rspec" | |
namespace :test do | |
desc "Run all specs." | |
Rspec::Core::RakeTask.new(:spec) do |t| | |
t.pattern = 'spec/**/*_spec.rb' | |
t.verbose = false | |
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
1. add to gemfile: | |
gem 'hirb' | |
2. run bundle command | |
3. open the rails console | |
4. input: require 'hirb' | |
5. Enable the use of hirb on rails console: Hirb.enable |
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
find trailing spaces | |
-------------------- | |
grep -R -E "^[[:space:]]+$" * -n |
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 |
OlderNewer