RubyMotion projects can be extended through the use of RubyGems, the Ruby de-facto packaging system. This article will cover how to write RubyMotion-specific gems.
This article was inspired by Create gems for RubyMotion, by Francis Chong.
| <?xml version="1.0" encoding="UTF-8"?> | |
| <kml xmlns="http://www.opengis.net/kml/2.2"> | |
| <Document> | |
| <name>Appsterdam Heatmap</name> | |
| <open>1</open> | |
| <description>The Appsterdam Tech Scene</description> | |
| <Style id="mainIcon"> | |
| <IconStyle> | |
| <Icon> | |
| <href>http://maps.google.com/mapfiles/kml/pal4/icon28.png</href> |
RubyMotion projects can be extended through the use of RubyGems, the Ruby de-facto packaging system. This article will cover how to write RubyMotion-specific gems.
This article was inspired by Create gems for RubyMotion, by Francis Chong.
| #!/usr/bin/env ruby | |
| # | |
| # Usage: | |
| # make_story dialog_text_file.txt [output.plist] | |
| # | |
| # Make sure you install the plist gem: | |
| # [sudo] gem install plist | |
| # | |
| require "parser" |
| module SprocketsInitializer | |
| def self.registered(app) | |
| require "sprockets" | |
| app.controllers :assets do | |
| helpers do | |
| def sprockets_env | |
| return @sprockets_environment if @sprockets_environment | |
| @sprockets_environment = Sprockets::Environment.new(Padrino.root) | |
| @sprockets_environment.append_path 'app/assets/javascripts' | |
| @sprockets_environment.append_path 'app/assets/stylesheets' |
| #!/usr/bin/env ruby -wKU | |
| ## | |
| # Runtime options | |
| # | |
| require "optparse" | |
| options = { :spec => false } | |
| ARGV.options do |opts| |
| import UIKit | |
| import SpriteKit | |
| extension String { | |
| func hexComponents() -> String?[] { | |
| let code = self | |
| let offset = code.hasPrefix("#") ? 1 : 0 | |
| let start: String.Index = code.startIndex | |
| return [ |
| /** | |
| * Demonstrates how to use Apple's CloudKit server-to-server authentication | |
| * | |
| * Create private key with: `openssl ecparam -name prime256v1 -genkey -noout -out eckey.pem` | |
| * Generate the public key to register at the CloudKit dashboard: `openssl ec -in eckey.pem -pubout` | |
| * | |
| * @see https://developer.apple.com/library/prerelease/ios/documentation/DataManagement/Conceptual/CloutKitWebServicesReference/SettingUpWebServices/SettingUpWebServices.html#//apple_ref/doc/uid/TP40015240-CH24-SW6 | |
| * | |
| * @author @spllr | |
| */ |
| // Playground by @spllr. Use as you like. | |
| import Foundation | |
| /// A Game of Tic Tac Toe | |
| public struct Game: CustomStringConvertible, Codable | |
| { | |
| /// Game Errors | |
| /// | |
| /// - gameFinished: The game has finished and no plays are possible |