Skip to content

Instantly share code, notes, and snippets.

source 'http://gemcutter.org'
gem 'mysql', '2.8.1'
# gem 'tmail', '1.2.6' #dependency of rails, not caught by bundler
gem 'rails', '2.3.5'
gem 'capistrano', '2.5.14'
gem 'youtube-g', '0.5.0', :require => 'youtube_g'
gem 'i18n', '0.3.3'
def self.translate_route(route, route_name = nil)
new_routes = []
new_named_routes = {}
# if root_route?(route) && prefix_on_default_locale
# add the root route "as is" in addition to the translated versions
new_routes << route
new_named_routes[route_name] = route
# end
diff --git a/Gemfile b/Gemfile
index e69de29..4da2bc8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -0,0 +1,43 @@
+source 'http://gemcutter.org'
+
+gem 'builder', '2.1.2'
+gem 'mysql', '2.8.1'
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<rails>, [">= 2.2"])
else
s.add_dependency(%q<rails>, [">= 2.2"])
end
else
s.add_dependency(%q<rails>, [">= 2.2"])
end
Cucumber::Rake::Task.new(:rcov) do |t|
t.rcov = true
t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/}
t.rcov_opts << %[-o "features_rcov"]
end
When /^(\d+) (minutes|hours|days) pass$/ do |amount, unit|
now = Time.now
Time.stubs(:now).returns(now + amount.to_i.send(unit.to_sym))
end
When /^going back (\d+) (minutes|hours|days)$/ do |minutes|
now = Time.now
Time.stubs(:now).returns(now - amount.to_i.send(unit.to_sym))
end
@shageman
shageman / leak.rb
Created January 13, 2011 17:54
Memory (and classes) leak in neo4jrb
#!/usr/bin/env ruby -J-Xmn512m -J-Xms2048m -J-Xmx2048m
# Profile these different versions (e.g. with VisualVM)
# jruby 1.5.6: watch the number of classes rise with every iteration. Eventually PermGen space will be exhausted.
# jruby 1.6.0.rc1: the classes get garbage collected regularly.
require "rubygems"
require 'neo4j' #1.0.0.beta.26
class Node
@shageman
shageman / reader.rb
Created March 1, 2011 19:53
Files for example regarding data writer + reader to test concurrency of neo4j access through neo4j gem (http://wiki.neo4j.org/content/Getting_Started_With_Ruby)
require "rubygems"
require "neo4j"
#domain model
class Waypoint
include Neo4j::NodeMixin
#the persistent properties of this class
property :name, :lon, :lat
#friend relationships to other persons
has_n :roads
@shageman
shageman / Gemfile
Created March 9, 2011 16:11
Performance comparison MySQL and Neo4j
source "http://rubygems.org"
gem 'neography'
gem 'activesupport', '~>2.3.4', :require => 'active_support'
gem 'i18n'
group :test do
gem 'test-unit', :require => 'test/unit'
gem 'minitest'
gem 'dm-core'
import javax.ws.rs.DELETE;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Transaction;
import org.neo4j.server.NeoServer;