Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
71 changed files
with
15,999 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
README.md | ||
lib/**/*.rb | ||
bin/* | ||
features/**/*.feature | ||
LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## MAC OS | ||
.DS_Store | ||
|
||
## TEXTMATE | ||
*.tmproj | ||
tmtags | ||
|
||
## EMACS | ||
*~ | ||
\#* | ||
.\#* | ||
|
||
## VIM | ||
*.swp | ||
|
||
## PROJECT::GENERAL | ||
coverage | ||
rdoc | ||
pkg | ||
|
||
## PROJECT::SPECIFIC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Copyright (c) 2009 Bob Hutchison | ||
|
||
see COPYING for licence details | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ xamplr-gen | |
|
||
*place holder readme* | ||
|
||
== Copyright | ||
|
||
Copyright (c) 2009 Bob Hutchison. See LICENSE for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib') | ||
require 'xamplr-gen' | ||
|
||
require 'test/unit/assertions' | ||
|
||
World(Test::Unit::Assertions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
require 'xamplr' | ||
require 'xamplr-pp' | ||
|
||
require 'xamplr-gen/xampl-generator' | ||
|
||
#module Xampl | ||
# | ||
# | ||
#end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.cvs.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.