Sha256: f27bca06743059deb63c99263e5a6836c5dc7ef272e19e8f37b4402fdcf0e562

Contents?: true

Size: 642 Bytes

Versions: 5

Compression:

Stored size: 642 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'daemons'
require 'logger'
require File.dirname(__FILE__) + '/../lib/heartbeat-client'

begin
  puts "Using config in your home directory"
  @config = YAML.load(File.read("#{ENV['HOME']}/.heartbeat-client.yml"))
rescue Errno::ENOENT
  raise "heartbeat-client.yml expected in ~/.heartbeat-client.yml"
end

unless @config['apikey']
  puts "API Key not found!"
  exit
end

if ARGV and ARGV.size == 1
  Daemons.run_proc('heartbeat-client.rb') do
    loop do
      Heartbeat.create(@config['apikey'])
      sleep(30)
    end
  end
else
  puts "Please provide a command to hbc (start|stop|run)!"
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
heartbeat-client-0.2.4 bin/hbc
heartbeat-client-0.2.3 bin/hbc
heartbeat-client-0.2.2 bin/hbc
heartbeat-client-0.2.1 bin/hbc
heartbeat-client-0.2.0 bin/hbc