Module: WebistranoCli

Defined in:
lib/webistrano_cli.rb,
lib/webistrano_cli/task.rb,
lib/webistrano_cli/config.rb,
lib/webistrano_cli/models.rb,
lib/webistrano_cli/version.rb

Defined Under Namespace

Classes: Config, Deployment, Project, Stage, Task

Constant Summary collapse

API =
Her::API.new
VERSION =
"0.0.7"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject

Returns the value of attribute logger.



12
13
14
# File 'lib/webistrano_cli.rb', line 12

def logger
  @logger
end

.passObject

Returns the value of attribute pass.



12
13
14
# File 'lib/webistrano_cli.rb', line 12

def pass
  @pass
end

.urlObject

Returns the value of attribute url.



12
13
14
# File 'lib/webistrano_cli.rb', line 12

def url
  @url
end

.userObject

Returns the value of attribute user.



12
13
14
# File 'lib/webistrano_cli.rb', line 12

def user
  @user
end

Class Method Details

.configure(url, user, pass, &block) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/webistrano_cli.rb', line 14

def configure(url, user, pass, &block)
  @url = url; @user = user; @pass = pass
  @logger = ::Logger.new(STDOUT)
  WebistranoCli::API.setup :url => url do |c|
    c.headers['Accept']       = 'application/xml'
    c.headers['Content-Type'] = 'application/xml'
    c.basic_auth user, pass
    c.response :logger if ENV['WCLI_DEBUG']
    c.use HerXmlParser
    c.use HerXMLPost
    c.adapter Faraday.default_adapter

    yield c if block_given?
  end
  require 'webistrano_cli/models'
  require 'webistrano_cli/task'
end

.deploy(opts = {}) ⇒ Object



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

def deploy opts = {}
  Task.new(opts[:project], opts[:stage], opts[:task]).run
end