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
unless File.exists?('src') | |
puts "Creating merb dir..." | |
FileUtils.mkdir("merb") | |
end | |
FileUtils.cd("src") |
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
Last login: Tue Sep 2 21:05:10 on ttys000 | |
~ $ irb | |
irb(main):001:0> module Foo | |
irb(main):002:1> def self.bar | |
irb(main):003:2> puts 'here in bar' | |
irb(main):004:2> end | |
irb(main):005:1> end | |
=> nil | |
irb(main):006:0> class Bar | |
irb(main):007:1> include Foo |
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 Test < Application | |
# ...and remember, everything returned from an action | |
# goes to the client... | |
def index | |
if true | |
return redirect url(:action => 'foo') | |
else | |
'no go' | |
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
diff --git a/merb_datamapper/lib/merb_datamapper/merbtasks.rb b/merb_datamapper/lib/merb_datamapper/merbtasks.rb | |
index 20452c3..3037d7b 100644 | |
--- a/merb_datamapper/lib/merb_datamapper/merbtasks.rb | |
+++ b/merb_datamapper/lib/merb_datamapper/merbtasks.rb | |
@@ -48,13 +48,17 @@ namespace :dm do | |
desc "Migrate the database to the latest version" | |
task :migrate => 'dm:db:migrate:up' | |
- desc "Create the database (postgres only)" | |
+ desc "Create the database" |
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 Gists < Application | |
provides :json | |
def index | |
@gists = Gist.all | |
display @gists | |
end | |
def show | |
@gist = Gist.get(params[:id]) |
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/thor (constants)$ irb | |
>> require 'thor' | |
=> true | |
>> Thor | |
=> Thor | |
>> Thor.constants | |
=> ["OrderedHash", "Util", "TaskHash", "Options", "Error", "Task"] | |
>> Thor::TaskHash.constants | |
=> ["Node"] | |
>> Thor::TaskHash::Node.constants |
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
>> object = Struct.new(:example) | |
=> #<Class:0x231d3f8> | |
>> object.constants | |
=> ["Group", "Passwd", "Tms"] | |
>> object::Group.constants | |
=> ["Group", "Passwd", "Tms"] | |
>> object::Group::Group.constants | |
=> ["Group", "Passwd", "Tms"] | |
>> |
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
~/.thor $ irb | |
irb(main):001:0> Node = Struct.new(:node) | |
=> Node | |
irb(main):002:0> Node.constants | |
=> ["Tms"] | |
irb(main):003:0> Node::Tms.constants | |
=> ["Tms"] | |
irb(main):004:0> Node::Tms::Tms.constants | |
=> ["Tms"] |
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/local/lib/ruby/gems/1.8/gems $ irb | |
irb(main):001:0> require 'spec/rake/spectask' | |
LoadError: no such file to load -- spec/rake/spectask | |
from (irb):1:in `require' | |
from (irb):1 | |
from :0 | |
irb(main):002:0> require 'rubygems' | |
=> true | |
irb(main):003:0> require 'spec/rake/spectask' | |
=> true |
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/self-deprecated master$ irb | |
irb(main):001:0> class Foo; end | |
=> nil | |
irb(main):002:0> class A < Foo; end | |
=> nil | |
irb(main):003:0> class B; end | |
=> nil | |
irb(main):004:0> class A < B; end | |
TypeError: superclass mismatch for class A | |
from (irb):4 |