Commit 6c1a1ec6 authored by Jonne Haß's avatar Jonne Haß

it's enviroNment

parent 9e264b52
......@@ -13,7 +13,7 @@ class PublicsController < ApplicationController
# I am commenting this line out for the time being to debug some apparent
# issues on Heroku.
#
# newrelic_ignore if EnviromentConfiguration.using_new_relic?
# newrelic_ignore if EnvironmentConfiguration.using_new_relic?
skip_before_filter :set_header_data
skip_before_filter :set_grammatical_gender
......
......@@ -3,7 +3,7 @@
# the COPYRIGHT file.
require 'uri'
require Rails.root.join('lib', 'enviroment_configuration')
require Rails.root.join('lib', 'environment_configuration')
class AppConfig < Settingslogic
def self.source_file_name
......@@ -12,7 +12,7 @@ class AppConfig < Settingslogic
return ENV['application_yml']
end
config_file = Rails.root.join("config", "application.yml")
if !File.exists?(config_file) && (Rails.env == 'test' || Rails.env.include?("integration") || EnviromentConfiguration.heroku?)
if !File.exists?(config_file) && (Rails.env == 'test' || Rails.env.include?("integration") || EnvironmentConfiguration.heroku?)
config_file = Rails.root.join("config", "application.yml.example")
end
config_file
......@@ -21,7 +21,7 @@ class AppConfig < Settingslogic
namespace Rails.env
def self.load!
unless EnviromentConfiguration.heroku?
unless EnvironmentConfiguration.heroku?
if no_config_file? && !have_old_config_file?
$stderr.puts <<-HELP
******** You haven't set up your Diaspora settings file. **********
......@@ -57,7 +57,7 @@ Please do the following:
Process.exit(1)
end
if !EnviromentConfiguration.heroku? && no_cert_file_in_prod?
if !EnvironmentConfiguration.heroku? && no_cert_file_in_prod?
$stderr.puts <<-HELP
******** Diaspora does not know where your SSL-CA-Certificates file is. **********
Please add the root certificate bundle (this is operating system specific) to application.yml. Defaults:
......
EnviromentConfiguration.ensure_secret_token!
\ No newline at end of file
EnvironmentConfiguration.ensure_secret_token!
\ No newline at end of file
......@@ -2,7 +2,7 @@
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
if EnviromentConfiguration.enforce_ssl?
if EnvironmentConfiguration.enforce_ssl?
Rails.application.config.middleware.insert_before 0, Rack::SSL
puts "Rack::SSL is enabled"
end
......@@ -3,7 +3,7 @@
# the COPYRIGHT file.
options = {:timeout => 25}
options[:ssl] = {:ca_file => EnviromentConfiguration.ca_cert_file_location}
options[:ssl] = {:ca_file => EnvironmentConfiguration.ca_cert_file_location}
Faraday.default_connection = Faraday::Connection.new(options) do |b|
b.use FaradayMiddleware::FollowRedirects
b.adapter Faraday.default_adapter
......
......@@ -5,7 +5,7 @@ if AppConfig[:featured_users].present? && AppConfig[:community_spotlight].blank?
puts "DEPRICATION WARNING (10/21/11): Please change `featured_users` in your application.yml to `community_spotlight`. Thanks!"
end
unless EnviromentConfiguration.prevent_fetching_community_spotlight?
unless EnvironmentConfiguration.prevent_fetching_community_spotlight?
print "Fetching community spotlight users from remote servers"
AppConfig[:community_spotlight].each do |x|
Webfinger.new(x).fetch
......
# Copyright (c) 2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
#hack to allow us to access app config, rather than putting in enviroments/production.rb
#hack to allow us to access app config, rather than putting in environments/production.rb
if Rails.env == 'production'
Diaspora::Application.configure do
......
......@@ -2,6 +2,6 @@
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
if EnviromentConfiguration.using_new_relic?
if EnvironmentConfiguration.using_new_relic?
require 'newrelic_rpm'
end
......@@ -11,6 +11,6 @@ Rails.application.config.middleware.use OmniAuth::Builder do
end
if SERVICES['facebook'] && SERVICES['facebook']['app_id'] && SERVICES['facebook']['app_secret']
provider :facebook, SERVICES['facebook']['app_id'], SERVICES['facebook']['app_secret'], { :display => "popup", :scope => "publish_actions,publish_stream,offline_access",
:client_options => {:ssl => {:ca_file => EnviromentConfiguration.ca_cert_file_location}}}
:client_options => {:ssl => {:ca_file => EnvironmentConfiguration.ca_cert_file_location}}}
end
end
......@@ -3,7 +3,7 @@
# the COPYRIGHT file.
if EnviromentConfiguration.cache_git_version?
if EnvironmentConfiguration.cache_git_version?
git_cmd = `git log -1 --pretty="format:%H %ci"`
if git_cmd =~ /^([\d\w]+?)\s(.+)$/
AppConfig[:git_revision] = $1
......
......@@ -2,7 +2,7 @@
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
module EnviromentConfiguration
module EnvironmentConfiguration
def self.heroku?
ENV['HEROKU']
......
#we dont have the enviroment, and it is not carring over from the migration
#we dont have the environment, and it is not carring over from the migration
unless defined?(Person)
class Person < ActiveRecord::Base
belongs_to :owner, :class_name => 'User'
......
......@@ -2,7 +2,7 @@
#licensed under the Affero General Public License version 3 or later. See
#the COPYRIGHT file.
require Rails.root.join('lib', 'enviroment_configuration')
require Rails.root.join('lib', 'environment_configuration')
namespace :heroku do
HEROKU_CONFIG_ADD_COMMAND = "heroku config:add"
......
......@@ -7,7 +7,7 @@ class DeferredGarbageCollection
@@last_gc_run = Time.now
def self.start
return if unsupported_enviroment
return if unsupported_environment
GC.disable if DEFERRED_GC_THRESHOLD > 0
end
......@@ -18,7 +18,7 @@ class DeferredGarbageCollection
end
def self.reconsider
return if unsupported_enviroment
return if unsupported_environment
if (percent_used = self.memory_threshold)
running_out_of_memory = percent_used > 90
......@@ -34,7 +34,7 @@ class DeferredGarbageCollection
end
end
def self.unsupported_enviroment
def self.unsupported_environment
ENV['TRAVIS'] # TODO: enable for ruby 1.9.3 or more RAM
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment