Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOve error classes to all be under Pickle
- Loading branch information
Showing
5 changed files
with
42 additions
and
54 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 |
---|---|---|
@@ -1,30 +1,39 @@ | ||
require 'active_support' | ||
require 'pickle/version' | ||
require 'pickle/orm_adapter' | ||
require 'pickle/adapter' | ||
require 'pickle/config' | ||
require 'pickle/default_config' | ||
require 'pickle/parser/matchers' | ||
require 'pickle/parser/canonical' | ||
require 'pickle/parser' | ||
require 'pickle/config' | ||
require 'pickle/ref' | ||
require 'pickle/jar' | ||
require 'pickle/store' | ||
require 'pickle/session/conversion' | ||
require 'pickle/session/adapters' | ||
require 'pickle/session/api' | ||
require 'pickle/session' | ||
require 'pickle/session/parser' | ||
require 'pickle/make_matcher' | ||
require 'pickle/dsl' | ||
|
||
# make the parser aware of models in the session (for fields refering to models) | ||
Pickle::Parser.send :include, Pickle::Session::Parser | ||
|
||
# the pickle module acts as a 'mother', holding shared configuration for the duration of execution | ||
# | ||
# In cucumber, the Pickle::Session module is included into the world, which defaults to using | ||
# the (global) Pickle.config | ||
# | ||
# TODO: show how to instantiate multiple pickle mothers | ||
module Pickle | ||
class << self | ||
def config | ||
@config ||= Config.new | ||
end | ||
|
||
def configure(&block) | ||
config.configure(&block) | ||
end | ||
extend self | ||
|
||
def config | ||
@config ||= Pickle::Config.new | ||
end | ||
|
||
def configure(&block) | ||
config.configure(&block) | ||
end | ||
|
||
def parser(options = {}) | ||
@parser ||= Parser.new({:config => config}.merge(options)) | ||
end | ||
def parser | ||
@parser ||= Pickle::Parser.new.tap {|p| p.config = config} | ||
end | ||
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
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
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
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