[MacRuby] #1198: Kernel#framework method fails when a file in the current directory matches a framework name
#1198: Kernel#framework method fails when a file in the current directory matches a framework name ----------------------------------+----------------------------------------- Reporter: christian@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: framework ----------------------------------+----------------------------------------- Kernel#framework can accept framework names like 'Cocoa', or paths, like '/System/Library/Frameworks/Cocoa.framework'. However, it distinguishes between the two forms naively, causing trouble when a file or directory in the current directory matches the name of any framework. For example, try this with MacRuby 0.9: {{{ # Works! $ macruby -e 'framework "Cocoa"' $ touch Cocoa $ macruby -e 'framework "Cocoa"' -e:1:in `<main>': framework at path `Cocoa' cannot be located (RuntimeError) }}} This has become a really annoying problem for me because XCode 4 creates separate directories for most targets. Thus, when you try to load your custom framework, the above failure occurs because Kernel#framework assumes it's found the framework and moves on. -- Ticket URL: <http://www.macruby.org/trac/ticket/1198> MacRuby <http://macruby.org/>
#1198: Kernel#framework method fails when a file in the current directory matches a framework name ----------------------------------+----------------------------------------- Reporter: christian@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: framework ----------------------------------+----------------------------------------- Comment(by christian@…): The attached patch tightens up the Kernel#framework method by interpreting any paths as paths. All the following will now be treated as a path: * /Absolute/Path/To/MyKit.framework[[BR]] * /Absolute/Path/To/MyKit[[BR]] * relative/path/to/MyKit.framework[[BR]] * relative/path/to/MyKit[[BR]] * MyKit.framework Only the following will be resolved against system paths (including DLYD_FRAMEWORK_PATH): * MyKit In other words any string with a file extension, or more than one path component will be resolved as a path. This patch should only break scripts that expected a path like 'MyCompany/MyKit' to resolve against system paths or DYLD_FRAMEWORK_PATH. I see this as unlikely (and unwanted) but it can be supported by removing the '[[path pathComponents] count] > 1' condition out of the if statement. -- Ticket URL: <http://www.macruby.org/trac/ticket/1198#comment:2> MacRuby <http://macruby.org/>
#1198: Kernel#framework method fails when a file in the current directory matches a framework name ----------------------------------+----------------------------------------- Reporter: christian@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: framework ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * milestone: => MacRuby 1.0 Comment: Sorry for the late reply, and thanks for the patch. We will integrate it after 0.10. -- Ticket URL: <http://www.macruby.org/trac/ticket/1198#comment:3> MacRuby <http://macruby.org/>
#1198: Kernel#framework method fails when a file in the current directory matches a framework name ----------------------------------+----------------------------------------- Reporter: christian@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: framework ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): Christian, would you be willing to submit these changes as a push request on GitHub? -- Ticket URL: <http://www.macruby.org/trac/ticket/1198#comment:4> MacRuby <http://macruby.org/>
#1198: Kernel#framework method fails when a file in the current directory matches a framework name ----------------------------------+----------------------------------------- Reporter: christian@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: framework ----------------------------------+----------------------------------------- Comment(by christian@…): Replying to [comment:4 lsansonetti@…]:
Christian, would you be willing to submit these changes as a push request on GitHub?
Of course! I had to remember svn just to submit the patch. I'll send a pull request later today. -- Ticket URL: <http://www.macruby.org/trac/ticket/1198#comment:5> MacRuby <http://macruby.org/>
#1198: Kernel#framework method fails when a file in the current directory matches a framework name ----------------------------------+----------------------------------------- Reporter: christian@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.11 Component: MacRuby | Resolution: fixed Keywords: framework | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: MacRuby 1.0 => MacRuby 0.11 Comment: I believe this change was integrated into master. Closing! -- Ticket URL: <http://www.macruby.org/trac/ticket/1198#comment:6> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby