Class: Pinspec::Setup::ContextBuilder
- Inherits:
-
Object
- Object
- Pinspec::Setup::ContextBuilder
- Defined in:
- lib/pinspec/setup/context_builder.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(target:, profile:, imports: [], generation: 1, tz: nil) ⇒ ContextBuilder
constructor
A new instance of ContextBuilder.
Constructor Details
#initialize(target:, profile:, imports: [], generation: 1, tz: nil) ⇒ ContextBuilder
Returns a new instance of ContextBuilder.
14 15 16 17 18 19 20 21 |
# File 'lib/pinspec/setup/context_builder.rb', line 14 def initialize(target:, profile:, imports: [], generation: 1, tz: nil) @target = target @profile = profile @imports = imports @generation = generation @tz = tz || Runner::Sandbox::FORCED_ENV.fetch("TZ") @resolver = DependencyResolver.new(profile.schema, profile.factories) end |
Class Method Details
.build(target:, profile:, imports: [], generation: 1, tz: nil) ⇒ Object
9 10 11 |
# File 'lib/pinspec/setup/context_builder.rb', line 9 def build(target:, profile:, imports: [], generation: 1, tz: nil) new(target: target, profile: profile, imports: imports, generation: generation, tz: tz).build end |
Instance Method Details
#build ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/pinspec/setup/context_builder.rb', line 23 def build @steps = [] @bindings = {} @notes = [] @counters = Hash.new(0) @refs = {} refuse_unsupported_tenancy! environment_steps # Imports first: create_record_for skips a table whose ref already exists, so # building factory rows first meant every binding pointed at the factory # record and the sampled row - the whole point of --sample - went unused. import_steps record_steps context_steps subject_step plan end |