Sha256: 573b96a675682ea902394422a1db1b7ad3d27f11a278e089d83fd4cffbbd0b60

Contents?: true

Size: 638 Bytes

Versions: 107

Compression:

Stored size: 638 Bytes

Contents

require 'logger'

module Dynomite::Core
  # Ensures trailing slash
  # Useful for appending a './' in front of a path or leaving it alone.
  # Returns: '/path/with/trailing/slash/' or './'
  @@app_root = nil
  def app_root
    return @@app_root if @@app_root
    @@app_root = ENV['APP_ROOT'] || ENV['JETS_ROOT'] || ENV['RAILS_ROOT']
    @@app_root = '.' if @@app_root.nil? || @app_root == ''
    @@app_root = "#{@@app_root}/" unless @@app_root.ends_with?('/')
    @@app_root
  end

  @@logger = nil
  def logger
    return @@logger if @@logger
    @@logger = Logger.new($stderr)
  end

  def logger=(value)
    @@logger = value
  end
end

Version data entries

107 entries across 107 versions & 2 rubygems

Version Path
dynomite-1.2.7 lib/dynomite/core.rb
dynomite-1.2.6 lib/dynomite/core.rb
dynomite-1.2.5 lib/dynomite/core.rb
dynomite-1.2.4 lib/dynomite/core.rb
dynomite-1.2.3 lib/dynomite/core.rb
dynomite-1.2.2 lib/dynomite/core.rb
dynomite-1.2.1 lib/dynomite/core.rb
dynomite-1.2.0 lib/dynomite/core.rb
dynomite-1.1.1 lib/dynomite/core.rb
jets-1.4.10 vendor/dynomite/lib/dynomite/core.rb
dynomite-1.1.0 lib/dynomite/core.rb
jets-1.4.9 vendor/dynomite/lib/dynomite/core.rb
dynomite-1.0.9 lib/dynomite/core.rb
jets-1.4.8 vendor/dynomite/lib/dynomite/core.rb
jets-1.4.7 vendor/dynomite/lib/dynomite/core.rb
jets-1.4.6 vendor/dynomite/lib/dynomite/core.rb
jets-1.4.5 vendor/dynomite/lib/dynomite/core.rb
jets-1.4.4 vendor/dynomite/lib/dynomite/core.rb
jets-1.4.3 vendor/dynomite/lib/dynomite/core.rb
jets-1.4.2 vendor/dynomite/lib/dynomite/core.rb