Skip to content

Instantly share code, notes, and snippets.

View moretea's full-sized avatar

Maarten Hoogendoorn moretea

View GitHub Profile
if Rails.env != "development"
c.send :rescue_from, ActiveRecord::RecordNotFound,
ActionController::UnknownAction,
ActionView::MissingTemplate,
:with => :error_404
end
#!/usr/bin/env ruby
require 'rubygems'
require 'socket'
require 'octopi'
include Octopi
COMPETITORS = {
'refinery' => "resolve/refinerycms",
'radiant' => "radiant/radiant",
# In a engine
class Engine < Rails::Engine
config.after_initialize do
Page.send(:include, PageClassMethods)
end
end
class CommonModel < ActiveRecord::Base
self.abstract_class = true
establish_connection "common#{Rails.env}"
end
$ rm *.class; jrubyc Meh.rb ; java Meh
Compiling Meh.rb to class Meh
Exception in thread "main" java.lang.NoClassDefFoundError: Meh
Caused by: java.lang.ClassNotFoundException: Meh
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
$ javap Meh
Compiled from "Meh.rb"
public class Meh extends org.jruby.ast.executable.AbstractScript{
public Meh();
public static org.jruby.runtime.builtin.IRubyObject __file__(Meh, org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.builtin.IRubyObject[], org.jruby.runtime.Block);
public org.jruby.runtime.builtin.IRubyObject __file__(org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.builtin.IRubyObject[], org.jruby.runtime.Block);
public static org.jruby.runtime.builtin.IRubyObject class_0$RUBY$Meh(Meh, org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.Block);
public static org.jruby.runtime.builtin.IRubyObject method__1$RUBY$main(Meh, org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.Block);
public static org.jruby.runtime.builtin.IRubyObject method__1$RUBY$main(Meh, org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRub
maarten@maarten-laptop:~/Projects/obk/obk-driebruggen.nl$ ~/Projects/refinerycms/bin/refinerycms . --update
Running: rails new "/home/maarten/Projects/obk/obk-driebruggen.nl" --force --database sqlite3 --skip-active-record --skip-gemfile --skip-git --skip-javascript --skip-prototype --skip-test-unit
Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first.
Type 'rails' for help.
---------
Refinery successfully installed in '/home/maarten/Projects/obk/obk-driebruggen.nl'!
Installing gem requirements using bundler..
Running: cd "/home/maarten/Projects/obk/obk-driebruggen.nl" && bundle install
@moretea
moretea / New Gemfile
Created January 12, 2011 00:05
Gemfile diff
source 'http://rubygems.org'
gem 'rails', '3.0.3'
gem 'mysql'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'capistrano'
Feature: Manage regattas
In order to use be able to have a regatta
users
wants to create regatta's
Scenario: Register new regatta
Given I am on the regatta's new page
And I fill in "regatta_name" with "My Regatta"
When I press "Create"
Then a regatta should exist with name: "My Regatta"
require 'refinery'
module Refinery
module PageLayouts
class Engine < Rails::Engine
initializer "static assets" do |app|
app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
end
config.after_initialize do