Class: Reviewer::Session
- Inherits:
-
Object
- Object
- Reviewer::Session
- Defined in:
- lib/reviewer/session.rb,
lib/reviewer/session/formatter.rb
Overview
Run lifecycle with full dependency injection. Owns the review/format lifecycle that was previously in Reviewer module methods.
Defined Under Namespace
Classes: Formatter
Instance Method Summary collapse
-
#format ⇒ Integer
Runs the format command for the current set of tools.
-
#initialize(context:, tools:) ⇒ Session
constructor
Creates a session with all dependencies injected.
-
#review ⇒ Integer
Runs the review command for the current set of tools.
Constructor Details
#initialize(context:, tools:) ⇒ Session
Creates a session with all dependencies injected
17 18 19 20 21 |
# File 'lib/reviewer/session.rb', line 17 def initialize(context:, tools:) @context = context @tools = tools context.arguments.keywords.tools = tools end |
Instance Method Details
#format ⇒ Integer
Runs the format command for the current set of tools
33 34 35 |
# File 'lib/reviewer/session.rb', line 33 def format run_tools(:format) end |
#review ⇒ Integer
Runs the review command for the current set of tools
26 27 28 |
# File 'lib/reviewer/session.rb', line 26 def review run_tools(:review) end |