Module: PostyClient

Defined in:
lib/posty_client.rb,
lib/posty_client/cli.rb,
lib/posty_client/version.rb,
lib/posty_client/settings.rb,
lib/posty_client/resources/user.rb,
lib/posty_client/resources/base.rb,
lib/posty_client/resources/domain.rb,
lib/posty_client/resources/api_key.rb,
lib/posty_client/resources/summary.rb,
lib/posty_client/resources/transport.rb,
lib/posty_client/resources/user_alias.rb,
lib/posty_client/command/user_command.rb,
lib/posty_client/resources/domain_alias.rb,
lib/posty_client/command/domain_command.rb,
lib/posty_client/command/finder_concerns.rb,
lib/posty_client/command/api_key_command.rb,
lib/posty_client/resources/finder_concern.rb,
lib/posty_client/command/transport_command.rb,
lib/posty_client/command/user_alias_command.rb,
lib/posty_client/command/domain_alias_command.rb

Defined Under Namespace

Modules: Command, Resources Classes: CLI, Settings

Constant Summary collapse

VERSION =
"2.0.1"

Class Method Summary collapse

Class Method Details

.envObject


27
28
29
# File 'lib/posty_client.rb', line 27

def self.env
  'development' || ENV['POSTY_ENV']
end

.rootObject


31
32
33
# File 'lib/posty_client.rb', line 31

def self.root
  File.expand_path(File.dirname(__FILE__)+'/../')
end

.settings_fileObject


11
12
13
14
15
16
17
18
19
20
# File 'lib/posty_client.rb', line 11

def self.settings_file
  default_file = File.expand_path('~/.posty_client.yml')

  @settings_file ||= if File.exists?(default_file)
    default_file
  else
    # this is set to make the cli not bark on missing settings
    PostyClient.root + '/config/posty_client.yml.dist'
  end
end

.settings_file=(file_path) ⇒ Object


22
23
24
25
# File 'lib/posty_client.rb', line 22

def self.settings_file=(file_path)
  @settings_file = file_path
  Settings.source(@settings_file)
end