Class: Mammoth::Commands::ValidateCommand
- Inherits:
-
Object
- Object
- Mammoth::Commands::ValidateCommand
- Defined in:
- lib/mammoth/commands/validate_command.rb
Overview
Validates a Mammoth configuration through a provider.
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Instance Method Summary collapse
-
#call ⇒ Integer
Process-style status code.
-
#initialize(provider, output: $stdout) ⇒ ValidateCommand
constructor
A new instance of ValidateCommand.
Constructor Details
#initialize(provider, output: $stdout) ⇒ ValidateCommand
Returns a new instance of ValidateCommand.
11 12 13 14 |
# File 'lib/mammoth/commands/validate_command.rb', line 11 def initialize(provider, output: $stdout) @provider = provider @output = output end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
7 8 9 |
# File 'lib/mammoth/commands/validate_command.rb', line 7 def output @output end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
7 8 9 |
# File 'lib/mammoth/commands/validate_command.rb', line 7 def provider @provider end |
Instance Method Details
#call ⇒ Integer
Returns process-style status code.
17 18 19 20 21 |
# File 'lib/mammoth/commands/validate_command.rb', line 17 def call config = provider.load output.puts "Configuration OK: #{config.path}" 0 end |