Sha256: 63b02ba2ec79668959c1df6f9a47383286793079a5f5a520ad125313840b237f

Contents?: true

Size: 893 Bytes

Versions: 4

Compression:

Stored size: 893 Bytes

Contents

require 'uri'
require 'socket'
require 'net/http'
require 'fileutils'

[
  'version',
  'engine',
  'error',
  'response',
  'api'
].each{ |f| require "woopra_rails/#{f}" }

module WoopraRails
  @endpoint     = 'http://www.woopra.com/track/ce/'
  @dryrun       = false
  @config       = {}
  @env          = "development"
  @session      = ""

  class << self
    def config=(config)
      @config = config
    end

    def get_env_config
      @env = ::Rails.env if defined? Rails
      set_base
    end

    def init
      begin
        get_env_config
      rescue Exception => e
        puts("Error on init: #{e.message}")
      end
    end

    def set_base
      @base_params = "#{@endpoint}?host=#{account}&response=json&cookie=#{@session}&timeout=300000"
    end

    def dryrun
      return @config["dryrun"] == true
    end

    def account
      @config["account"]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
woopra_rails-1.0.10 lib/woopra_rails.rb
woopra_rails-1.0.9 lib/woopra_rails.rb
woopra_rails-1.0.8 lib/woopra_rails.rb
woopra_rails-1.0.7 lib/woopra_rails.rb