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 "Creates a static copy of your site by iterating your thingies." | |
| task :make_static do | |
| static_dir = File.join(File.dirname(__FILE__), 'static') | |
| Dir.mkdir(static_dir) unless File.directory?(static_dir) | |
| require 'sinatra' | |
| Sinatra::Application.default_options.merge!( | |
| :run => false, | |
| :env => :production, | |
| :views => File.dirname(__FILE__) + "/views" |
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 Child | |
| belongs_to :master, :polymorphic => true | |
| end | |
| class HumanParent | |
| has_many :organs | |
| end | |
| class RobotOverlord | |
| has_many :spark_plugs |
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 'dm-core' | |
| require 'dm-is-versioned' | |
| require 'dm-timestamps' | |
| DataMapper.setup(:default, 'mysql://localhost/my_db') | |
| class Article | |
| include DataMapper::Resource | |
| property :id, Integer, :serial => 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
| # what is going on with Hash.new([])? | |
| lines = [ | |
| [1,2], | |
| [3,4], | |
| [5,6], | |
| [5,6.5], | |
| [7,8] | |
| ] | |
NewerOlder