Sha256: 3b0833ad01cbbbd7fa2a47dc1fcb6281b518a06a609c581ecabcb6feb34a7618

Contents?: true

Size: 763 Bytes

Versions: 2

Compression:

Stored size: 763 Bytes

Contents

# should be able to move these to more appropriate places
WAGN_GEM_ROOT = File.expand_path('../..', __FILE__)

module Wagn

  class << self    
    def root
      Rails.root
    end
  
    def application
      Rails.application
    end
    
    def config
      application.config
    end
    
    def paths
      application.paths
    end
    
    def gem_root
      WAGN_GEM_ROOT
    end
    
    def with_logging method, opts, &block
      if Wagn::Log::Performance.enabled_method? method
        Wagn::Log::Performance.with_timer(method, opts) do
          block.call
        end
      else
        block.call
      end
    end
    
    
    def future_stamp
      ## used in test data
      @@future_stamp ||= Time.local 2020,1,1,0,0,0
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wagn-1.14.9 lib/wagn.rb
wagn-1.14.8 lib/wagn.rb