Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor Philippov authored and lakeskysea committed Feb 6, 2012
1 parent e257ad7 commit 2a5bb3e
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Expand Up @@ -25,7 +25,7 @@ def default_url_options(options={})
# Set version for MarkUs to be available in
# any view
def set_markus_version
version_file=File.expand_path(File.join(::Rails.root.to_s, "app/MARKUS_VERSION"))
version_file=File.expand_path(File.join(::Rails.root.to_s, "app", "MARKUS_VERSION"))
if !File.exist?(version_file)
@markus_version = "unknown"
return
Expand Down
2 changes: 1 addition & 1 deletion app/models/admin.rb
@@ -1,5 +1,5 @@
# we need repository permission constants
require File.join(File.dirname(__FILE__),'/../../lib/repo/repository')
require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'repo', 'repository')
class Admin < User
SESSION_TIMEOUT = USER_ADMIN_SESSION_TIMEOUT

Expand Down
2 changes: 1 addition & 1 deletion app/models/ta.rb
@@ -1,5 +1,5 @@
# we need repository and permission constants
require File.join(File.dirname(__FILE__),'/../../lib/repo/repository')
require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'repo', 'repository')

class Ta < User

Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Expand Up @@ -2,7 +2,7 @@
require 'digest' # required for {set,reset}_api_token
require 'base64' # required for {set,reset}_api_token
# required for repository actions
require File.join(File.dirname(__FILE__),'/../../lib/repo/repository')
require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'repo', 'repository')

# We always assume the following fields exists:
# => :user_name, :last_name, :first_name
Expand Down
2 changes: 1 addition & 1 deletion db/populate/06_repos.rb
Expand Up @@ -3,7 +3,7 @@
groups = Group.all
assignment = Assignment.find_by_short_identifier("A1")

file_dir = File.join(File.dirname(__FILE__), '/data')
file_dir = File.join(File.dirname(__FILE__), 'data')
groups.each do |group|
Dir.foreach(file_dir) do |filename|
unless File.directory?(File.join(file_dir, filename))
Expand Down
6 changes: 3 additions & 3 deletions lib/repo/test/memory_repository_test.rb
Expand Up @@ -7,12 +7,12 @@

class MemoryRepositoryTest < Test::Unit::TestCase

RESOURCE_DIR = File.expand_path(File.join(File.dirname(__FILE__),"/input_files"))
RESOURCE_DIR = File.expand_path(File.join(File.dirname(__FILE__), "input_files"))
TEST_USER = "testuser"
REPO_LOCATION = File.expand_path(File.join(File.dirname(__FILE__),'memory_repo1'))
ANOTHER_REPO_LOCATION = File.expand_path(File.join(File.dirname(__FILE__),'memory_repo2'))
# following constant not used as of now
TEST_REPO_CONTENT = File.expand_path(File.join(File.dirname(__FILE__),'/../memory_repository.yml'))
TEST_REPO_CONTENT = File.expand_path(File.join(File.dirname(__FILE__),'..', 'memory_repository.yml'))

context "MemoryRepository class" do

Expand Down Expand Up @@ -508,7 +508,7 @@ def add_some_files_helper(repo, files)
# MemoryRevision, an implementation of AbstractRevision
class MemoryRevisionTest < Test::Unit::TestCase

RESOURCE_DIR = File.expand_path(File.join(File.dirname(__FILE__),"/input_files"))
RESOURCE_DIR = File.expand_path(File.join(File.dirname(__FILE__),"input_files"))
TEST_USER = "testuser"

context "A MemoryRevision object" do
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/populate.rake
Expand Up @@ -2,7 +2,7 @@ namespace :markus do

desc "Print MarkUs version"
task :version do
VERSION_FILE=File.expand_path(File.join(__FILE__, '../../../app/MARKUS_VERSION'))
VERSION_FILE=File.expand_path(File.join(__FILE__, '..', '..', '..', 'app', 'MARKUS_VERSION'))
if !File.exist?(VERSION_FILE)
$stderr.puts "Could not determine MarkUs version, please check your installation!"
exit(1)
Expand Down Expand Up @@ -41,7 +41,7 @@ namespace :markus do
# this task depends on :environment and :populate
task(:add_students => [:environment, :"db:populate"]) do
puts "Populate database with some additional students"
STUDENT_CSV = File.expand_path(File.join(__FILE__, '/../../../test/classlist-csvs/new_students.csv'))
STUDENT_CSV = File.expand_path(File.join(__FILE__, '..', '..', '..', 'test', 'classlist-csvs', 'new_students.csv'))
if File.readable?(STUDENT_CSV)
csv_students = File.new(STUDENT_CSV)
User.upload_user_list(Student, csv_students.read)
Expand Down
8 changes: 4 additions & 4 deletions test/functional/sections_controller_test.rb
@@ -1,9 +1,9 @@
# Using machinist

require File.dirname(__FILE__) + '/authenticated_controller_test'
require File.join(File.dirname(__FILE__),'/../test_helper')
require File.join(File.dirname(__FILE__),'/../blueprints/blueprints')
require File.join(File.dirname(__FILE__),'/../blueprints/helper')
require File.join(File.dirname(__FILE__), 'authenticated_controller_test')
require File.join(File.dirname(__FILE__),'..', 'test_helper')
require File.join(File.dirname(__FILE__),'..', 'blueprints', 'blueprints')
require File.join(File.dirname(__FILE__),'..', 'blueprints', 'helper')
require 'shoulda'


Expand Down
4 changes: 2 additions & 2 deletions test/unit/grade_entry_item_test.rb
@@ -1,5 +1,5 @@
require File.dirname(__FILE__) + '/../test_helper'
require File.join(File.dirname(__FILE__), '/../blueprints/helper')
require File.join(File.dirname(__FILE__), '..', 'test_helper')
require File.join(File.dirname(__FILE__), '..', 'blueprints', 'helper')
require 'shoulda'

# Tests for GradeEntryItems
Expand Down
2 changes: 1 addition & 1 deletion test/unit/grade_entry_student_test.rb
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../test_helper'
require File.join(File.dirname(__FILE__), '..', 'test_helper')
require 'shoulda'

# Tests for GradeEntryStudents
Expand Down
2 changes: 1 addition & 1 deletion test/unit/grouping_test.rb
Expand Up @@ -235,7 +235,7 @@ class GroupingTest < ActiveSupport::TestCase
@grouping = Grouping.make(:assignment => @assignment)
@grouping.group.access_repo do |repo|
txn = repo.get_transaction("markus")
assignment_folder = File.join(@assignment.repository_folder, "/")
assignment_folder = File.join(@assignment.repository_folder, File::SEPARATOR)
begin
txn.add(File.join(assignment_folder,
"Shapes.java"),
Expand Down
2 changes: 1 addition & 1 deletion test/unit/helpers/automated_tests_helper_test.rb
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../../test_helper'
require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
include AutomatedTestsHelper
require 'shoulda'

Expand Down
2 changes: 1 addition & 1 deletion test/unit/helpers/ensure_config_helper_test.rb
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../../test_helper'
require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
require 'shoulda'
require 'fileutils'
require 'mocha'
Expand Down
2 changes: 1 addition & 1 deletion test/unit/helpers/pagination_helper_test.rb
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../../test_helper'
require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
require 'shoulda'
require 'fileutils'
require 'mocha'
Expand Down

0 comments on commit 2a5bb3e

Please sign in to comment.