To start with you should subclass [Foreman::Export::Base]
and your subclass should exist within the [Foreman::Export]
namespace.
class Foreman::Export::MyRunitExporter < Foreman::Export::Base
end
# implementation at http://gist.github.com/3350 | |
require 'spec_helper' | |
describe HoptoadErrors do | |
describe '.find :all' do | |
before(:each) do | |
@errors = HoptoadErrors.find :all | |
end |
commit 0f2b9f95b905cbebb9573e36f9ff0ef78a0b8024 | |
Author: Chris Lowder <[email protected]> | |
Date: Mon Apr 4 17:46:17 2011 +0100 | |
A failing example | |
diff --git a/.gitignore b/.gitignore | |
new file mode 100644 | |
index 0000000..08a8ac9 | |
--- /dev/null |
# A polymorphic has_many :through relationship in Rails 2.3 | |
# based on Josh Susser's "The other side of polymorphic :through associations" | |
# http://blog.hasmanythrough.com/2006/4/3/polymorphic-through | |
class Authorship < ActiveRecord::Base | |
belongs_to :author | |
belongs_to :publication, :polymorphic => true | |
end | |
class Author < ActiveRecord::Base | |
has_many :authorships |
:redis: redis://172.25.13.95:6379 |
createuser --password USERNAME | |
createdb --owner=USERNAME DATABASE_NAME |
Gem::Specification.new do |gem| | |
gem.name = '' | |
gem.version = '' | |
gem.date = Date.today.to_s | |
# gem.add_dependency 'hpricot', '~> 0.8.2' | |
# gem.add_development_dependency 'rspec', '~> 1.2.9' | |
gem.summary = "" | |
gem.description = "" |
To start with you should subclass [Foreman::Export::Base]
and your subclass should exist within the [Foreman::Export]
namespace.
class Foreman::Export::MyRunitExporter < Foreman::Export::Base
end
static void i_fail(VALUE self) | |
{ | |
rb_raise(rb_eRuntimeError, "Oh knowz!"); | |
} | |
static void rescue(VALUE self, VALUE exception) | |
{ | |
/* This function _is not_ in <ruby.h> | |
* http://clalance.blogspot.co.uk/2011/01/writing-ruby-extensions-in-c-part-5.html | |
*/ |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
# Note that this *will not load your Rails configuration* which means things like | |
# mass assignment protection by default, etc. will not be set. | |
require "active_record" | |
ActiveRecord::Base.configurations = YAML.load_file(File.expand_path("../../config/database.yml", __FILE__)) | |
ActiveRecord::Base.establish_connection("test") | |
# Stick your ActiveRecord junk (i.e. extensions) here | |
require "database_cleaner" |