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
>> class DatabaseError < StandardError; end | |
=> nil | |
>> DatabaseError | |
=> DatabaseError | |
>> raise DatabaseError, "Your db is screwed" | |
DatabaseError: Your db is screwed | |
from (irb):4 | |
>> |
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
From 52d5bcc85b0cb1d8a86b471418818bcca27071a6 Mon Sep 17 00:00:00 2001 | |
From: Jack Dempsey <[email protected]> | |
Date: Tue, 16 Sep 2008 18:25:23 -0400 | |
Subject: [PATCH] Add in deep_clone method | |
--- | |
lib/extlib/object.rb | 7 +++++++ | |
1 files changed, 7 insertions(+), 0 deletions(-) | |
diff --git a/lib/extlib/object.rb b/lib/extlib/object.rb |
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
~/testbed $ mkdir shafire_test | |
~/testbed $ cd !$ | |
cd shafire_test | |
~/testbed/shafire_test $ thor merb:edge | |
Cloning thor repository from git://github.com/wycats/thor.git... | |
Initialized empty Git repository in /Users/jack/testbed/shafire_test/src/thor/.git/ | |
remote: Counting objects: 45, done. | |
remote: Compressing objects: 100% (39/39), done. | |
remote: Total 45 (delremote: ta 3), reused 32 (delta 1) |
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
506 merb-gen app abc | |
508 cd abc | |
510 thor merb:tasks:setup | |
514 bin/thor merb:edge --install | |
515 bin/merb | |
517 bin/thor merb:edge:dm_core --install | |
519 ls -l gems/ | |
520 bin/merb -i | |
536 bin/thor merb:edge:dm_more --install | |
538 bin/merb -i |
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
~/testbed $ emacs foo.thor | |
~/testbed $ thor -T | |
Tasks | |
----- | |
foo:hello hello | |
~/testbed $ thor foo:hello | |
hello | |
~/testbed $ cat foo.thor | |
class Foo < Thor | |
desc 'hello', 'hello' |
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
desc 'wipe', 'Uninstall all RubyGems related to Merb' | |
def wipe | |
windows = PLATFORM =~ /win32|cygwin/ rescue nil | |
sudo = windows ? "" : "sudo" | |
`gem list merb`.split("\n").each do |line| | |
next unless line =~ /^(merb[^ ]+)/ | |
system("#{sudo} gem uninstall #{$1} -a -I -x; true") | |
end | |
system("#{sudo} gem uninstall extlib -a -I -x") | |
end |
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
~/testbed/dm_test $ mi | |
~ Loaded DEVELOPMENT Environment... | |
~ loading gem 'merb_datamapper' ... | |
~ loading gem 'dm-core' ... | |
~ Merb::Orms::DataMapper::Connect block. | |
~ No database.yml file found in /Users/jdempsey/testbed/dm_test/config, assuming database connection(s) established in the environment file in /Users/jdempsey/testbed/dm_test/config/environments | |
~ Checking if we need to use DataMapper sessions | |
~ Merb::Orms::DataMapper::Connect complete | |
~ Compiling routes... | |
~ Starting Merb server listening at 0.0.0.0:4000 |
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
~/testbed/dm_test $ rake dm:db:database_yaml | |
(in /Users/jdempsey/testbed/dm_test) | |
/Users/jdempsey/testbed/dm_test/config/init.rb:1: warning: already initialized constant KCODE | |
~ Loaded DEVELOPMENT Environment... | |
~ loading gem 'merb_datamapper' ... | |
~ loading gem 'dm-core' ... | |
~ loading gem 'merb_datamapper' ... | |
~ Merb::Orms::DataMapper::Connect block. | |
~ No database.yml file found in /Users/jdempsey/testbed/dm_test/config, assuming database connection(s) established in the environment file in /Users/jdempsey/testbed/dm_test/config/environments | |
~ Checking if we need to use DataMapper sessions |
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
~/git/src/merb-more/merb-haml (master)$ gd | |
diff --git a/merb-haml/lib/merb-haml.rb b/merb-haml/lib/merb-haml.rb | |
index 88184a6..da89952 100644 | |
--- a/merb-haml/lib/merb-haml.rb | |
+++ b/merb-haml/lib/merb-haml.rb | |
@@ -5,7 +5,7 @@ if defined?(Merb::Plugins) | |
Merb::Plugins.add_rakefiles(File.join(File.dirname(__FILE__) / "merb-haml" / "merbtasks")) | |
Merb::BootLoader.after_app_loads do | |
- if File.directory?(Merb::Config[:sass][:template_location] || Merb.dir_for(:stylesheet) / "sass") |
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
diff --git a/lib/merb-core/controller/mixins/controller.rb b/lib/merb-core/controller/mixi | |
index 8c8078c..0b3c596 100644 | |
--- a/lib/merb-core/controller/mixins/controller.rb | |
+++ b/lib/merb-core/controller/mixins/controller.rb | |
@@ -127,7 +127,9 @@ module Merb | |
def redirect(url, opts = {}) | |
default_redirect_options = { :message => nil, :permanent => false } | |
opts = default_redirect_options.merge(opts) | |
- if opts[:message] | |
+ if opts[:message] || opts[:notice] || opts[:error] |