Sha256: 0347af710c835a87850bf44d7434b4b0bc9abc4de54c122b833f567e2b9c69fb

Contents?: true

Size: 776 Bytes

Versions: 8

Compression:

Stored size: 776 Bytes

Contents

require 'landable/traffic/tracker'
require 'landable/traffic/crawl_tracker'
require 'landable/traffic/ping_tracker'
require 'landable/traffic/scan_tracker'
require 'landable/traffic/scrape_tracker'
require 'landable/traffic/user_tracker'
require 'landable/traffic/noop_tracker'

module Landable
  module Traffic
    def track_with_landable!
      begin
        @tracker = Tracker.for self
        @tracker.track
      rescue => e
        Rails.logger.error e
        if respond_to? :newrelic_notice_error
          newrelic_notice_error e
        end
      end

      yield

      begin
        @tracker.save
      rescue => e
        Rails.logger.error e
        if respond_to? :newrelic_notice_error
          newrelic_notice_error e
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
landable-1.9.2 lib/landable/traffic.rb
landable-1.9.1 lib/landable/traffic.rb
landable-1.9.0 lib/landable/traffic.rb
landable-1.9.0.rc2 lib/landable/traffic.rb
landable-1.9.0.rc1 lib/landable/traffic.rb
landable-1.8.0 lib/landable/traffic.rb
landable-1.7.1.rc1 lib/landable/traffic.rb
landable-1.7.0 lib/landable/traffic.rb