Class: Capricorn::CLI::Deployer

Inherits:
Capricorn::CLI show all
Includes:
Helpers
Defined in:
lib/capricorn-client/cli/deployer.rb

Constant Summary

Constants included from Helpers

Helpers::DEFAULT_CONFIG

Instance Method Summary collapse

Methods included from Helpers

#application, #application_ids, #application_info, #applications, #client, #cluster, #config, #environment, #halt, #info, #local_config, #machine, #machines, #node, #nodes

Methods inherited from Capricorn::CLI

banner, #help, #method_missing, start

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Capricorn::CLI

Instance Method Details

#version(version = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/capricorn-client/cli/deployer.rb', line 7

def version(version=nil)
  gem = nil
  if version
    gem = Dir.glob("pkg/*-#{version}.gem").last
  else
    gem = Dir.glob("pkg/*.gem").sort do |a, b|
      File.stat(a).mtime <=> File.stat(b).mtime
    end.last
  end

  unless gem
    halt "Please build a gem first!"
  end

  $capr_gems_weak_push = true

  invoke "gems:push", [gem]
  invoke "apps:fupdate"
end