Class: WssAgent::CLI
- Inherits:
-
Thor
- Object
- Thor
- WssAgent::CLI
- Defined in:
- lib/wss_agent/cli.rb
Instance Method Summary collapse
Instance Method Details
#check_policies ⇒ Object
45 46 47 48 49 |
# File 'lib/wss_agent/cli.rb', line 45 def check_policies WssAgent.enable_debug! if ['verbose'] result = Specifications.check_policies() (result.success? && result.policy_violations?) ? exit(1) : exit(0) end |
#config ⇒ Object
4 5 6 7 8 9 |
# File 'lib/wss_agent/cli.rb', line 4 def config File.open(File.join(Dir.pwd, Configure::CURRENT_CONFIG_FILE), 'w') do |f| f << File.read(Configure.custom_default_path) end ap 'Created the config file: wss_agent.yml' end |
#list ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/wss_agent/cli.rb', line 16 def list WssAgent.enable_debug! if ['verbose'] results = Specifications.list() ap results rescue Bundler::GemfileNotFound => ex ap ex., color: { string: :red } rescue Bundler::GemNotFound => ex ap ex., color: { string: :red } ap "Could you execute 'bundle install' before", color: { string: :red } end |
#update ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/wss_agent/cli.rb', line 33 def update WssAgent.enable_debug! if ['verbose'] result = Specifications.update() result.success? ? exit(0) : exit(1) rescue => ex ap ex., color: { string: :red } abort end |