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 'spec_helper' | |
describe Client do | |
context "With valid client info" do | |
context "Associations" do | |
it "should embed many projects" do | |
association = Client.relations['projects'] | |
association.klass.should == Project | |
association.relation.should == Mongoid::Relations::Embedded::Many | |
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
class ImportedContactsController << ApplicationController | |
require 'net/http' | |
require 'net/https' | |
require 'uri' | |
#THIS METHOD TO SEND USER TO THE GOOGLE AUTHENTICATION PAGE. | |
def authenticate | |
# initiate authentication w/ gmail | |
# create url with url-encoded params to initiate connection with contacts api | |
# next - The URL of the page that Google should redirect the user to after authentication. | |
# scope - Indicates that the application is requesting a token to access contacts feeds. |
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
development: | |
host: localhost | |
database: quadmint_development | |
test: | |
host: localhost | |
database: quadmint_test | |
# set these environment variables on your prod server | |
production: |
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
Puma 1.1.1 starting... | |
* Min threads: 0, max threads: 16 | |
* Listening on tcp://0.0.0.0:9292 | |
Use Ctrl-C to stop | |
127.0.0.1 - - [10/Apr/2012 10:14:46] "GET /index.html HTTP/1.1" 304 - 2.5345 | |
127.0.0.1 - - [10/Apr/2012 10:14:51] "GET /rails.png HTTP/1.1" 304 - 4.0353 | |
127.0.0.1 - - [10/Apr/2012 10:14:51] "GET /favicon.ico HTTP/1.1" 304 - 0.0005 | |
127.0.0.1 - - [10/Apr/2012 10:14:53] "GET /products HTTP/1.1" 304 - 0.8145 | |
127.0.0.1 - - [10/Apr/2012 10:14:53] "GET /scaffolds.css?body=1 HTTP/1.1" 304 - 0.0055 | |
127.0.0.1 - - [10/Apr/2012 10:14:53] "GET /products.css?body=1 HTTP/1.1" 304 - 0.0126 |
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
1xx Informational | |
100 Continue :continue | |
101 Switching Protocols :switching_protocols | |
102 Processing :processing | |
2xx Success | |
200 OK :ok |
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
# If you wish to store everything in one logger file then do this. | |
class CustomLogger | |
LOGGERFILE = File.join("#{Rails.root}/log/category_clicks_#{Rails.env}_errors.log") | |
def self.log( message, severity = :info ) | |
@category_click_logger ||= ActiveSupport::BufferedLogger.new( LOGGERFILE ) | |
@model_log.send severity, "[#{Time.now.to_s(:db)}] [#{severity.to_s.capitalize}] #{message}\n" | |
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
# This should be an initializer. | |
class CustomLogger | |
TABFILE = File.join("#{Rails.root}/log/tab_#{Rails.env}_errors.log") | |
SEARCHFILE = File.join("#{Rails.root}/log/searches_#{Rails.env}_errors.log") | |
VIDEOADFILE = File.join("#{Rails.root}/log/video_ads_#{Rails.env}_errors.log") | |
BANNERADFILE = File.join("#{Rails.root}/log/banner_ads_#{Rails.env}_errors.log") | |
CATEGORYFILE = File.join("#{Rails.root}/log/categories_#{Rails.env}_errors.log") | |
CONTENTPATHFILE = File.join("#{Rails.root}/log/content_paths_#{Rails.env}_errors.log") | |
CATEGORYCLICKFILE = File.join("#{Rails.root}/log/category_clicks_#{Rails.env}_errors.log") |
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 'pdf_generator' | |
class TasksController < ApplicationController | |
include PdfGenerator | |
def some_action | |
pdf_generator( download = true ) | |
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
# 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 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") |
OlderNewer