Skip to content

Instantly share code, notes, and snippets.

View myabc's full-sized avatar

Alexander Brandon Coles myabc

  • London, England
  • 11:01 (UTC +01:00)
View GitHub Profile
package com.test.web.view;
import java.util.Locale;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.view.BeanNameViewResolver;
@myabc
myabc / gist:136982
Created June 27, 2009 11:49 — forked from dkubb/moved.md
#!/usr/bin/env ruby
require 'pathname'
require 'zlib'
# files and extensions to process
FILES = %w[ capfile CHANGELOG LICENSE Manifest MIT-LICENSE README QUICKLINKS README_FOR_APP RUNNING_UNIT_TESTS Rakefile SPECS TODO USAGE .autotest .gitignore .htaccess ].freeze
EXTENSIONS = %w[ builder cgi conf css deploy erb example fcgi feature gemspec haml htc htm html java js jsp key markdown opts php rake ratom rb rcsv rdf rhtml rjs rpdf ru rxml sake sass sh sql thor txt vcf xml yml ].freeze
Pathname.glob(ARGV).each do |path_in|
diff --git a/do_jdbc/src/main/java/data_objects/Connection.java b/do_jdbc/src/main/java/data_objects/Connection.java
index f0ce819..b857a8e 100644
--- a/do_jdbc/src/main/java/data_objects/Connection.java
+++ b/do_jdbc/src/main/java/data_objects/Connection.java
@@ -28,8 +28,7 @@ import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
import data_objects.drivers.DriverDefinition;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
In response to all the responses to:
http://twitter.com/rtomayko/status/1155906157
You should never do this in a source file included with your library,
app, or tests:
require 'rubygems'
The system I use to manage my $LOAD_PATH is not your library/app/tests
* Install JRuby (tested with v.1.2.0 and 1.3.1)
* Install Addresable, Extlib, DataObjects (edge):
jruby -S gem install addressable
git clone git://github.com/datamapper/extlib && cd extlib
git checkout -b next --track origin/next
jruby -S rake install & cd ..
git clone git://github.com/datamapper/do && cd do
@myabc
myabc / gist:192941
Created September 24, 2009 18:36 — forked from dkubb/gist:31187
gem list '\A(?:(?:d[mo])[_-]|data_?(?:mapper|objects)|extlib)' --no-versions \
| xargs sudo gem uninstall -aIx
# To use:
# mkdir _posts
# script/runner migrate_articles_from_mephisto_markdown_files.rb
articles = Article.find(:all)
articles.each do |article|
published_at = "#{article.published_at.year}-#{article.published_at.month}-#{article.published_at.day}" unless article.published_at.nil?
author = article.user.login
permalink = article.permalink
1)
'DataMapper::Collection with sqlserver#slice! with a positive offset and length should scope the Collection' FAILED
expected: [#<Blog::Article @id=8 @title="Sample Article" @content="Article 5" @subtitle=nil @author="Dan Kubb" @original_id=nil>, #<Blog::Article @id=9 @title="Sample Article" @content="Article 6" @subtitle=nil @author="Dan Kubb" @original_id=nil>, #<Blog::Article @id=10 @title="Sample Article" @content="Article 7" @subtitle=nil @author="Dan Kubb" @original_id=nil>, #<Blog::Article @id=11 @title="Sample Article" @content="Article 8" @subtitle=nil @author="Dan Kubb" @original_id=nil>, #<Blog::Article @id=12 @title="Sample Article" @content="Article 9" @subtitle=nil @author="Dan Kubb" @original_id=nil>],
got: [#<Blog::Article @id=2 @title="Sample Article" @content=<not loaded> @subtitle=nil @author="Dan Kubb" @original_id=1>, #<Blog::Article @id=4 @title="Sample Article" @content="Article 1" @subtitle=nil @author="Dan Kubb" @original_id=nil>, #<Blog::Article @id=5 @title="Sample Article" @
# #<Blog::Article @id=-9223372036854775808>
# #<Blog::Article @id=-9223372036854775808>
# id is a:
# Fixnum
# Bignum
1)
'DataMapper::Migrations with sqlserver#auto_migrate Integer property with a min of -9223372036854775808 and a max of 0 should allow the min value -9223372036854775808 to be stored' FAILED
expected no Exception, got #<Spec::Expectations::ExpectationNotMetError:
[alexbcoles@mondiale ~]$ jirb
irb(main):001:0> -9223372036854775808.class
=> Bignum
irb(main):002:0> "-9223372036854775808".to_i
=> -9223372036854775808
irb(main):003:0> "-9223372036854775808".to_i.class
=> Fixnum