Skip to content

Instantly share code, notes, and snippets.

@burtlo
Created November 19, 2013 02:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burtlo/7539246 to your computer and use it in GitHub Desktop.
Save burtlo/7539246 to your computer and use it in GitHub Desktop.
Ruby as a Second Language

!SLIDE title

Ruby

as a second language

!SLIDE center

Stolkholm Syndrome

!SLIDE title

Quad Curve Menu Quad Curve Menu

Quad Curve Menu

https://github.com/burtlo/QuadCurveMenu

!SLIDE title

All the damn clicking

!SLIDE title

XCode Project File

XCode Project Files are Nightmares

!SLIDE

Ruby

!SLIDE title

cocoapods

Cocoapods

platform :ios, '6.0'
pod 'JSONKit',       '~> 1.4'
pod 'Reachability',  '~> 3.0.0'

!SLIDE title

xcoder

https://github.com/rayh/xcoder

$ gem install xcoder

!SLIDE commandline

Command-Line Builds

# Rakefile

require 'xcoder/rake_task'

Xcode::RakeTask.new
$ rake -T
rake xcode:babygram:babygram:debug:build            # Build Babygram Babygram Debug
rake xcode:babygram:babygram:debug:clean            # Clean Babygram Babygram Debug
rake xcode:babygram:babygram:debug:package          # Package Babygram Babygram Debug
rake xcode:babygram:babygram:debug:test             # Test Babygram Babygram Debug
rake xcode:babygram:babygram:release:build          # Build Babygram Babygram Release
rake xcode:babygram:babygram:release:clean          # Clean Babygram Babygram Release
...

!SLIDE title

Testflight

(ssh and ftp)

!SLIDE title

Project File Manipulation

FileUtils.cp_r "examples/Reachability/Vendor", "spec/TestProject"

source_files = [ 'Vendor/Reachability/Reachability.m' , 'Vendor/Reachability/Reachability.h' ]

project.group('Vendor/Reachability') do
  source_files.each { |source| create_file source }
end

!SLIDE title

Ex: Universal Framework

https://github.com/jverkoey/iOS-Framework

vs

https://gist.github.com/burtlo/7493202

14 manual steps vs ~56 lines of code

!SLIDE title

Exercism

exercism.io

!SLIDE title

XCode Project File

exercism/exercism#316

objective-c. We wanted to focus on the language and not as much time configuring Xcode.

!SLIDE

Complex

Creating the project in Xcode:

* Start Xcode create a new project.
* Select OSX-->Application and then Command Line Tool.
* Click Next and give it a project name using the ExerciseName is advised.
* Select Foundation at the bottom from the drop down menu.
* Click Next until the wizard is finished.
* Now that the project is created click on Editor-->Add Target.
* Select OSX-->Other and select Cocoa Unit Testing Bundle.
* Ensure it's of type XCTest and that the project and target match then click finish.
* Open the new file which will be named ExerciseName_Tests.m in a folder called ExerciseName Tests * and replace the contents with the test file you got from exercism.
* Create a new file with the correct name for the exercise.
* Click on your project in the left hand pane.
* Select Build Phases on the right.
* Ensure that XCTest.framework exists under Link Binary With Libraries.
* Add your .m files to the compile sources list.
* Then use CMD-U to run the tests when you're ready.

!SLIDE commandline

Simple

$ objc Bob
Looking for all files with prefix: Bob
Loading files into ExercismTestFixture (Project) at /var/folders/yl/ghj0mlzx2wd7gr9mth9v0kmr0000gn/T/ExercismTestFixture/ExercismTestFixture.xcodeproj

[Info] Loading settings for scheme 'IgnoreThisTarget' ... (854 ms)

=== TEST ===

  xcodebuild build build
    ExercismTestFixture / test-suite (Debug)
      ✓ Check dependencies (37 ms)
      ✓ Process test-suite-Info.plist (0 ms)
      ✗ Compile Bob.m (11 ms)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CompileC /Users/burtlo/Library/Developer/Xcode/DerivedData/ExercismTestFixture-denfxmkllhhbnfhfpafwbuihmrfk/Build/Intermediates/ExercismTestFixture.build/Debug/test-suite.build/Objects-normal/x86_64/Bob.o /Users/burtlo/jumpstartlab/warmups/bob/Bob.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /var/folders/yl/ghj0mlzx2wd7gr9mth9v0kmr0000gn/T/ExercismTestFixture
    setenv LANG en_US.US-ASCII

!SLIDE title

objc

https://github.com/burtlo/objc

$ gem install objc

!SLIDE

Ruby Motion

awesome advances that are taking place towards efficiency in RubyMotion. http://clayallsopp.com/posts/the-ruby-motion-way/ and https://gist.github.com/burtlo/5719253

!SLIDE title

Cocoapods

Xcoder

But when I look for tooling and ways to make my life easier I look at Ruby to provide me with amazing tools that chnage

!SLIDE title

XCode Project File

Objective-C

together I choose to use objective-C and iOS.

!SLIDE

Ruby

@franklinwebber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment