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 'rake/gempackagetask' | |
require 'merb-core' | |
require 'merb-core/tasks/merb' | |
GEM_NAME = "merb-slice-blog" | |
AUTHOR = "Your Name" | |
EMAIL = "Your Email" | |
HOMEPAGE = "http://merbivore.com/" |
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 'hpricot' | |
require 'open-uri' | |
class Book | |
include DataMapper::Resource | |
validates_is_unique :isbn | |
property :id, Serial | |
property :title, String |
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 'hpricot' | |
require 'open-uri' | |
class Location | |
include DataMapper::Resource | |
before :create, :update_location | |
property :id, Serial | |
property :name, String |
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 CouchRest | |
class Logger | |
def self.log | |
Thread.current["couchrest.logger"] ||= {:queries => []} | |
end | |
def initialize(app, db=nil) | |
@app = app | |
@db = db |
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
desc 'backup the production database' | |
task :backup do | |
server = "your server" | |
username = "your user" | |
keypair = "#{Merb.root}/path/to/your/keypair" | |
databases = ["your", "databases", "here" ] | |
ssh_command = "ssh -i #{keypair} -L 5985:localhost:5984 #{username}@#{server}" | |
pid, stdin, stdout, stderr = Open4::popen4 ssh_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
1) | |
NoMethodError in 'DepotOrderSlice::QuoteMailer#notify_on_event email template should include the id, name and email' | |
undefined method `each' for nil:NilClass | |
/Users/cpetersen/Code/assaydepot/depot-order-slice/app/models/quoted_ware.rb:172:in `save_attachments' | |
/Users/cpetersen/Code/assaydepot/depot-order-slice/gems/gems/couchrest-0.33/lib/couchrest/mixins/callbacks.rb:386:in `_run_save_callbacks' | |
/Users/cpetersen/Code/assaydepot/depot-order-slice/gems/gems/couchrest-0.33/lib/couchrest/more/extended_document.rb:205:in `save' | |
/Users/cpetersen/Code/assaydepot/depot-order-slice/gems/gems/couchrest-0.33/lib/couchrest/more/extended_document.rb:203:in `catch' | |
/Users/cpetersen/Code/assaydepot/depot-order-slice/gems/gems/couchrest-0.33/lib/couchrest/more/extended_document.rb:203:in `save' | |
./spec/mailers/quote_mailer_spec.rb:13: |
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
[cpetersen@cpetersen depot-catalog-slice (master)]$ ./bin/rake spec --trace | |
(in /Users/cpetersen/Code/assaydepot2/depot-catalog-slice) | |
~ Merb 1.0.9 loaded | |
Loading init file from /Users/cpetersen/Code/assaydepot2/depot-catalog-slice/config/init.rb | |
** Invoke spec (first_time) | |
** Invoke spec:default (first_time) | |
** Execute spec:default | |
/opt/local/lib/ruby/site_ruby/1.8/rubygems.rb:827:in `report_activate_error': RubyGem version error: merb-core(1.0.12 not = 1.0.9) (Gem::LoadError) | |
from /opt/local/lib/ruby/site_ruby/1.8/rubygems.rb:261:in `activate' | |
from /opt/local/lib/ruby/site_ruby/1.8/rubygems.rb:68:in `gem' |
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
[cpetersen@cpetersen depot-catalog-slice (master)]$ thor merb:gem:redeploy | |
Installing abstract-1.0.0 | |
Installing cgi_multipart_eof_fix-2.5.0 | |
Installing couchrest-0.33 | |
Installing daemons-1.0.10 | |
Installing erubis-2.6.3 | |
Installing extlib-0.9.10 | |
Installing fail-fast-1.0.0 | |
Installing fastthread-1.0.1 | |
Building native extensions. This could take a while... |
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
{ | |
"_id": "cell-based-assays-9", | |
"_rev": "923-3362030991", | |
"name": "Cell-Based Assays", | |
"wares": [ | |
{ | |
"ware_id": "23dc69331f0632bffa5179e6296d0c1a", | |
"name": "Ciliary Motility in Airway Cells " | |
} | |
], |
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 'couchrest' | |
class Log < CouchRest::ExtendedDocument | |
database = CouchRest.new | |
database.default_database = "logger" | |
use_database database.default_database | |
property :response_time | |
property :created_at |
OlderNewer