Skip to content

Commit

Permalink
Style cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
cespare committed Sep 20, 2012
1 parent b47c626 commit 51f4ed6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions lib/pathological/base.rb
Expand Up @@ -94,7 +94,7 @@ def self.find_pathfile(directory = nil)
#
# TODO(ev): Break this function up into a set of more functional primitives
def self.copy_outside_paths!(destination, options = {})
options = {:dependency_directory => "pathological_dependencies"}.merge(options)
options = { :dependency_directory => "pathological_dependencies" }.merge(options)
saved_exclude_root = @@exclude_root
begin
self.excluderoot_mode
Expand Down Expand Up @@ -134,7 +134,7 @@ def self.copy_outside_paths!(destination, options = {})

def self.debug_mode; @@debug = true; end
def self.bundlerize_mode
pathfile = Pathological.find_pathfile
pathfile = self.find_pathfile
raise NoPathfileException unless pathfile
bundle_gemfile = File.join(File.dirname(pathfile), "Gemfile")
unless File.file? bundle_gemfile
Expand Down
1 change: 1 addition & 0 deletions pathological.gemspec
Expand Up @@ -29,4 +29,5 @@ Gem::Specification.new do |s|
s.add_development_dependency "scope", ">= 0.2.3"
s.add_development_dependency "fakefs"
s.add_development_dependency "rake"
s.add_development_dependency "dedent"
end
49 changes: 25 additions & 24 deletions test/unit/pathological/base_test.rb
Expand Up @@ -4,6 +4,7 @@
require "minitest/autorun"
require "stringio"
require "fakefs/safe"
require "dedent"

# It's kind of funny that we need to do this hack, given that Pathological is intended to work around it...
$:.unshift(File.join(File.dirname(__FILE__), "../../lib"))
Expand Down Expand Up @@ -102,29 +103,29 @@ def assert_load_path(expected_load_path)

context "#requiring_filename" do
setup do
@full_19_stacktrace = %Q{
/Users/test/ruby/gems/1.9.1/gems/pathological-0.2.2.1/lib/pathological/base.rb:61:in `find_pathfile'
/Users/test/gems/pathological-0.2.2.1/lib/pathological/base.rb:36:in `find_load_paths'
/Users/test/gems/pathological-0.2.2.1/lib/pathological/base.rb:15:in `add_paths!'
/Users/test/gems/pathological-0.2.2.1/lib/pathological.rb:3:in `<top (required)>'
/Users/test/ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
/Users/test/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
/Users/test/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
/Users/test/repos/pathological/test/rackup/app.rb:1:in `<top (required)>'
/Users/test/.rubies/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
}.split("\n").reject(&:empty?)
@full_18_stacktrace = %Q{
/Users/test/ruby/gems/1.8/gems/pathological-0.2.5/lib/pathological/base.rb:61:in `find_pathfile'
/Users/test/ruby/gems/1.8/gems/pathological-0.2.5/lib/pathological/base.rb:36:in `find_load_paths'
/Users/test/ruby/gems/1.8/gems/pathological-0.2.5/lib/pathological/base.rb:15:in `add_paths!'
/Users/test/ruby/gems/1.8/gems/pathological-0.2.5/lib/pathological.rb:3
/Users/test/ruby/site_ruby/1.8/rubygems/custom_require.rb:58:in `gem_original_require'
/Users/test/ruby/site_ruby/1.8/rubygems/custom_require.rb:58:in `require'
app.rb:2
}.split("\n").reject(&:empty?)
@bad_stacktrace = %Q{
/Users/test/repos/pathological/test/rackup/app.rb !!! `<top (required)>'
}.split("\n").reject(&:empty?)
@full_19_stacktrace = <<-EOS.dedent.split("\n").reject(&:empty?)
/Users/test/ruby/gems/1.9.1/gems/pathological-0.2.2.1/lib/pathological/base.rb:61:in `find_pathfile'
/Users/test/gems/pathological-0.2.2.1/lib/pathological/base.rb:36:in `find_load_paths'
/Users/test/gems/pathological-0.2.2.1/lib/pathological/base.rb:15:in `add_paths!'
/Users/test/gems/pathological-0.2.2.1/lib/pathological.rb:3:in `<top (required)>'
/Users/test/ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
/Users/test/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
/Users/test/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
/Users/test/repos/pathological/test/rackup/app.rb:1:in `<top (required)>'
/Users/test/.rubies/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
EOS
@full_18_stacktrace = <<-EOS.dedent.split("\n").reject(&:empty?)
/Users/test/ruby/gems/1.8/gems/pathological-0.2.5/lib/pathological/base.rb:61:in `find_pathfile'
/Users/test/ruby/gems/1.8/gems/pathological-0.2.5/lib/pathological/base.rb:36:in `find_load_paths'
/Users/test/ruby/gems/1.8/gems/pathological-0.2.5/lib/pathological/base.rb:15:in `add_paths!'
/Users/test/ruby/gems/1.8/gems/pathological-0.2.5/lib/pathological.rb:3
/Users/test/ruby/site_ruby/1.8/rubygems/custom_require.rb:58:in `gem_original_require'
/Users/test/ruby/site_ruby/1.8/rubygems/custom_require.rb:58:in `require'
app.rb:2
EOS
@bad_stacktrace = <<-EOS.dedent.split("\n").reject(&:empty?)
/Users/test/repos/pathological/test/rackup/app.rb !!! `<top (required)>'
EOS
@empty_stacktrace = []
end

Expand Down Expand Up @@ -273,7 +274,7 @@ def load_and_run!
end

should "copy source dirs as links and rewrite Pathfile in a different directory" do
other = "/tmp/other"
other = "other/dir"
FileUtils.mkdir_p other
File.open(File.join(other, "Pathfile"), "w") { |f| f.puts @source_paths.join("\n") }

Expand Down

0 comments on commit 51f4ed6

Please sign in to comment.