Skip to content

Commit

Permalink
do not fail with missing root or missing .spin
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Jul 26, 2012
1 parent a17e7ae commit dbd3d8f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/spin
Expand Up @@ -60,7 +60,7 @@ end
def serve(force_rspec, force_testunit, time, push_results, preload) def serve(force_rspec, force_testunit, time, push_results, preload)
root_path = rails_root(preload) and Dir.chdir(root_path) root_path = rails_root(preload) and Dir.chdir(root_path)
file = socket_file file = socket_file
Spin.parse_hook_file(root_path) Spin.parse_hook_file(root_path) if root_path


# We delete the tmp file for the Unix socket if it already exists. The file # We delete the tmp file for the Unix socket if it already exists. The file
# is scoped to the `pwd`, so if it already exists then it must be from an # is scoped to the `pwd`, so if it already exists then it must be from an
Expand Down Expand Up @@ -291,7 +291,8 @@ module Spin
end end


def self.parse_hook_file(root) def self.parse_hook_file(root)
load(root.join(".spin.rb")) file = root.join(".spin.rb")
load(file) if File.exist?(file)
end end


private private
Expand Down

0 comments on commit dbd3d8f

Please sign in to comment.