Permalink
Browse files

Update scripts and configuration for Rails 4.2

  • Loading branch information...
1 parent 1d777fb commit ad793824595964703c0157c3904326579ce8d6e0 @koraktor committed Dec 25, 2014
View
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
-APP_PATH = File.expand_path('../../config/application', __FILE__)
+APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
View
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+require 'pathname'
+
+# path to your application root.
+APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
+
+Dir.chdir APP_ROOT do
+ # This script is a starting point to setup your application.
+ # Add necessary setup steps to this file:
+
+ puts "== Installing dependencies =="
+ system "gem install bundler --conservative"
+ system "bundle check || bundle install"
+
+ # puts "\n== Copying sample files =="
+ # unless File.exist?("config/database.yml")
+ # system "cp config/database.yml.sample config/database.yml"
+ # end
+
+ puts "\n== Preparing database =="
+ system "bin/rake db:setup"
+
+ puts "\n== Removing old logs and tempfiles =="
+ system "rm -f log/*"
+ system "rm -rf tmp/cache"
+
+ puts "\n== Restarting application server =="
+ system "touch tmp/restart.txt"
+end
@@ -13,10 +13,6 @@
module Braumeister
class Application < Rails::Application
- config.assets.enabled = true
- config.assets.initialize_on_precompile = false
- config.assets.version = '1.0'
-
config.encoding = "utf-8"
config.exceptions_app = ->(env) { ApplicationController.action(:error_page).call(env) }
View
@@ -1,6 +1,3 @@
-require 'rubygems'
-
-# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
-require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
+require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -1,5 +1,5 @@
-# Load the rails application
+# Load the Rails application
require File.expand_path('../application', __FILE__)
-# Initialize the rails application
-Braumeister::Application.initialize!
+# Initialize the Rails application
+Rails.application.initialize!
@@ -10,7 +10,6 @@
config.action_dispatch.best_standards_support = :builtin
config.assets.compress = false
-
config.assets.debug = true
config.mongoid.preload_models = false
@@ -12,7 +12,6 @@
config.assets.compress = true
config.assets.compile = false
config.assets.digest = true
- config.assets.precompile += %w{google-analytics.js}
config.i18n.fallbacks = true
@@ -0,0 +1,8 @@
+# Be sure to restart your server when you modify this file.
+
+# Version of your assets, change this if you want to expire all your assets.
+Rails.application.config.assets.version = '1.0'
+
+# Precompile additional assets.
+# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
+Rails.application.config.assets.precompile += %w{google-analytics.js}
View
@@ -3,7 +3,7 @@
#
# Copyright (c) 2012-2014, Sebastian Staudt
-Braumeister::Application.routes.draw do
+Rails.application.routes.draw do
resources :repositories, path: 'repos', only: [],
constraints: { repository_id: /[0-9A-Za-z_-]+?\/[0-9A-Za-z_-]+/ } do

0 comments on commit ad79382

Please sign in to comment.