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
# tests at http://gist.github.com/3354 | |
class Hoptoad < ActiveResource::Base | |
self.site = "http://your_account.hoptoadapp.com" | |
class << self | |
@@auth_token = 'your_auth_token' | |
def find(*arguments) | |
arguments = append_auth_token_to_params(*arguments) |
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
# implementation at http://gist.github.com/3350 | |
class HoptoadTest < Test::Unit::TestCase | |
context 'Error.find :all' do | |
setup do | |
@errors = Error.find :all | |
end | |
should 'find errors' do |
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
dancroak:(git)advantage[master]/$ script/generate controller Categories | |
uninitialized constant RubiGen | |
dancroak:(git)advantage[master]/$ sudo gem uninstall sproutcore | |
Successfully uninstalled sproutcore-0.9.9 | |
dancroak:(git)advantage[master]/$ script/generate controller Categories | |
create app/views/categories | |
create app/controllers/categories_controller.rb | |
create test/functional/categories_controller_test.rb | |
create app/helpers/categories_helper.rb |
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
irb(main):006:0> :electric_feel ? true : false | |
=> true | |
irb(main):007:0> !! :electric_feel | |
=> true |
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
Processing PhotosController#create (for 127.0.0.1 at 2008-08-10 17:07:55) [POST] | |
Session ID: d1ffe3154f539e4d29373e729a74b99f | |
Parameters: {"Filename"=>"n7609878_30799379_1427.jpg", "action"=>"create", "Upload"=>"Submit Query", "controller"=>"photos", "Filedata"=>#<File:/var/folders/Sw/SwOgwsPr2RaQd++F75BRLU+++TI/-Tmp-/CGI.12965.1>} | |
Photo Columns (0.002088) SHOW FIELDS FROM `photos` | |
NoMethodError (You have a nil object when you didn't expect it! | |
The error occurred while evaluating nil.width): | |
/vendor/plugins/paperclip/lib/paperclip/geometry.rb:79:in `transformation_to' | |
/vendor/plugins/paperclip/lib/paperclip/thumbnail.rb:61:in `transformation_command' |
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 create | |
@photo = Photo.new :image => params[:Filedata] | |
@photo.save | |
render :partial => '/photos/show', :locals => { :photo => @photo } | |
end | |
class Photo < ActiveRecord::Base | |
has_attached_file :image, | |
:styles => { :medium => "500", :small => "150x150#" }, |
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
module TimedOutConnection | |
# overrides the Net::HTTP object | |
# used by ActiveResource::Connection | |
def http | |
http_obj = super | |
http_obj.open_timeout = 2 # seconds | |
http_obj.read_timeout = 5 # seconds | |
http_obj | |
end | |
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
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true | |
[remote "origin"] | |
url = git@github.com:railsrumble/YOURTEAMNAME.git | |
fetch = +refs/heads/*:refs/remotes/origin/* | |
[branch "master"] | |
remote = origin |
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
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true | |
[remote "origin"] | |
url = git@github.com:railsrumble/YOURTEAMNAME.git | |
fetch = +refs/heads/*:refs/remotes/origin/* | |
[branch "master"] | |
remote = origin |
OlderNewer