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 ruby | |
libs = [] | |
libs << "irb/completion" | |
libs << File.dirname(__FILE__) + '/../config/boot.rb' | |
command_line = [] | |
command_line << "irb" | |
command_line << libs.inject("") { |acc, lib| acc + %( -r "#{lib}") } | |
command_line << "--simple-prompt" |
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 'hpricot' | |
require 'net/http' | |
require File.dirname(__FILE__) + '/../vendor/gems/activecouch/init' | |
$: << File.dirname(__FILE__) + '/../app/models' | |
ActiveCouch::Base.class_eval do | |
set_database_name 'blog' | |
site 'http://localhost:5984/' |
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 File.dirname(__FILE__) + '/../../spec_helper' | |
describe "Stylesheet" do | |
stylesheet_root = File.expand_path(RAILS_ROOT + '/public') | |
stylesheets = Dir[File.join(stylesheet_root, "**", "*.css")] | |
stylesheets.each do |stylesheet| | |
describe stylesheet do | |
it "should not @import files that don't exist" do |
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
// GET /blog/_view/articles/titles_by_created_at?startkey=[%222007-12-01T00:00:00Z%22]&endkey=[%222007-12-31T24:00:00Z%22] | |
{"total_rows":75,"offset":0,"rows":[ | |
{"id":"showing-multiple-message-types-with-the-flash","key":["2007-12-15T20:14:02Z"],"value":"Showing multiple message types with the flash"}, | |
{"id":"class-instance-and-singleton-methods","key":["2007-12-20T14:50:41Z"],"value":"Class, Instance and Singleton methods"} | |
]} |
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
// GET /blog/_articles/titles_by_posted_at?key=["2007-12-20T14:50:41Z"] | |
{"total_rows":75,"offset":0,"rows":[ | |
{"id":"class-instance-and-singleton-methods","key":["2007-12-20T20:50:41Z"],"value":"Class, Instance and Singleton methods"} | |
]} |
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
// GET /blog/_articles/titles_by_posted_at | |
{ | |
"total_rows":75, | |
"offset":0, | |
"rows":[ | |
{"id":"showing-multiple-message-types-with-the-flash","key":["2007-12-15T20:14:02Z"],"value":"Showing multiple message types with the flash"}, | |
{"id":"class-instance-and-singleton-methods","key":["2007-12-20T14:50:41Z"],"value":"Class, Instance and Singleton methods"}, | |
// ... and so on ... | |
} |
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
// Get all article titles ordered by posted date. | |
function(doc) { | |
if(doc.type == 'article') { | |
emit([doc.posted_at], doc.title); | |
} | |
} |
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
{ | |
"_id": "_design/articles", | |
"_rev": "28651884", | |
"language": "javascript", | |
"views": { | |
"all": { | |
"map": "function(doc) { if(doc.type == 'article') { emit(null, doc); } }" | |
}, | |
"by_author_id": { | |
"map": "function(doc) { if(doc.type == 'article') { emit([doc.author_id], doc); } }" |
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
{ | |
"_id": "_design/articles", | |
"_rev": "42351258", | |
"language": "javascript", | |
"views": { | |
"titles": { | |
"map": "function(doc) { emit(null, { 'id': doc._id, 'title': doc.title }); }" | |
} | |
} | |
} |
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
function(doc) { | |
if(doc.type == 'article') { | |
emit(null, { 'id': doc._id, 'title': doc.title }); | |
} | |
} |