Permalink
Browse files

initial revision

  • Loading branch information...
0 parents commit ec790c57752162f2d5818abdbd00af7f2764ae42 @lrz lrz committed Jun 1, 2012
@@ -0,0 +1 @@
+*.html
@@ -0,0 +1,42 @@
+= RubyMotion Documentation
+
+This repository contains the official documentation of RubyMotion, a
+commercial toolchain for iOS development in Ruby.
+
+The files in this repository are used to build the Developer Center section
+of the RubyMotion website.
+
+http://www.rubymotion.com/developer-center
+
+== Setup
+
+Documentation is written using the AsciiDoc text document format. You can find more information about AsciiDoc on its website: http://www.methods.co.nz/asciidoc
+
+We use the Mizuho tool to build the documentation. Mizuho conveniently includes
+AsciiDoc as well as additional functionality.
+
+ $ sudo gem install mizuho
+
+You can also find the source code of Mizuho on GitHub. Mizuho is a project of
+Hongli Lai of the amazing Phusion folks. https://github.com/FooBarWidget/mizuho
+
+== Usage
+
+The default +rake+ task will build the documentation by creating a +.html+
+file for each +.txt+ file.
+
+ $ rake
+
+== Contributions
+
+Please use the GitHub pull-request mechanism to submit contributions. We will
+refresh the RubyMotion website on a periodical basis.
+
+Thanks a lot in advance!
+
+== License
+
+This documentation is licensed under a Creative Commons Attribution 3.0
+Unported License.
+
+http://creativecommons.org/licenses/by/3.0/
@@ -0,0 +1,13 @@
+task :default => :all
+
+task :all do
+ Dir.glob('**/*.txt').each do |src|
+ Dir.chdir(File.dirname(src)) do
+ src = File.basename(src)
+ dest = src.sub(/\.txt/, '.html')
+ if !File.exist?(dest) or File.mtime(src) > File.mtime(dest)
+ sh "mizuho -a max-width=55em --icons-dir \"../../icons\" \"#{src}\" -o \"#{dest}\""
+ end
+ end
+ end
+end
@@ -0,0 +1,61 @@
+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 missing dependency manager for Objective-C projects. It is similar to RubyGems but for Objective-C dependencies.
+
+Dependencies in CocoaPods are called Pods. You can get the list of Pods available from the http://github.com/CocoaPods/Specs[CocoaPods/Specs] GitHub repository.
+
+CocoaPods was 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.
+
+Installation
+------------
+
+First, you will need to install and setup CocoaPods, unless you already have.
+
+----
+$ sudo gem install cocoapods
+$ pod setup
+----
+
+The RubyMotion CocoaPods integration also comes as a gem.
+
+----
+$ sudo gem install motion-cocoapods
+----
+
+The code lives in the http://github.com/HipByte/motion-cocoapods[HipByte/motion-cocoapods] GitHub repository.
+
+Usage
+-----
+
+You will need to require the gem inside the 'Rakefile' of your project.
+
+----
+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
+ dependency 'JSONKit'
+ end
+end
+----
+
+That's all you have to do.
+
+The next time you build your project, 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.
+
@@ -0,0 +1,82 @@
+Submit RubyMotion Apps to TestFlight
+====================================
+Laurent Sansonetti <lrz@hipbyte.com>
+
+In this article we will cover how you can submit development builds of your RubyMotion apps to http://testflightapp.com[TestFlight].
+
+Synopsis
+--------
+
+TestFlight is a platform that you can use to distribute development builds of your apps to you team members. You receive feedback, console logs and crash reports automatically. It can very useful during the development cycle of an app.
+
+You can create an account on http://testflightapp.com[http://testflightapp.com]. It's free.
+
+Installation
+------------
+
+We recommend the use of the +motion-testflight+ gem which provides a seemingless experience.
+
+----
+$ sudo gem install motion-testflight
+----
+
+The source code of the +motion-testflight+ gem lives on the http://github.com/HipByte/motion-testflight[HipByte/motion-testflight] GitHub repository.
+
+Unpack the SDK
+--------------
+
+You will need to download the TestFlight SDK package from http://testflightapp.com/sdk/download and unpack it into the 'vendor/TestFlightSDK' directory of your RubyMotion project.
+
+Create the 'vendor' directory if it does not exist.
+
+You should then have something like this.
+
+----
+$ ls vendor/TestFlightSDK
+README.txt libTestFlight.a
+TestFlight.h release_notes.txt
+----
+
+Change your project configuration
+---------------------------------
+
+You will need to change the 'Rakefile' of your project in order to set up the gem.
+
+First, you need to require the gem. Add the following line at the beginning of the file, right after the other +require+ statements.
+
+----
+require 'motion-testflight'
+----
+
+Now that the gem is loaded, it's time to configure it. Inside your application configuration block, add the following lines.
+
+----
+Motion::Project::App.setup do |app|
+ # ...
+ app.testflight.sdk = 'vendor/TestFlight'
+ app.testflight.api_token = '<insert your API token here>'
+ app.testflight.team_token = '<insert your team token here>'
+end
+----
+
+You can retrieve the values for +api_token+ and +team_token+ from your TestFlight account page.
+
+Optionally, you can use the +distribution_lists+ key if you do want to set up a distribution list for your submissions.
+
+----
+Motion::Project::App.setup do |app|
+ # ...
+ app.testflight.distribution_lists = ['CoolKids']
+end
+----
+
+Usage
+-----
+
+You will see that a new rake task is available, +rake testflight+, which will automatically submit a development build of your app to TestFlight.
+
+The +notes+ argument must be provided, its content will be the actual release notes for the submission.
+
+----
+$ rake testflight notes='zomg!'
+----
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,161 @@
+Welcome to RubyMotion
+=====================
+Laurent Sansonetti <lrz@hipbyte.com>
+
+
+Thank you for purchasing RubyMotion. This guide will help you getting started with the product.
+
+Overview
+--------
+
+http://www.rubymotion.com[RubyMotion] is a toolchain that permits the development of iOS applications using the Ruby programming language.
+
+http://www.apple.com/ios[iOS] is Apple's mobile operating system, powering a variety of devices such as iPhone, iPod touch and iPad. Developers can write applications for iOS and submit them to the App Store, Apple's application distribution system.
+
+Conceptually, RubyMotion is a combination of two major components:
+
+* *Runtime*: a brand-new implementation of the Ruby language, tightly integrated with the native iOS runtime and optimized for embedded iOS device constraints.
+* *Project Management*: a command-line interface to create, manage and interactively develop RubyMotion projects. It also includes a static compiler that compiles Ruby into optimized machine code and an interactive console where you can evaluate expressions on the fly and change the way your app behaves in real-time.
+
+RubyMotion installs itself into '/Library/RubyMotion'. A symbolic link to the command-line interface is created as '/usr/bin/motion'.
+
+Prerequisites
+-------------
+
+RubyMotion requires a Mac running OSX 10.6 or higher. OSX 10.7 Lion however is highly recommended.
+
+You will need to install the iOS SDK on your machine. These days the iOS SDK comes with Xcode. Xcode can be downloaded and installed for free using the App Store application.
+
+NOTE: Xcode is Apple's IDE. You do not need to use it when programming with RubyMotion, you can keep using your favorite text editor.
+
+Open the 'App Store' application then search for "Xcode" in the search field.
+
+image:/developer-center/guides/getting-started/images/xcode-search.png["Searching for Xcode in the App Store"]
+
+Find 'Xcode' from the result, then click on it.
+
+image:/developer-center/guides/getting-started/images/xcode-search2.png["Searching for Xcode in the App Store"]
+
+That should open a new page where you can download Xcode.
+
+Once Xcode is installed, you will need to install the Command Line Tools package, required by RubyMotion.
+
+Open the 'Xcode' application from your 'Applications' folder, then go to the 'Preferences' window and click on the 'Downloads' tab. You should see the 'Command Line Tools' package from the list, make sure to hit the 'Install' button.
+
+image:/developer-center/guides/getting-started/images/xcode-prefs-download.png["Installing the Command Line Tools package"]
+
+Okay, you should be all set now! You can close Xcode.
+
+If you happened to have an older version of Xcode installed on your machine before you installed a newer Xcode from the App Store, you may want to type the following command in order to properly set up the default Xcode path.
+
+----
+$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
+----
+
+Software Updates
+----------------
+
+Software updates can be applied via the command-line.
+
+The following command will grab the latest version of RubyMotion from the network and install it. You must be connected to the Internet to perform that command.
+
+----
+$ sudo motion update
+----
+
+You can always see the version number of the version of RubyMotion installed on the computer.
+
+----
+$ motion -v
+1.0
+----
+
+Once a day, the RubyMotion build system pings the software update server in order to see if a new version of RubyMotion is available to install, and accordingly prints a message on your terminal, suggesting you to upgrade.
+
+Support
+-------
+
+If you are experiencing an issue, would like to request a feature, or simply have a question, you can file a support ticket from the command-line too.
+
+----
+$ motion support
+----
+
+This will open a new window in your browser where you can fill up a support ticket. Your license key and some useful information regarding your environment will be added automatically.
+
+Hello World
+-----------
+
+We are now ready to write our first RubyMotion program: Hello World.
+
+Open your terminal and go to a place where you would like this first project to be created, then type the following command.
+
+----
+$ motion create Hello
+----
+
+This command will create a RubyMotion project in a new directory, called Hello. If this directory already exists or cannot be created, the command will fail.
+
+Let's have a look inside.
+
+----
+$ cd Hello
+$ ls
+Rakefile app resources spec
+----
+
+A RubyMotion project is +Rakefile+-based. +rake+ is the de-facto Ruby build program. It is similar to +make+ and it ships with Mac OS X by default.
+
+The 'app' directory contains the application code. The 'resources' directory will eventually contain the resource files of your project, such as icon, image or sound files. The 'spec' directory contains specification/test files.
+
+Let's run the default task.
+
+----
+$ rake
+----
+
+This should build our project then start the simulator, and you should see... an empty, black window. It's actually normal, we haven't written any code yet!
+
+If you look inside the 'app' directory you will see an 'app_delegate.rb' file, which is created by default. This file implements the AppDelegate class, which is responsible for controlling your application.
+
+----
+class AppDelegate
+ def application(application, didFinishLaunchingWithOptions:launchOptions)
+ true
+ end
+end
+----
+
+Open the 'app/app_delegate.rb' file with your favorite editor. We will change the code to do something more interesting, such as triggering an alert.
+
+----
+class AppDelegate
+ def application(application, didFinishLaunchingWithOptions:launchOptions)
+ alert = UIAlertView.new
+ alert.message = "Hello World!"
+ alert.show
+ true
+ end
+end
+----
+
+If you run the +rake+ command again from the terminal, you should be able to see the alert in the simulator.
+
+image:/developer-center/guides/getting-started/images/hello.png["Hello World"]
+
+Now, let's try this outside the simulator. Make sure you have an iOS device properly configured for development connected over USB, and type the following.
+
+----
+$ rake device
+----
+
+This should install the Hello app on your device. You can now pick it up and run the app, and you should be able to see the alert message.
+
+Congratulations, you successfully created your first RubyMotion program. That wasn’t too hard, was it?
+
+And Now?
+--------
+
+You will find sample code in the https://github.com/HipByte/RubyMotionSamples[Sample Code Repository] on GitHub. Each of the sub-folders is a RubyMotion project as introduced above. You can type +rake+ from their directory to build and run them and check their source code by reading the files in the 'app' directory.
+
+Make sure to check the link:/developer-center[Developer Center] for more resources, such as guides, articles and screencasts.
Oops, something went wrong.

0 comments on commit ec790c5

Please sign in to comment.