The Changelog: Software Development, Open Source - CocoaPods and MacRuby (Interview)
Episode Date: April 5, 2012Wynn caught up with Eloy Durán, creator of CocoaPods to talk about the project, MacRuby, and his favorite Objective-C libraries....
Transcript
Discussion (0)
The Change Log is brought to you by Pusher, and they're looking for a system engineer who specializes in evented systems.
If that's you, send your GitHub profile, a cover letter, and your CV to jobs at pusher.com.
And also use the coupon code THECHANGELOG to save 15% off your first month billing.
Join the real-time web today at pusher.com.
Welcome to the ChangeLog episode 0.7.8. I'm Adam Stachowiak.
And I'm Winn Netherland.
This is the ChangeLog.
We cover what's fresh and new in open source.
If you found us on iTunes, we're also on the web at thechangelog.com.
We're also up on GitHub.
Head to github.com slash explore.
You'll find some training repos, some feature repos from our blog, as well as the audio podcast.
And if you're on Twitter, follow theChangeLog and me, Adam Stack.
And I'm Penguin, P-E-N-G-W-Y-N-N.
Fun episode this week, talk to Eloy Duran of the CocoaPods project,
which is basically bundler meets homebrew,
except for, I guess not binaries, libraries for your Objective-C projects,
your Cocoa projects.
So no more downloading tarballs from blog posts to drag into Xcode.
You now can install all those frameworks that you want to use directly from your command line.
How about that pulling down and dragging over was a pain in the butt, huh?
Yeah, I think GitHub has changed the way we all work in the Ruby space.
We're getting, I guess, penetration into other communities.
So hopefully this will just further the way we share Objective-C libraries across those projects.
And I hear you also talked a little bit about PassengerPane.
Yeah, he's the developer of the preference pane for Passenger that I know you and I both used.
You either have the choice of editing the big config file in Apache
or if you're on the Mac and you want to install Passenger,
which used to be Mod Rails, there's a nice little pref pane
you can snap into the Mac to configure all of that.
He's the author of said utility.
And if you're around, I guess, this August and you're into Ruby since we just mentioned Ruby,
MadisonRuby.org, we're actually going to be there.
Wynn and I are going to be there doing our famous design eye for the dev guy or gal.
Or gal.
Or gal.
So if you go there and you go to slash registry, you'll see that we're actually one of the workshop choices.
So if you want to learn how to do the HTML5, the CSS3,
and throw a little SAS and Compass in there, we'll teach you how.
Well, color theory, a little typography,
just basically the science of design as you and I have bloodied our nose on it along the way.
Absolutely.
Well, this sounds like a fun episode. Do you want to get to it?
Let's do it.
Chatting today with Eloy Duran from the CocoaPods project.
So Eloy, why don't you introduce yourself and a little bit about your background.
Hi, Wyn.
My name is Eloy Duran.
I've been a long-time Ruby developer. We're always interested in Cocoa development.
That's actually how I got started with the development.
I just wanted to get something done for OS X and application.
And by that time, I found Ruby Cocoa and things started for me with programming.
Since then, I've worked on, I've been on the core team of Ruby Cocoa, MacRuby.
I've done a lot of Rails work, like AcceptsNestedAttributes4.
Yes, that's the one.
The PassengerPane, MacFim with a file browser, and now Cocoapods.
So let's talk about CocoaPods.
It's basically a package manager built on Ruby, but for Cocoa frameworks, right?
Correct.
So at Fingertips, we've been doing Objective-C applications for clients for a while.
And as I'm spoiled by the Ruby development environments like
Ruby gems and bundler and whatever I was starting to get a bit frustrated by the process of
integrating open source libraries into a project and since I don't want to spend too much time on
getting something to run and then afterwards find out that it might not be what i needed i found that i didn't use that many libraries also because it's very hard to find
them i've found and so every time i would find a library that would do what i needed after the fact
and at some point i think it was they released the the what what did they call it? The iOS template, something like that.
The boilerplate template.
And so by that time, I figured if the solution in the community
is going to be like templates,
then what I wanted, like a package manager,
wasn't going to happen anytime soon.
So yeah, then you need to stop complaining
and start implementing is my motto.
Absolutely.
So outside of CocoaPods, the normal procedures, you find a bit of open source on GitHub if you're lucky, and it's well done.
And then the instructions say, hey, drag this to your frameworks folder, right?
Yeah.
It tells you to clone and then add it to your project and then add the required build settings add the required
frameworks to link against and then usually it will miss one or two steps because the author
forgot to update the readme in while developing on it etc etc it can take you like an afternoon
that's just lost so how much of this does coco pods Everything. So what's the workflow
turn into?
So it's comparable to
a bundler. You have
a file where you specify which
dependencies you want to use.
And as long as
there are specifications for that
library, it will
automate, it will create
a separate Xcode project where it will include
all the dependencies and that Xcode project will then produce a static library. And the static
library is then your app, your application probably is linked against that static library.
And that's all done in a workspace, which was introduced in Xcode 4. And that's all done
automatic, all set up automatically by the tool.
How are you persisting settings?
I know NPM has its JSON file and there's a gem file for Bundler.
What's CocoaPod use?
So in your user project, you will use a POD file.
That's what it's called, just like a gem file.
It's very similar.
And the specifications for the libraries themselves
are probably more what you meant by
NPM. It's a pod spec, like a gem spec. I mean, I try to reuse a lot of RubyGems code as well.
So things like the version class is already very well done in RubyGems. So I'm just using those
things. So they're very similar if you're used to RubyGems and Bundler.
Have you developed a newfound appreciation for YCats and the Bundler team
for what they've done with Bundler?
Oh, yeah, definitely.
Well, I mean, I think like a lot of people that are passionate about their environment
and have seen the whole environment grow from, I think we were,
at least Fingertips was using real since the since a month after the
first release so we've seen that the environment grow and then at some point you start to feel
like things like bundler make things more difficult especially because we're actually
and that might be a bit weird where people that don't like a lot of dependencies so it might be
weird for me to implement something like coco potsPods. But it got a bit frustrated.
And obviously, you have Twitter and the bar is very low and you start hating on stuff in quotes because it's not really hating.
But yeah, definitely.
The way I see it now is that once people start hating, putting quotes passionately about CocoaPods the same way they do about Bundler,
then I'm satisfied.
Have you found any barriers to adoption of it being a Ruby runtime
and having to reach outside the Ruby community to pull people in that might not have the Ruby stack?
So you mean users, right? Not collaborators. Right. Yeah. Users that just want, want to use the, the CocoaPods to, to pull down frameworks and
install, but may not be Ruby savvy.
Well, in the beginning, uh, it was way more because by that time I was using Mac Ruby,
um, because a Xcode project is a P list and I just wanted to read it and write it without having to do anything difficult.
And MacRuby, since it interfaces already with the Cocoa frameworks, that already supported everything I needed to just go ahead and build the core code.
I already knew, of course, that that was going to be a hassle for a lot of people.
People just don't feel they want
to install something extra an installer or whatever um so right now we've switched to mri
it works on mri that has brought a lot of more people in it because it will just work well
nowadays again it won't because with the new xcode 4.3 you have to go through all these hoops to
install the right uh compilers and things like that.
But in general, it will just work and people will use it.
On the collaboration side, however, that's obviously a lot more difficult because a lot
of people have never written any Ruby or seen it.
But yeah, I mean, that was to be expected.
I'm seeing a lot of collaboration though. So I don't want to
put that down. There's a lot of people, especially like one guy that never wrote any Ruby and had a feature request and we started talking and then a week later he was implementing everything. So
that's cool to see. As an open source project lead, I mean, it's fun to watch people come into the community
and dip their toe
and ask for something
and then better yet,
come back with a patch for it.
Definitely, definitely.
Well, I try to steer it that way,
of course.
You can't do everything.
And sometimes you see
the benefit of a feature,
but you have to prioritize
and there's so much still to be done
that I can't get to all the fun features and there's so much still to be done that i can't
get to all the fun features yet um and so i try to steer people to uh i like to discuss
code not so much just uh bike shedding i want to prevent bike bike shedding so uh asking for
patches uh and helping them out to get that patch done really helps and then once somebody
has something merged in they'll they'll feel much more um invited to uh to do to work on other
patches and uh tickets and that's worked out great for me so speaking of features and and patches
what what do you see the roadmap for coco pods being so that So that's, I'm not thinking too much about version 1.0 yet,
because that's where, for me, the big transition will be between.
One of the big things that will have to change at some point,
I think, is the way we distribute all the specifications.
Currently, that's done, it's similar to Homebrew.
So the specifications are all in a Git repository
on the CocoaPods organization on GitHub.
And that works great
while we're still actively developing stuff
because it's very easy to change the API
of the specifications and go back and update them all or even have a branch of the specifications while we're working on a new API changes.
And that would be very hard if I would have started out with some kind of real server or whatever that accepts JSON, talks back in JSON.
I mean, this works much easier for for me especially because i need to embrace the
community as it already existed and object to see community already exists for a long time and
there's a lot of people doing private stuff internally so having just a having them just
create a grid git repository for internal private specifications is the easiest thing that i could
come up with and that i mean that i want as less friction as possible for everyone until we can converge into well the final
way it will work and that will most probably be a server like ruby gems has as well so does
cocoapods require a formula to use homebrew terminology to be in the specs repo under your org or can you install from someone
else's repo specifications you mean right yeah so what cocoapods does is it just checks in your
home folder under a dot cocoapods directory for any directories which are expected to be
specification repositories and so you can just add a directory, add your specification, and it will be usable.
And there are many other ways to inline in your pod file.
You can define a specification
if there isn't any specification yet,
or if you have a fork or whatever.
There are many ways to add specifications
and use them without having them in the public specifications
repository.
I wanted to switch gears, talk about MacRuby for a moment.
It seems like a couple of years ago, it was red hot.
And then everybody that was in the Ruby community was excited about MacRuby.
What's the state of that project the state of the project is currently um i think there are a lot of people
uh still if you watch the mailing list there are a lot of people still working with it i personally
haven't had the time to work on it as much as i used to so i can't speak for the community as it is right now but one thing that's definitely for sure is that
the main developer, the lead developer, Laurent Sansonetti
isn't working at Apple anymore
and he has had to move and things like that
from the US back to Europe
and I mean, it has stalled a bit for now, but as I, as far as I
know that he will pick that up again. And then, um, I'm sure he has all kinds of ideas, but we
haven't catched up about that yet, but the way I use it, I mean, we, we, I still use it. And, uh,
we have a client for instance, where we just recently, uh, implemented a specification runner, a test runner in MacRuby for their Objective-C
iOS classes, where they wanted a visual representation of the state of the game.
And for that, it works great.
So yeah, I'm not sure what to say about where it's heading or going, because I can't speak
for that.
I haven't been that active the last few months. one of your more popular projects is passenger pain it's a
pref manager for fusion passenger was that a mac ruby project as well it was a ruby coco actually
by that time there was no mac ruby yet um yeah the difference is marginal. It was Ruby.
You can see it on our repository and browse it. But we've rewritten it to be Objective-C.
But unfortunately, my colleague hasn't had the time to finish that up and release it yet.
What was the motivation behind that project, just scratching your own itch?
Yeah, everything I do is scratching my own itch.
I have so many itches, and that's not because I don't shower and stuff.
I mean, I feel the need for stuff when I'm doing it.
I don't think I ever really had like, it would be fun to do this or nice to do whatever.
I don't even have the time for that.
I just come up with things that have to be solved while I'm working at work, at my job.
And that tends to take up most of my time already.
So, yeah, it's all just scratch itch and the passenger pain.
I'm not sure what the specific.
I think because we're a consultancy we just have so many
applications at any given time on our hard disk um yeah so passenger pain was mainly i i think
because we're a consultancy and we have so many applications at any given time and we just want
to easily add them see which one have been added or what are the configured domains, things like that.
And that's basically everything it does.
It doesn't show.
And there have been a lot of requests for thingies like, I don't know, tail specific logs or whatever.
But that's just not the goal.
The goal was just setting up applications, having a quick overview of which applications you have set up
and add aliases for their server names, things like that.
So what are you scratching these days?
Oh, I really, really, really, really have to not scratch anything else at the moment.
CocoaPods is so much work. And I really have to even find the time to get to coding
on CocoaPods because there are last few weeks at least, let's say last month, I've been doing so much project management because people are starting to do a lot of it, I would actually just yesterday I came up with something that I'm just now whenever I come up with something, I'll just put it on Twitter as my wish list.
And if somebody knows of something that does it or wants to implement it, then I'll be very happy. was a Ruby library that will give you divs of arrays and hashes and strings,
but a unified div, and preferably with red and green colors.
Because, yeah, I still find that in many testing frameworks that I work with,
I still have to manually compare huge hashes or whatever,
and that just takes up time.
So that's something I would normally tackle right away,
but I really have to refrain from doing those things
because otherwise I wouldn't have any time for other things left.
Hey, Adam here.
I just wanted to take a moment and thank our sponsor, Hover.com,
for supporting the show.
We certainly appreciate their support.
Hover is by far the best place to register your domains.
We recently took advantage of their domain concierge service, which is completely free, by the way.
We had over 30 domains that needed to move over from GoDaddy because, you know, for obvious reasons why, we didn't want to use them anymore.
And Hover took care of everything.
They took care of all the heavy lifting.
It's this special service they have. It's called their Domain Concierge Service, which basically means you don't worry. They do all the
work. They move over all your domains. They take care of recreating your CNAME, your A records,
your MX records for your email, everything. All you do is sit back and relax, and it's completely
free. You actually talk to a human being to set it all up. It takes about five or ten minutes.
You call this 800 number, 866-731-6556.
And like I said, you talk to a human.
They take care of you.
They make sure that you're good to go.
And just tell them what the changelog sends you.
Use the coupon code THECHANGELOG to save 10% on all the services that apply us to.
We certainly appreciate the support, and thank you for trying them out.
Hover.com.
So digging into the pod spec format, I first thought this was closer to a GIMP file, but
it's actually closer to a GIMP spec.
Yeah.
Yeah, so there are two things.
So like with Bundler, because pods, as we call them,
Cocoa pods, aren't installed into the system
like RubyGems normally does.
They're only used in a project.
So that's more like a combination of RubyGems and Bundler.
So you have two things.
You have the pod file, which is like the gem file with Bundler,
and you have the pod spec, which is like the gem spec in Ruby gems.
So Jonah Williams from Twitter asks,
how do you push for greater adoption of pods?
And what advice do you have for getting sourceless pods?
Sourceless pods.
I'm not sure what that means. I'm not sure what that means are we talking about binaries or what
it's the problem there are things like um like test flight for instance do you know test test
yeah i use that all the time okay cool um so they don't provide a they don't provide the source for
their sdk they only provide a pre-compiled static library.
Maybe that's what he meant.
Well, first of all, I would say to the TestFlight team,
open source it, but obviously they have their reasons.
And it already works
because the pod spec can indicate libraries
that the user's project should link in,
which is normally used for things like
if a pod requires libxml or whatever.
But it works just as well for any other static libraries.
So it can already be done,
and there are people discussing this
on the CocoaPods issue tracker.
I guess if that's what he meant, then it works.
But I would still prefer, of course,
an open source version.
But what can we do further to push for greater adoption?
I think I haven't done any big announcement yet
on CocoaDev.
That's the big Cocoa mailing list.
Because I first, there are a lot of things that I first want to have done before I open the floodgates.
Because I think these are things that a lot of people will ask about.
So I would, yeah, I don't know.
That's not the way I work.
I want to have a
reasonable assumption of what people are going to need implement that and then announce it in the
meantime it's open for everybody to discover but i'm not going to announce it and then say oh yeah
that doesn't work yet that doesn't work yet that doesn't work yet so that would probably push a lot
of adoption once i finally do that until that time what we really need is people
that that use libraries to migrate them to uh to using them through coco pods so creating
specifications for that even if it's and if it's if they do it only locally like in their pod file
in line then please also take the time at some point to extract that
and push it to public repository.
And I think the faster we get to the point where it's like the big 1-0
and where that's also the time that we'll do like big announcements,
well, that will definitely help if people want to help out.
So just go onto our mailing list
or the issue tracker and ask what things what you're good at what you if you want to help out
with certain areas or whatever and there's plenty of work to do i think that's really the the biggest
important thing right now is to get some of the important features done so that we can really
really start driving it one big thing and i'm
sure you have listeners that are very good at that um it's uh things like like the rails guides
uh guide for if you're if you're a user of coco pods how how how to set it up initially that's
obvious but but also guides for library authors.
Why should they care?
How do we handle versioning, semantic versioning?
Why do we do that?
Why not just git hashes?
These are questions that we get all the time from library authors.
So, and right now that's scattered over.
We do have wiki pages describing these things,
but having a good set of coherent guides about these things
would definitely help authors understand how we do things
and why we do them that way.
And then contribute specifications for the libraries.
But it's picking up.
I mean, in the meantime, I'm very glad the way it goes
in the way that I haven't announced anything,
but people are discovering it by themselves.
And adoption is definitely every day more.
So I guess we'll get there.
What we really need is time.
If anybody has some lying around.
You play in a few different communities, namely Ruby and Objective-C.
And I think in the Ruby community, GitHub by far is the center of gravity
for our open source work.
But it's not true of every community.
There's other repositories and other community sites
that house the bulk of open source or shared source projects
in those languages.
According to GitHub Explorer, Objective-C is the 10th most popular language
on GitHub.
Have you found that the bulk of Objective-C and Cocoa open source that you found is on GitHub?
Or are there other places where they're playing?
Before I started on CocoaPods, I found that the majority of the libraries that are being released
since the inception of GitHub have been on GitHub,
but the Objective-C community goes back way before GitHub.
So there's a lot of people just posting tarballs on their blog,
things like that,
or they use SourceForge or whatever what have you uh bit bucket i guess
um i yeah i think a lot of the people that since we have ios that's a whole new community you have
the older object to see community and you have the new objects community and the newer ones
tend to use github i think i haven't seen many that don't use GitHub.
But some of the older libraries, the older authors, yeah, that's not that easy.
They tend to be all over the place.
So Git support in Xcode is relatively new.
I'm trying to remember which version introduced that.
But have you seen a spike in GitHub adoption as that feature rolled out into Xcode?
No. spike and github adoption as that feature rolled out into xcode no and i think they already had git support before i started on cocoapods but i'm not entirely sure i'm not i'm i'm not a big
xcode.app user personally so that's interesting what are you using and i guess are you still
using mac ruby and ruby coco more than straight Objective-C?
No.
I mean, it could be anything, any given day.
So I use MacFim.
That's why I wrote the file browser for it.
I used TextMate before that, but TextMate was just getting too slow for big files for me.
And that's the reason I switched to FIM.
And I still feel like a huge
fim noob uh i mean people look at me weird why i would even want a file browser so um i do
everything there so that i know just the set of commands and editing tools that i tend to use
xcode editor i'm not a real big fan of i'm i'm not a real big fan of Xcode.app at all.
It just does things the way my brain doesn't work, I guess.
And obviously there's still a lot of issues with Xcode 4.
That's no secret.
Everybody complains about that.
Listeners of this podcast won't blame you for using Vim by far.
We've had a few episodes now where we talk about everybody's favorite text editor, but you're using Mac Vim.
That's interesting.
What draws you to the GUI shell around Vim that you don't get from the terminal?
I'm a GUI guy.
I think that's the simplest solution.
I'm not particularly interested in computers, actually.
I just want things that work.
And I love the terminal.
That's not the reason.
But I find that the GUI and the set of key bindings that I know for any other application on the platform, in this case, OS X,
I find it more intuitive to seamlessly switch those things.
And I like a visual file browser that has a contextual menu for thingies.
And that's not the way people work in the terminal, I find.
That would mean I would have to really more master FIM.
And I don't really care about that.
I just want to get the things done that I want to get done.
And I feel I'm more productive in an environment that allows me to use the GUI instead of looking at a beautiful terminal.
But yeah, the only way to really interact with it is the keyboard.
It seems a lot of folks go one way or the other.
They're in a full-blown IDE like Xcode and everything's in really one window or one app at least.
Or they'll go to the terminal and they'll multiplex with Tmux or something like that.
If you're in this in-between world, how are you managing your test suite run loop and what other tools do you use other than Macbend to work?
Not much. run loop and what other tools you use other than macbend to work um not much i used xcode just to build and if if possible i'll just use xcode build on the terminal because i really do love the
terminal and and navigating through source that way um but i'm i'm i'm fairly simple i i just use i just use macfam but it could have just as well
been text edit i guess um so i'm i'm not really the right person to give any information i think
on uh on certain uh speed editing tips or whatever um by the way, regarding Xcode,
I recently heard about AppCode, I think.
I haven't used it myself,
but it seems to be that there is an alternative
for Xcode.app if people are feeling
that Xcode 4 isn't helping them out.
So that might be a tip.
But I just run tests, things from the terminal like most people in the Ruby community do.
And that's basically it.
I'm not sure if there's anything specific you would want to hear.
So as manager, maintainer of this project, I'm sure that as specs are added,
you're constantly discovering new open source in the Cocoa world.
What are some of the most interesting projects that you've seen come across your radar?
Oh, I've seen so many nowadays that I have to really think about that.
Definitely one, because we're so spoiled in the Ruby community with blocks, called uh block kit by uh i'm not going to uh butcher his name let's see
what is we'll add that to the show notes yeah it's uh z zachary waldowski uh blocks, that's a very good one. I use QuincyKit, which is a crash reporter.
It's a bit like TestFlight, but another one.
JasonKit, obviously very fast at JSON handling.
It's amazing how we have these naming conventions in our different communities. So Kit and the Cocoa world is what in Ruby we would at one time access or
foo or any of these other trendy names.
Yeah.
Well,
Kit,
I think Kit was originally more like a,
like a framework.
I did.
So Kit me implies it's a framework,
not just one,
one problem solution,
but I'm not sure it yeah but it's definitely a
objective c coco naming convention i wasn't a big fan of the whole acts as a naming convention by
the way it didn't it it it felt like at some point people were just trying to mingle the names into
that and it didn't really it wasn't declarative anymore
at some point but i forgot a few specific names so maybe just cut that out we mentioned uh test
flight a number of times and i'm a big fan of test flight so uh for those that don't know it's
i've used it for ios applications to do over-the-air betas to beta users before we put them in the app store. What, um, I guess that's how you're using it as well.
Yeah.
Well,
I,
I used test flight.
I used to use test flight,
but I don't,
I don't use it anymore.
I've switched personally to a hockey app.
I've seen that one too.
So what,
what do you like hockey over test flight?
Uh,
first of all,
I pay hockey app.
So I know I am the customer um that might be uh i
don't know that's my ideological way of how i look at products pay for apps that you use so that you
know they'll hang around well i mean the more the way if if you're not paying for the app, then you are the product. It's more the feeling I get with it.
Also, I wasn't able to upload small binaries stably last time with TestFlight.
So I started to get a bit annoyed about that.
And Hockey App is a bit simpler, especially in the way it looks.
It isn't that lickable UI that you have with TestFlight.
But it works for me. And I just want to be able to upload the binary and have it work and um and they i have their crash reporter and and also
their other uh beta update ap sdk that's all open source i also really like that because i can just
dig in and see what it's doing or change something
yeah but obviously if test flight's working for you it's working i just i don't really like the
whole if you're not paying for it then you're then you're the product type of feeling so true
so who's your open source hero um i don't have like a real hero hero but the one that that really taught me a lot of the
well just basic programming stuff as well is definitely laurent sansonetti of ruby coco and
mcgruby fame i mean he's a belgian but he does awesome stuff you want to hold that against him
no um we'll i mean he he he promised me a lot of good beer, so we'll figure it out.
Well, thanks, Eloy.
Certainly appreciate your insight into CocoaPods and Objective-C and Ruby.
This is an exciting project, so we'll help spread the word and hopefully get an influx of new specs into this thing.
Yeah, definitely.
Thank you.
And even if they're just Ruby developers that feel like they want to work on some side project thing but don't have a real itch at that time,
I can use any Ruby developer to just give a shout on the mailing list and we'll get you something to do.
Absolutely.
Thanks, Eli.
Yeah.
Thank you too, Wne and Adam by proxy.