Skip to content

Commit

Permalink
Small cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Apr 21, 2011
1 parent 45a9c57 commit 271211a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/macruby/spec_helper.rb
@@ -1,8 +1,8 @@
framework 'Cocoa'

SPEC_ROOT = File.dirname(__FILE__)
SPEC_ROOT = File.expand_path("../", __FILE__)
FIXTURES = File.join(SPEC_ROOT, "fixtures")
ROOT_DIR = File.expand_path("../../", SPEC_ROOT)
SOURCE_ROOT = File.expand_path("../../", SPEC_ROOT)

class FixtureCompiler
def self.require!(fixture)
Expand All @@ -11,7 +11,7 @@ def self.require!(fixture)

FRAMEWORKS = %w{ Foundation }
ARCHS = %w{ i386 x86_64 }
OPTIONS = %w{ -g -dynamiclib -fobjc-gc -Wl,-undefined,dynamic_lookup } << "-I#{ROOT_DIR}/include"
OPTIONS = %W{ -g -dynamiclib -fobjc-gc -Wl,-undefined,dynamic_lookup -I#{SOURCE_ROOT}/include }
GCC = "/usr/bin/gcc"

attr_reader :gcc, :frameworks, :archs, :options
Expand Down

4 comments on commit 271211a

@takaokouji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. It's nice.

@alloy
Copy link
Member Author

@alloy alloy commented on 271211a Apr 21, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And your patch made me realize that apparently I used File.dirname(FILE) for the SPEC_ROOT, which I normally really try to avoid in favor of File.expand_path :)

@takaokouji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think File.dirname(FILE) is better than File.expand_path("../", FILE) for getting directory from file path. Then I only set directory to second argument when call File.expand_path.

File.expand_path("../../app/models/page.rb", File.dirname(__FILE__))

@alloy
Copy link
Member Author

@alloy alloy commented on 271211a May 1, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean, but haven't ever really felt the need to be more explicit. I’ll keep it in mind, though, and play with it in the future.

Please sign in to comment.