Sha256: 463dfc47ee18f9d6a114d89be1fa2aa0679aa9b6c29d6f1ad3fdd7adf0e42d3c

Contents?: true

Size: 819 Bytes

Versions: 2

Compression:

Stored size: 819 Bytes

Contents

module NimbleNodes
  
  # returns array of files
  def self.files
    files = %w(dynos report server)
    files.push NimbleNodes.legacy? ? 'filter' : 'middleware'
    files
  end
  
  # returns true if gem is loaded in a pre 2.3 version of rails
  def self.legacy?
    defined?(RAILS_GEM_VERSION) and RAILS_GEM_VERSION.slice(0..2).to_f < 2.3
  end
  
  #= Monitoring
  # pass over the hash containing Rack env variables
  # a Report will be created and posted if neccessary 
  def self.monitor(env)
    report = NimbleNodes::Report.new(env)
    report.post if report.post?
  end
  
  def self.installed?
    not ENV['NN_SERVER_DOMAIN'].nil?
  end
  
  def self.paused?
    not ENV['NN_APP_PAUSED_AT'].nil?
  end
  
end

NimbleNodes.files.each { |file| require File.dirname(__FILE__) + "/nimble_nodes/#{file}" }




  

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nimble_nodes-0.1.9 lib/nimble_nodes.rb
nimble_nodes-0.1.8 lib/nimble_nodes.rb