Skip to content

Instantly share code, notes, and snippets.

View myabc's full-sized avatar

Alexander Brandon Coles myabc

View GitHub Profile
source :rubygems
# Specify the database driver
gem 'mysql'
#gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'rails', '~> 2.3.5'
gem 'highline', '1.5.1'
gem 'authlogic', '2.1.3'
gem 'authlogic-oid', '1.0.4', :require => 'authlogic_openid'
diff --git a/config/boot.rb b/config/boot.rb
index 81d20d9..f1a1c10 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -157,5 +157,19 @@ module Spree
end
end
+class Spree::Boot
+ def run
~ (0.034) DROP TABLE IF EXISTS `posts`
~ (0.015) com.mysql.jdbc.PreparedStatement@15ede11: SHOW TABLES LIKE 'posts'
~ (0.001) com.mysql.jdbc.PreparedStatement@3d511e: SHOW VARIABLES LIKE 'character_set_connection'
~ (0.001) com.mysql.jdbc.PreparedStatement@d41f3: SHOW VARIABLES LIKE 'collation_connection'
~ (0.771) CREATE TABLE `posts` (`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `title` VARCHAR(50), `body` TEXT, `created_at` DATE, PRIMARY KEY(`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
~ (0.024) INSERT INTO `posts` (`title`, `body`, `created_at`) VALUES ('foo', 'adngksbfsf kvbsdfblsf vksfbkvbsf', '2010-04-24')
~ (0.016) INSERT INTO `posts` (`title`, `body`, `created_at`) VALUES ('foo', 'adngksbfsf kvbsdfblsf vksfbkvbsf', '2010-04-23')
~ (0.009) INSERT INTO `posts` (`title`, `body`, `created_at`) VALUES ('foo', 'adngksbfsf kvbsdfblsf vksfbkvbsf', '2010-04-22')
~ (0.002) INSERT INTO `posts` (`title`, `body`, `created_at`) VALUES ('foo', 'adngksbfsf kvbsdfblsf vksfbkvbsf', '201

Software Shitlist

Software so bad it really shouldn't be tolerated.

  • Microsoft Powerpoint
  • Expression Engine
  • Anything written with Adobe AIR
require 'rubygems'
require 'dm-core'
DataMapper::Logger.new(STDOUT, :debug)
DataMapper.setup(:default, 'mysql://root:@localhost/test')
DataMapper.setup(:logs, "sqlite3:///tmp/test.db")
class LoggedEvent
include DataMapper::Resource
From b50ff2f453ec40b7e701ec55b08ee5dddffd8c89 Mon Sep 17 00:00:00 2001
From: Alex Coles <alex@alexcolesportfolio.com>
Date: Fri, 26 Feb 2010 16:53:21 +0100
Subject: [PATCH] Rename metaclass to singleton_class
* Reflects rename in commit f863045 in rails/rails (made with no
explanation in commit message, but presumably for good reason).
Signed-off-by: Alex Coles <alex@alexcolesportfolio.com>
---
DataMapper::Resource.module_eval do
def has_attribute?(attribute)
attributes.include?(attribute)
end
end
$LOAD_PATH << 'data_objects/lib'
$LOAD_PATH << 'do_sqlite3/lib'
require "rubygems"
require "dm-core"
#require "dm-validations"
require "spec"
DataMapper::Logger.new(STDOUT, :debug)
DataMapper.setup(:default, 'sqlite3:database')
+ %w{files extra_rdoc_files test_files}.each do |accessor|
+ spec.send(accessor).instance_eval { @exclude_procs = Array.new }
+ end
[alexbcoles@mondiale git-repos]$ jruby -S rails -m rails-templates/datamapper.rb recipes-sample-app2
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db