質問

RubyMotion does not support

require 

in code (only in RakeFile).

Is there a way to use useful classes built into Ruby but not into RubyMotion ? For instance, I'd like to be able to do a

name=Pathname.new("/path/to/some/file").basename

rather than look for Cocoa equivalent

役に立ちましたか?

解決

Pathname is one of those pieces of the Ruby Standard Library that are not available in RubyMotion.

You can try with MotionBundler, but I personally haven't been very lucky with that.

I'd suggest to use the Cocoa equivalent. Something like:

name = "/path/to/some/file".lastPathComponent

Not that bad, anyway.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top