Class: PostyClient::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/posty_client/cli.rb

Instance Method Summary collapse

Instance Method Details

#create_configObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/posty_client/cli.rb', line 22

def create_config
  require 'fileutils'

  user_config_file = File.expand_path('~/.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

#summaryObject



36
37
38
# File 'lib/posty_client/cli.rb', line 36

def summary
  print_table(PostyClient::Resources::Summary.get)
end

#versionObject



17
18
19
# File 'lib/posty_client/cli.rb', line 17

def version
  puts "version %s" % [PostyClient::VERSION]
end