Class: Bashly::Commands::Base

Inherits:
MisterBin::Command
  • Object
show all
Includes:
AssetHelper
Defined in:
lib/bashly/commands/base.rb

Direct Known Subclasses

Add, Completions, Doc, Generate, Init, Preview, Render, Shell, Validate

Instance Method Summary collapse

Methods included from AssetHelper

#asset, #asset_content

Instance Method Details

#configObject



9
10
11
# File 'lib/bashly/commands/base.rb', line 9

def config
  @config ||= Config.new Settings.config_path
end

#config_validatorObject



13
14
15
# File 'lib/bashly/commands/base.rb', line 13

def config_validator
  @config_validator ||= ConfigValidator.new config
end

#validate_configObject



17
18
19
# File 'lib/bashly/commands/base.rb', line 17

def validate_config
  config_validator.validate
end

#with_valid_configObject



21
22
23
24
# File 'lib/bashly/commands/base.rb', line 21

def with_valid_config
  validate_config
  yield
end