Skip to content

Instantly share code, notes, and snippets.

@hidenowt
Created September 9, 2011 10:43
Show Gist options
  • Save hidenowt/1205925 to your computer and use it in GitHub Desktop.
Save hidenowt/1205925 to your computer and use it in GitHub Desktop.
[herminio@macbook: ~/Sites/projects/VipeClube (master)]$ cat config/environment.rb
# Be sure to restart your server when you modify this file
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
# Caso esteja no servidor e na pasta do PRE.
raise "Ambiente não suportado, use RAILS_ENV=stage" if File.dirname(__FILE__).include?('pre_abuze') && RAILS_ENV != 'stage'
# Biblioteca de camada de segurança usada para enviar e-mails pelo Google Apps
# require 'smtp_tls'
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Add additional load paths for your own custom dirs
# config.load_paths += %W( #{RAILS_ROOT}/extras )
# Specify gems that this application depends on and have them installed with rake gems:install
# config.gem "bj"
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
# config.gem "sqlite3-ruby", :lib => "sqlite3"
# config.gem "aws-s3", :lib => "aws/s3"
config.gem "fastercsv", :version => "1.5.3"
config.gem "faker"
config.gem "mime-types", :lib => "mime/types", :version => "1.16"
config.gem 'geoip', :version => '0.8.6'
config.gem "paperclip", :version => "2.3.1.1"
config.gem "will_paginate", :version => "2.3.14"
config.gem "authlogic", :version => "2.1.5"
config.gem "gdata", :version => "1.1.1"
config.gem "brazilian-rails", :version => "2.1.13"
config.gem "brdinheiro", :version => "2.1.13"
config.gem "brcep", :version => "2.1.13"
config.gem "brcpfcnpj", :version => "2.1.13"
config.gem "brdata", :version => "2.1.13"
config.gem "brhelper", :version => "2.1.13"
config.gem "brI18n", :version => "2.1.13"
config.gem "brnumeros", :version => "2.1.13"
config.gem "brstring", :version => "2.1.13"
config.gem "spreadsheet", :version => "0.6.4.1"
config.gem "RedCloth"
config.gem "omniauth"
config.gem "redis"
config.gem "oa-enterprise"
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Skip frameworks you're not going to use. To use Rails without a database,
# you must remove the Active Record framework.
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
# Activate observers that should always be running
config.active_record.observers = :invoice_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names.
config.time_zone = 'Brasilia'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
config.i18n.default_locale = "pt-BR"
config.action_controller.resources_path_names = { :new => "novo", :edit => "editar" }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "vipeclube.com.br",
:authentication => :plain,
:enable_starttls_auto => true,
:user_name => "nao-responda@vipeclube.com.br",
:password => "go2go7go9"
}
# Usado para enviar múltiplos arquivos
%w(middleware).each do |dir|
config.load_paths << "#{RAILS_ROOT}/app/#{dir}"
end
# Senha para acessar o loggerd_exception
config.after_initialize do
LoggedExceptionsController.class_eval do
before_filter :authenticate
protected
def authenticate
authenticate_or_request_with_http_basic do |username, password|
username == "admin" && password == "C@r4m1nh0l4S"
end
end
end
end
end
# Para quando o campo tiver erro colocar um span em torno do campo e do label, ao invés de um div que quebra a estrutura
ActionView::Base.field_error_proc = Proc.new { |html_tag, instance| "<span class=\"fieldWithErrors\">#{html_tag}</span>" }
#Constantes
NATIONAL_CITY = 16
DEFAULT_MESSENGER_TOKEN = ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment