ruby 一组新的rails项目的基本可重用设置/配置。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby 一组新的rails项目的基本可重用设置/配置。相关的知识,希望对你有一定的参考价值。

ActionMailer::Base.delivery_method   = :smtp

ActionMailer::Base.smtp_settings = {  
  :address              => "smtp.mandrillapp.com",  
  :port                 => 587,  
  :domain               => "mandrillapp.com",  
  :user_name            => "apptest@gmail.com",  
  :password             => "VlIXW-1ItA"
}
  
ActionMailer::Base.default_url_options[:host] = Setting.domain
class Logger::SimpleFormatter
  # from activesupport/lib/active_support/core_ext/logger.rb
  def call(severity, time, progname, msg)
    "#{severity_color severity} #{String === msg ? msg : msg.inspect}\n"
  end

private

  def severity_color(severity)
    case severity
    when "WARN"
      "\033[1;33;40m[WARNING]\033[0m" # bold yellow
    when "INFO"
      "\033[1;37;40m[INFO]\033[0m" # bold white
    when "DEBUG"
      "\033[0;34;40m[DEBUG]\033[0m" # blue
    when "ERROR"
      "\033[1;31;40m[ERROR]\033[0m" # bold red
    when "FATAL"
      "\033[7;31;40m[FATAL]\033[0m" # bold black, red bg
    else
      "[#{severity}]" # none
    end
  end
end
# don't generate RSpec tests for views and helpers by default
Rails.application.config.generators do |g|
  g.view_specs false
  g.helper_specs false
  g.stylesheets false
  g.helper false
  g.javascripts false
  g.stylesheet_engine :less
  g.template_engine :haml
  g.test_framework :rspec, fixture: true, view_specs: false
  g.fixture_replacement :factory_girl, dir: "spec/factories"
end
source 'http://rubygems.org'
# source 'http://ruby.taobao.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.1'
# 
# Use postgresql as the database for Active Record
gem 'pg'

# for heroku deployment
ruby '2.0.0'
gem 'rails_12factor', group: :production
# web server on heroku
gem 'puma'

# Front end stuff
gem 'jquery-rails'
# gem 'sass-rails', '~> 4.0.0'
gem 'less-rails'
gem 'html5-rails'
gem 'haml-rails'
gem 'coffee-rails', '~> 4.0.0'
# gem "compass-rails", "~> 2.0.alpha.0"
# gem 'compass-h5bp'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby

gem 'gon', '4.0.2'

# admin interface
gem 'rails_admin'

# global settings
gem "settingslogic", "~> 2.0.6"

# cache client
gem 'dalli'

# fast json rendering
gem 'oj'

gem 'faker'

gem "simple_form", github: "plataformatec/simple_form"

# file upload
gem 'carrierwave'
gem 'fog'
gem 'unf'

# geo functions
gem 'geocoder'

# pagination
gem 'kaminari'

# pretty select box
gem "select2-rails"

# lightbox
gem 'fancybox2-rails', '~> 0.2.4'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

# auth
gem "devise", '3.2.0'
gem "omniauth"
gem "omniauth-instagram"
gem "omniauth-twitter"

# facebook API
gem "koala", "~> 1.7.0rc1"
gem "omniauth-facebook"

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

group :development, :test do 
  gem 'rspec-rails'
  gem "database_cleaner", ">= 1.0.0.RC1"
  gem "rspec-rails"
  gem "email_spec", ">= 1.4.0"
  gem "capybara", :require => false
  gem 'factory_girl_rails'
  gem 'spork', '>= 0.9.0.rc'
end

group :development do
  gem 'mina'
  gem 'thin'
  # gem 'mina-sidekiq', :github => 'Mic92/mina-sidekiq'
  gem 'guard', '~> 2.1.1'
  gem 'guard-rspec'
  gem 'guard-spork'
  gem "guard-bundler"
  gem "guard-livereload"
  gem "guard-jasmine"
  gem "terminal-notifier-guard"
  gem "letter_opener"
  gem 'rb-fsevent', '~> 0.9'

  gem "better_errors", ">= 0.7.2"
  gem "binding_of_caller", ">= 0.7.1"
end

以上是关于ruby 一组新的rails项目的基本可重用设置/配置。的主要内容,如果未能解决你的问题,请参考以下文章

excel2003中一组新的数据怎么覆盖新的数据?求解 不清楚的还可再问

Ruby On Rails,制作可排序列表

Canonical 近日发布了一组新的 Linux 内核安全更新

c# 多线程字典 - 使用一组新的值最佳实践刷新实时字典。创建新的字典,还是逐项重新加载旧的字典? [关闭]

ruby中的作用域和代码块

比较数组中的值并删除 Ruby/Rails 中不同的项目