Module: StackAgent

Defined in:
lib/stack-agent.rb,
lib/stack-agent/cli.rb,
lib/stack-agent/instance.rb,
lib/stack-agent/configuration.rb

Defined Under Namespace

Classes: Cli, Configuration, Instance

Constant Summary collapse

VERSION =
'0.1.3'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject



11
12
13
# File 'lib/stack-agent.rb', line 11

def self.configuration
  @configuration ||= StackAgent::Configuration.new
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



19
20
21
# File 'lib/stack-agent.rb', line 19

def self.configure
  yield(configuration)
end

.connect!Object



33
34
35
36
37
38
39
# File 'lib/stack-agent.rb', line 33

def self.connect!
  register

  at_exit do
    unregister
  end
end

.registerObject



23
24
25
26
# File 'lib/stack-agent.rb', line 23

def self.register
  @instance = StackAgent::Instance.new
  puts "Registered Stack #{@instance.instance_token}" if @instance.register
end

.resetObject



15
16
17
# File 'lib/stack-agent.rb', line 15

def self.reset
  @configuration = StackAgent::Configuration.new
end

.unregisterObject



28
29
30
31
# File 'lib/stack-agent.rb', line 28

def self.unregister
  return false unless @instance
  puts "Unregistered Stack #{@instance.instance_token}" if @instance.unregister
end