Skip to content

Instantly share code, notes, and snippets.

View jackdempsey's full-sized avatar

jack dempsey jackdempsey

View GitHub Profile
def it_should_return_json
it "should have content type json" do
@response.should have_content_type(:json)
end
end
describe "#index" do
before do
@response = request("/gists.json")
end
require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')
# bring in the constants so we can use NotFound, etc, instead of Merb::ControllerExceptions::NotFound
include Merb::ControllerExceptions
def it_should_return(content_type)
it "should have content type #{content_type}" do
@response.should have_content_type(content_type)
end
end
require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')
# bring in the constants so we can use NotFound, etc, instead of Merb::ControllerExceptions::NotFound
include Merb::ControllerExceptions
def it_should_return(content_type)
it "should have content type #{content_type}" do
@response.should have_content_type(content_type)
end
end
describe "#index" do
before do
@response = request("/gists.json")
end
it_should_respond_with OK
it_should_return :json
it_reports OK
it_returns :json
diff --git a/merb-core/lib/merb-core/bootloader.rb b/merb-core/lib/merb-core/bootloader.rb
index 1330ede..0bc474b 100644
--- a/merb-core/lib/merb-core/bootloader.rb
+++ b/merb-core/lib/merb-core/bootloader.rb
@@ -127,9 +127,6 @@ module Merb
# :api: plugin
# @overridable
def default_framework
- %w[view model helper controller mailer part].each do |component|
- Merb.push_path(component.to_sym, Merb.root_path("app/#{component}s"))
~/testbed/fresh $ rake db:database_yaml
(in /Users/jdempsey/testbed/fresh)
Loading init file from /Users/jdempsey/testbed/fresh/config/init.rb
Loading /Users/jdempsey/testbed/fresh/config/environments/development.rb
Loading init file from /Users/jdempsey/testbed/fresh/config/init.rb
Loading /Users/jdempsey/testbed/fresh/config/environments/rake.rb
...
Merb::BootLoader.before_app_loads do
# page cache to the public dir
Merb::Cache.register(:page_store, Merb::Cache::PageStore[Merb::Cache::FileStore], :dir => Merb.root / :public)
# action cache to memcache
Merb::Cache.register(:action_store, Merb::Cache::ActionStore[Merb::Cache::FileStore])
# sets up the ordering of stores when attempting to read/write cache entries
Merb::Cache.register(:default, Merb::Cache::AdhocStore[:page_store, :action_store])
diff --git a/config/routes.rb b/config/routes.rb
index 4e2c9d0..ff64bb7 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -25,7 +25,7 @@ ActionController::Routing::Routes.draw do |map|
# Sample resource route with sub-resources:
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
-
+
module Sequel
class Model
def self.inherited(klass)
klass.extend(WillPaginate::Finders::Sequel)
end
end
end
class Car < Sequel::Model
# extend WillPaginate::Finders::Sequel
require 'rubygems'
require 'sequel'
require 'sequel_polymorphic'
require 'pp'
DB = Sequel.mysql('sequel', :user => 'root', :host => 'localhost')
pp DB.schema
class Asset < Sequel::Model