Gems 是可以在项目中重复使用的第三方组件。RubyMotion 社区已经开发出数量众多的 Gem。这里是其中部分 Gem,访问 Motion Toolbox,获知更多的 Gem。
Gems
motion-cocoapods
Integrate 3rd-party libraries in RubyMotion for iOS / OS X projects via CocoaPods
Motion::Project::App.setup do |app|
# ...
app.pods do
pod 'AFNetworking'
end
end
motion-gradle
Integrate 3rd-party Java dependencies in RubyMotion for Android projects using Gradle
Motion::Project::App.setup do |app|
# ...
app.gradle do
dependency 'net.sf.ehcache:ehcache:2.9.0'
dependency 'com.joanzapata.pdfview:android-pdfview:1.0.+@aar'
dependency 'com.danikula:videocache:2.3.1' do
exclude module: 'android', group: 'com.google.android'
end
end
end
motion-provisioning
Simplified provisioning for RubyMotion iOS, tvOS and macOS apps.
Motion::Project::App.setup do |app|
app.name = 'My App'
app.identifier = 'com.example.myapp'
app.development do
app.codesign_certificate = MotionProvisioning.certificate(
type: :development,
platform: :ios)
app.provisioning_profile = MotionProvisioning.profile(
bundle_identifier: app.identifier,
app_name: app.name,
platform: :ios,
type: :development)
end
end
希望了解更多 Gem?访问 Motion Toolbox,以获取更全面的 Gem 列表。