Skip to content

Commit

Permalink
Standardize how we're requiring config/environment
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahmei committed Jan 23, 2011
1 parent c960985 commit 0b39359
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/tasks/batch_inviter.rake
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ namespace :invites do
end


require File.dirname(__FILE__) + '/../../config/environment'
require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')

filename = args[:filename]
start = args[:start].to_i || 0
number_of_backers = args[:number] || 1000
Expand Down
6 changes: 3 additions & 3 deletions lib/tasks/db.rake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace :db do

desc 'Delete the collections in the current RAILS_ENV database'
task :purge do
require File.dirname(__FILE__) + '/../../config/environment'
require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')

puts "Purging the database for #{Rails.env}..."

Expand Down Expand Up @@ -78,7 +78,7 @@ namespace :db do

task :fix_diaspora_handle do
puts "fixing the people in this seed"
require File.dirname(__FILE__) + '/../../config/environment'
require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')
Person.where(:url => 'example.org').all.each{|person|
if person.owner
person.url = AppConfig[:pod_url]
Expand All @@ -90,7 +90,7 @@ namespace :db do
end

task :move_private_key do
require File.dirname(__FILE__) + '/../../config/environment'
require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')
User.all.each do |user|
if user.serialized_private_key.nil?
user.serialized_private_key = user.person.serialized_key
Expand Down
6 changes: 3 additions & 3 deletions lib/tasks/migrations.rake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace :migrations do

desc 'import data to mysql'
task :import_to_mysql do
require 'config/environment'
require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')
migrator = DataConversion::ImportToMysql.new
migrator.full_path = "/tmp/data_conversion/csv"
migrator.log("**** Starting import to MySQL database #{ActiveRecord::Base.connection.current_database} ****")
Expand All @@ -36,7 +36,7 @@ namespace :migrations do

desc 'absolutify all existing image references'
task :absolutify_image_references do
require File.join(Rails.root,"config/environment")
require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')

Photo.all.each do |photo|
unless photo.remote_photo_path
Expand All @@ -63,7 +63,7 @@ namespace :migrations do
end

task :upload_photos_to_s3 do
require File.join(Rails.root,"config/environment")
require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')
puts AppConfig[:s3_key]

connection = Aws::S3.new( AppConfig[:s3_key], AppConfig[:s3_secret])
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/resque.rake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'resque/tasks'
task "resque:setup" do
require 'config/environment'
require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')
Rails.logger.info("event=resque_setup rails_env=#{Rails.env}")
end
2 changes: 1 addition & 1 deletion script/websocket_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

require File.dirname(__FILE__) + '/../config/environment'
require File.join(File.dirname(__FILE__), '..', 'config', 'environment')
require File.dirname(__FILE__) + '/../lib/diaspora/web_socket'

at_exit do
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] ||= 'test'
require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails)
require File.join(File.dirname(__FILE__), '..', 'config', 'environment') unless defined?(Rails)
require 'helper_methods'
require 'rspec/rails'
require 'webmock/rspec'
Expand Down

0 comments on commit 0b39359

Please sign in to comment.