Skip to content

Commit

Permalink
-- Version 0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hutch committed Dec 27, 2009
1 parent ddcc0ef commit cd2c3f6
Show file tree
Hide file tree
Showing 71 changed files with 15,999 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .document
@@ -0,0 +1,5 @@
README.md
lib/**/*.rb
bin/*
features/**/*.feature
LICENSE
21 changes: 21 additions & 0 deletions .gitignore
@@ -0,0 +1,21 @@
## MAC OS
.DS_Store

## TEXTMATE
*.tmproj
tmtags

## EMACS
*~
\#*
.\#*

## VIM
*.swp

## PROJECT::GENERAL
coverage
rdoc
pkg

## PROJECT::SPECIFIC
619 changes: 619 additions & 0 deletions COPYING

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions LICENSE
@@ -0,0 +1,4 @@
Copyright (c) 2009 Bob Hutchison

see COPYING for licence details

11 changes: 11 additions & 0 deletions Makefile
@@ -0,0 +1,11 @@

check:
git clean -dx --dry-run

clean:
git clean -fdx
ln -s ../dot.idea .idea

release:
rake version:bump:patch release

3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -2,3 +2,6 @@ xamplr-gen

*place holder readme*

== Copyright

Copyright (c) 2009 Bob Hutchison. See LICENSE for details.
64 changes: 64 additions & 0 deletions Rakefile
@@ -0,0 +1,64 @@
require 'rubygems'
require 'rake'

begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "xamplr-gen"
gem.summary = %Q{TODO: one-line summary of your gem}
gem.description = %Q{TODO: longer description of your gem}
gem.email = "hutch@xampl.com"
gem.homepage = "http://github.com/hutch/xamplr-gen"
gem.authors = ["Bob Hutchison"]
gem.add_development_dependency "cucumber", ">= 0"
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end

require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end

begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
test.libs << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
rescue LoadError
task :rcov do
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
end
end

task :test => :check_dependencies

begin
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)

task :features => :check_dependencies
rescue LoadError
task :features do
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
end
end

task :default => :test

require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "xamplr-gen #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
1 change: 1 addition & 0 deletions VERSION
@@ -0,0 +1 @@
0.0.0
17 changes: 17 additions & 0 deletions bin/xampl-gen
@@ -0,0 +1,17 @@
#!/usr/bin/env ruby
#!/usr/bin/env ruby -w -I..

require 'xamplr-generator'
require 'xamplr/xampl-cl-gen'

include XamplGenerator
include Xampl

project_specialisations = File.join(%w{ . project-generator.rb })
if File.exists?(project_specialisations) then
load project_specialisations
end

generator = ProjectGenerator.new
generator.generate

Empty file.
6 changes: 6 additions & 0 deletions features/support/env.rb
@@ -0,0 +1,6 @@
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
require 'xamplr-gen'

require 'test/unit/assertions'

World(Test::Unit::Assertions)
9 changes: 9 additions & 0 deletions features/xamplr-gen.feature
@@ -0,0 +1,9 @@
Feature: something something
In order to something something
A user something something
something something something

Scenario: something something
Given inspiration
When I create a sweet new gem
Then everyone should see how awesome I am
12 changes: 12 additions & 0 deletions lib/xamplr-gen.rb
@@ -0,0 +1,12 @@

require 'xamplr'
require 'xamplr-pp'

require 'xamplr-gen/xampl-generator'

#module Xampl
#
#
#end


1 change: 1 addition & 0 deletions lib/xamplr-gen/.cvsignore
@@ -0,0 +1 @@
.cvs.log
120 changes: 120 additions & 0 deletions lib/xamplr-gen/exceptions.rb
@@ -0,0 +1,120 @@
module Xampl

class XamplIsInvalid < Exception
attr_reader :msg, :xampl

def initialize(xampl)
@xampl = xampl
@msg = "Invalid Xampl:: #{xampl}"
end

def message
@msg
end
end

class AlreadyKnownToPersister < Exception
attr_reader :msg, :xampl

def initialize(xampl, persister)
@xampl = xampl
@msg = "#{xampl} #{xampl.get_the_index} is already known by a persister: #{xampl.persister.name}, so cannot use persister #{persister.name}"
end

def message
@msg
end
end

class XamplException < Exception
attr_reader :name, :msg

def initialize(name, message=nil)
@name = name
@msg = message ? message : ""
end

def message
"XamplException #{@name} #{@msg}"
end
end

class NoActivePersister < Exception
def message
"No Persister is active"
end
end

class BlockedChange < Exception
attr_reader :xampl

def initialize(xampl=nil)
@xampl = xampl
end

def message
"attempt to change #{@xampl}, pid: #{@xampl.get_the_index}, oid: #{@xampl.object_id} when changes are blocked"
end
end

class ReturnOrThrowInTransaction < Exception
attr_reader :xampl

def initialize(xampl=nil)
@xampl = xampl
end

def message
"attempt to change #{@xampl}, pid: #{@xampl.get_the_index}, oid: #{@xampl.object_id} when changes are blocked"
end
end

class UnmanagedChange < Exception
attr_reader :xampl

def initialize(xampl=nil)
@xampl = xampl
end

def message
"attempt to change #{@xampl}, pid: #{@xampl.get_the_index}, oid: #{@xampl.object_id} outside of its persister's management"
end
end

class IncompatiblePersisterRequest < Exception
attr_reader :msg

def initialize(persister, feature_name, requested_feature_value, actual_feature_value)
@msg = "persister #{persister.name}:: requested feature: #{feature_name} #{requested_feature_value}, actual: #{actual_feature_value}"
end

def message
@msg
end
end

class IncompatiblePersisterConfiguration < Exception
attr_reader :msg

def initialize(persister_kind, feature_name)
@msg = "persister kind #{persister_kind}:: requested feature: #{feature_name}"
end

def message
@msg
end
end

class MixedPersisters < Exception
attr_reader :msg

def initialize(active, local)
@msg = "mixed persisters:: active #{active.name}, local: #{local.name}"
end

def message
@msg
end
end

end

0 comments on commit cd2c3f6

Please sign in to comment.