RubyMotion and Interface Builder… - Digital Magpie

So, all of the cool kids have been talking about Laurent Sansonetti’s next project: RubyMotion, a port of MacRuby targeted at iOS. On the whole I’m pretty impressed with what you can already do with it. One of the issues that people having been mentioning though, is that you lose the ability to use Interface Builder with it, but this isn’t actually true!

This is a big step forward. Of course, it would be way cooler to have StoryBoard support...

RubyMotion and CocoaPods

So, before you go very far with the RubyMotion, you will probably run into the need for Cocoapods and motion-cocoapods.  I know that was the fact for me, when I stumbled across a link to https://github.com/foeken/CarenMotion, and wanted to see how it worked. 

As a Ruby developer with a lot of different projects on my plate, it was perhaps inevitable that I would be slightly perplexed at this point.  RubyMotion is self-contained, with it's own Ruby implementation.  But motion-cocoapods and cocoapods itself are gems to install.  So, under which Ruby (I have 6 different Ruby/versions installed via rvm) should these be installed?

Thinking I was being logical, I started with MacRuby. 

$ rvm use macruby
Using /Users/lori/.rvm/gems/macruby-0.10

lori@wndx ~
$ gem list

*** LOCAL GEMS ***


lori@wndx ~
$ gem install cocoapods

Building native extensions.  This could take a while...
ERROR:  Error installing cocoapods:
    ERROR: Failed to build gem native extension.


So much for that bright idea.  Thinking that total n00bs wouldn't even have rvm installed, I figured I'd go for the next easiest ruby, the System ruby, because I don't use it for anything at all.


$ rvm use system
Now using system ruby.

lori@wndx ~
$ sudo gem install cocoapods
Password:
Fetching: xcodeproj-0.1.0.gem (100%)
Building native extensions.  This could take a while...
Fetching: cocoapods-0.5.1.gem (100%)
[!] If this is your first time install of CocoaPods, or if you are upgrading, first run: $ pod setup
Successfully installed xcodeproj-0.1.0
Successfully installed cocoapods-0.5.1
2 gems installed

lori@wndx ~
$ pod setup
Cloning spec repo `master' from `git://github.com/CocoaPods/Specs.git'

lori@wndx ~
$ sudo gem install motion-cocoapods
Fetching: motion-cocoapods-1.0.1.gem (100%)
Successfully installed motion-cocoapods-1.0.1
1 gem installed

Yay.  All nice and installed.  And, testing by running rake on the CarenMotion app, I confirm it works just fine. 

 

Now, on to a test project of my own.  I'll be re-implementing the sample project from the iOS Dev School class I took this weekend.  This is a decidedly non-trivial example, so I'm really looking forward to it!

RubyMotion - In the beginning

If you are a Ruby developer or an iOS developer, you may have been hiding under a rock and missed the introduction of RubyMotion (http://rubymotion.com) yesterday. Doubtful, but just in case... RubyMotion is a commercial product, based on MacRuby, which enables you to write iOS apps in Ruby! And if that wasn't enough, Laurent Sansonetti (@lrz of MacRuby fame) is the creator.

So why am I suddenly so interested in iOS development? Well, it's not so sudden. I signed up for the iOS developer program as soon as it came out. Still haven't released a single app. I've worked on several toy apps, and some prototypes for work, but not to the point of wanting to inflict their mediocrity on others by pushing them to the app store. I just couldn't get *into* iOS development with Objective-C. It was painful and hard and testing was almost impossible. And there was always Ruby & Rails, beaconing me back with beautiful, built-in testing, and clean, clear pleasant-to-read code.

Testing. Really. I didn't actually realize, until I was doing some MacOS (not iOS) development, exactly how 'test infected' I had become. I mean, I've been a developer for 25 years, and I didn't start unit testing until my later Java days, so I certainly know that you can develop without testing. I have, however, become impatient with debuggers and the like. I *like* testing. And it was *so hard* to get anything resembling a decent test suite going on my Objective-C/XCode project, that I eventually gave up. That didn't make it any less distasteful, though.

RubyMotion comes with testing built in. I downloaded the sample apps (https://github.com/HipByte/RubyMotionSamples), and here is one of them, with 'rake spec' just built right in and working.

$ rake spec
Build ./build/iPhoneSimulator-5.1-Development
Compile ./app/timer_controller.rb
Compile ./app/app_delegate.rb
Compile /Library/RubyMotion/lib/motion/spec.rb
Compile ./spec/main_spec.rb
Create ./build/iPhoneSimulator-5.1-Development/Timer_spec.app
Link ./build/iPhoneSimulator-5.1-Development/Timer_spec.app/Timer
Create ./build/iPhoneSimulator-5.1-Development/Timer_spec.app/Info.plist
Create ./build/iPhoneSimulator-5.1-Development/Timer_spec.app/PkgInfo
Create ./build/iPhoneSimulator-5.1-Development/Timer_spec.dSYM
Simulate ./build/iPhoneSimulator-5.1-Development/Timer_spec.app
Application 'Timer'
- has one window

1 specifications (1 requirements), 0 failures, 0 errors

Beautiful! And it's Ruby!

Now, don't get me wrong. To write an iOS app, one still has to deal with the CocoaTouch API's. And gawd knows, they aren't the prettiest things in the world. But programming Cocoa in Ruby, with testing all built in, is a FAR more appealing prospect. I was already going to attend an iOS programming workshop this weekend, trying to reboot my interest in iOS development. Now, it looks like I'll be taking that class with Ruby-colored glasses on, and enjoying it so much more than I had imagined.

Thanks again, Laurent!

Not so subtle sexism

You, person who told me to lighten up, saw one little thing. It didn't seem like a big deal, did it? One little line! One joke! One comment! But it's not just one thing to me: it's one of thousands that I've had to endure since I was old enough to be told that 'X is for boys!' It's probably not even the first thing I've had to deal with that day, unless you've gotten to me pretty early. 

That's the main problem with subtle discrimination. It leaves those that it affects the most powerless against it, quietly discouraging them. If they speak up, they're treated to eye rolls at the least, and at the worst, are called oppressors themselves. We're accused of not wanting equal rights, but of wanting tyranny. 

I would just like the million little barbs to stop, and I would like to not be told to 'lighten up'.

I'm posting this in reference to - http://storify.com/charlesarthur/oh-hai-sexism

And, despite their apology (http://gklst.tumblr.com/post/19734620901/geeklist-and-a-public-apology), I did just ask GeekLi.st to cancel my account.

Why? Because the apology is an attempt at misdirection, to avoid taking responsibility for their one truly indefensible action. They not-so-subtly threatened her employment. Not only is that not cool, but it's a statement on the way they think, and the way they will do business. So, I want nothing more to do with Geekli.st. Period.

If you agree, go ahead and cancel your account, too.