Skip to content

Instantly share code, notes, and snippets.

DataMapper::Logger.new(STDOUT, :debug)
require 'rails_datamapper'
# Returns model class used by parent side of the relationship
#
# @return [Resource]
# Class of association parent
#
# @api private
def parent_model
@parent_model ||= (@child_model || Object).find_const(parent_model_name)
rescue NameError
raise NameError, "Cannot find the parent_model #{parent_model_name} for #{child_model_name} in #{name}"
def completed?
if subwizard?
all_instances.all? do |instance|
instance.decendants.all? do |decendant|
decendant.completed?
end
end
elsif question?
model && model.valid?
else
require 'rubygems'
require 'sinatra'
require 'lib/dm-appengine/dm-appengine'
require 'dm-core/core_ext/symbol'
require 'models/location'
DataMapper.setup(:default, {
:host => 'localhost',
:adapter => 'appengine'
})
module DateValidations
def self.included(base) # :nodoc:
base.extend ClassMethods
end
module ClassMethods
# Must pass a Proc object with a Range of Date, Time or DateTime.
# The Proc prevents the range from only being evaluated at initialization.
# All 'dates' are converted to Time objects for comparison sake.
$ jruby -S warble
mkdir -p tmp/war/WEB-INF/config
mkdir -p tmp/war/WEB-INF/lib
cp config/warbler.rb tmp/war/WEB-INF/config/warbler.rb
cp lib/appengine-api-1.0-sdk-1.2.0.jar tmp/war/WEB-INF/lib/appengine-api-1.0-sdk-1.2.0.jar
cp lib/jruby-core.jar tmp/war/WEB-INF/lib/jruby-core.jar
cp lib/jruby-rack-0.9.4-SNAPSHOT.jar tmp/war/WEB-INF/lib/jruby-rack-0.9.4-SNAPSHOT.jar
cp lib/ruby-stdlib.jar tmp/war/WEB-INF/lib/ruby-stdlib.jar
cp /Users/mlins/Projects/forks/jruby/lib/ruby/gems/1.8/gems/warbler-0.9.12/lib/jruby-complete-1.1.6.jar tmp/war/WEB-INF/lib/jruby-complete-1.1.6.jar
# Disable automatic framework detection by uncommenting/setting to false
# Warbler.framework_detection = false
# Warbler web application assembly configuration file
Warbler::Config.new do |config|
# Temporary directory where the application is staged
# config.staging_dir = "tmp/war"
# Application directories to be included in the webapp.
config.dirs = %w(lib public views)
@page {
size: letter;
margin-top: 1.75in;
margin-right: 0.25in;
margin-bottom: 0.25in;
margin-left: 0.25in;
@top-center
{
require File.dirname(__FILE__) + '/spec_helper.rb'
APP_ROOT = File.dirname(__FILE__) + "/../tmp"
require 'rubygems'
require 'rubigen'
require 'rubigen/scripts/generate'
describe 'LegacyModelGenerator' do
require 'spec_helper.rb'
describe "Migration" do
before do
@record = mock('record', {:name => 'Pete'})
MyModel = mock('MyModel Class', {:count => 1, :find => [@record]})
require 'my_migration'
@migration = MyMigration.new
end