Skip to content

Instantly share code, notes, and snippets.

require 'pathname'
require 'rubygems'
require 'slf4r/ruby_logger'
gem 'data_objects' , "0.9.11"
require 'dm-core'
# $LOAD_PATH << Pathname(__FILE__).dirname.parent.expand_path + 'lib'
require 'ldap_resource'
require 'dummy_ldap_resource'
require 'pathname'
require 'rubygems'
require 'slf4r/ruby_logger'
gem 'data_objects' , "0.9.11"
require 'dm-core'
require 'ldap_resource'
dummy = true #uncomment this to use dummy, i.e. a database instead of ldap
dummy = false # uncomment this to use ldap
if RUBY_PLATFORM =~ /java/
module DataMapper
module Validate
class NumericValidator
def validate_with_comparison(value, cmp, expected, error_message_name, errors, negated = false)
return if expected.nil?
if cmp == :=~
return value =~ expected
end
require 'rubygems'
require 'dm-core'
require 'date'
class Name
include DataMapper::Resource
property :id, Serial
require 'rubygems'
require 'dm-core'
require 'dm-serializer'
module X
class Name
include DataMapper::Resource
property :id, Serial
package net.abhinavsarkar.util;
import java.util.Iterator;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
java.lang.IllegalArgumentException: Invalid format: "2009-11-28 13:47:42" is malformed at " 13:47:42"
at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:673)
at do_sqlite3.Sqlite3DriverDefinition.toTimestamp(Sqlite3DriverDefinition.java:62)
at do_sqlite3.Sqlite3DriverDefinition.getTypecastResultSetValue(Sqlite3DriverDefinition.java:102)
at data_objects.Reader.next(Reader.java:129)
at data_objects.Reader$i_method_0_0$RUBYINVOKER$next.call(data_objects/Reader$i_method_0_0$RUBYINVOKER$next.gen)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:290)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:109)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
at org.jruby.ast.WhileNode.interpret(WhileNode.java:127)
require 'rubygems'
require 'dm-core'
require 'dm-validations'
class Role
include DataMapper::Resource
property :id, Serial
property :name, String, :allow_nil => false
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>shitty</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
require 'rubygems'
require 'dm-core'
require 'do_sqlite3'
DataMapper.setup(:default, "sqlite3:memory:")
class Name
include DataMapper::Resource
property :name, String, :key => true