mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-03 06:59:14 +00:00
Use require_relative introduced in Ruby 1.9.2
The new `require_relative` command is much shorter and easier to read
then the previous:
-require File.expand_path('../config/application', __FILE__)
+require_relative 'config/application'
This commit is contained in:
2
Rakefile
2
Rakefile
@@ -2,7 +2,7 @@
|
||||
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
||||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
||||
|
||||
require File.expand_path('../config/application', __FILE__)
|
||||
require_relative 'config/application'
|
||||
|
||||
Openfoodnetwork::Application.load_tasks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
require File.expand_path('../boot', __FILE__)
|
||||
require_relative 'boot'
|
||||
|
||||
require 'rails/all'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Load the rails application
|
||||
require File.expand_path('../application', __FILE__)
|
||||
require_relative 'application'
|
||||
|
||||
# Initialize the rails application
|
||||
Openfoodnetwork::Application.initialize!
|
||||
|
||||
@@ -5,8 +5,8 @@ namespace :openfoodnetwork do
|
||||
|
||||
desc 'load sample data'
|
||||
task :load_sample_data => :environment do
|
||||
require File.expand_path('../../../spec/factories', __FILE__)
|
||||
require File.expand_path('../../../spec/support/spree/init', __FILE__)
|
||||
require_relative '../../spec/factories'
|
||||
require_relative '../../spec/support/spree/init'
|
||||
task_name = "openfoodnetwork:dev:load_sample_data"
|
||||
|
||||
# -- Shipping / payment information
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
|
||||
require_relative '../config/environment'
|
||||
require 'delayed/command'
|
||||
Delayed::Command.new(ARGV).daemonize
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
||||
|
||||
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
||||
require File.expand_path('../../config/boot', __FILE__)
|
||||
require_relative '../config/boot'
|
||||
require 'rails/commands'
|
||||
|
||||
@@ -8,7 +8,7 @@ Knapsack.tracker.config({enable_time_offset_warning: false}) unless ENV['CI']
|
||||
Knapsack::Adapters::RSpecAdapter.bind
|
||||
|
||||
ENV["RAILS_ENV"] ||= 'test'
|
||||
require File.expand_path("../../config/environment", __FILE__)
|
||||
require_relative "../config/environment"
|
||||
require 'rspec/rails'
|
||||
require 'capybara'
|
||||
require 'database_cleaner'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
ENV["RAILS_ENV"] = "test"
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require_relative '../config/environment'
|
||||
require 'rails/test_help'
|
||||
|
||||
class ActiveSupport::TestCase
|
||||
|
||||
Reference in New Issue
Block a user