Class: PostyClient::CLI
- Inherits:
-
Thor
- Object
- Thor
- PostyClient::CLI
- Defined in:
- lib/posty_client/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
12 13 14 |
# File 'lib/posty_client/cli.rb', line 12 def self.exit_on_failure? true end |
Instance Method Details
#create_config ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/posty_client/cli.rb', line 26 def create_config require 'fileutils' user_config_file = File.('~/.posty_client.yml') if File.exists?(user_config_file) say("File #{user_config_file} already exists! Nothing created.", :red) exit 1 end FileUtils.cp(PostyClient.root + '/config/posty_client.yml.dist', user_config_file) say("File #{user_config_file} created. Please customize.", :green) end |
#summary ⇒ Object
40 41 42 |
# File 'lib/posty_client/cli.rb', line 40 def summary print_table(PostyClient::Resources::Summary.get) end |
#version ⇒ Object
21 22 23 |
# File 'lib/posty_client/cli.rb', line 21 def version puts "version %s" % [PostyClient::VERSION] end |