-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathindex.txt
More file actions
71 lines (49 loc) · 2.43 KB
/
index.txt
File metadata and controls
71 lines (49 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Use CocoaPods Dependencies in RubyMotion Apps
=============================================
Laurent Sansonetti <lrz@hipbyte.com>
In this article we will cover how you can integrate the http://cocoapods.org[CocoaPods] dependency manager inside your RubyMotion project.
Synopsis
--------
CocoaPods is the dependency manager for Objective-C projects. It is similar to RubyGems but for Objective-C dependencies.
Dependencies in CocoaPods are called Pods (analgous to Ruby Gems). You can get the list of Pods available from the http://github.com/CocoaPods/Specs[CocoaPods/Specs] GitHub repository.
CocoaPods were originally designed to be integrated in Objective-C Xcode projects, but we worked with the awesome CocoaPods author to make it possible to be used in RubyMotion projects.
You can check the http://cocoapods.org website to get more information about CocoaPods.
Setup
------------
Firstly, you will need to implement the gem. This can be done systemwide with command line, or bundler. The code lives in the http://github.com/HipByte/motion-cocoapods[HipByte/motion-cocoapods] GitHub repository.
Command Line:
----
$ [sudo] gem install cocoapods
----
Bundler (in your Gemfile)
----
gem 'motion-cocoapods'
----
Usage
-----
You will need to require the gem inside the 'Rakefile' of your project.
----
require 'rubygems'
require 'motion-cocoapods'
----
Once you do that, you can simply use the +pods+ method of the application configuration object to describe the Pods you want to require, by using the same expressions as you would do in a regular Podfile.
For instance, if you want to require the +JSONKit+ Pod.
----
Motion::Project::App.setup do |app|
# ...
app.pods do
pod 'JSONKit'
end
end
----
You can view and example of a pod being used in https://github.com/HipByte/RubyMotionSamples/blob/master/osx/Markdown/Rakefile[RubyMotionSamples]
If this is your first time using CocoaPods on your machine, you'll need to let CocoaPods perform some setup with the following command:
----
$ [bundle exec] pod setup
----
Additionally you can tell motion-cocoapods to download your depencies with the following rake task:
----
$ rake pod:install
----
That's it! The +JSONKit+ sources will be downloaded then built and linked against your application executable. If you require a Pod that has dependencies, they will also be properly honored.
For more detailed information and issues please see the gem's http://github.com/HipByte/motion-cocoapods[Github page]