 Okay are we ready? May I start? Alright cool. Alright guys so uh hello. So today I'll be talking about Ruby Emotion. Ruby Emotion is a pretty cool tool. You can use, you basically write, you basically write Ruby and it compiles into native code on objectives as Objective-C or Java for Android. So you basically write your mobile app or desktop OSX app in Ruby and basically compiles into the Objective-C and code and you basically write an app with it. This is kind of cool. Right so basically I didn't program any slides I just have some notes here. So basically getting it is pretty easy. You probably got an email from Mike Zio some time ago. So basically you just download the binary zip file, unzip it and just run install it and basically run in basically everything is in the console right so just open your iTunes or whatever and just type sudo motion activate with the license key and of course you have installed Xcode. If you're ever doing iOS apps or Mac or Mac apps you need to download Objective-C or Xcode. If you're doing Android development you probably need to download the NDK and all the SDKs that you need for Android. Creating a project is pretty simple as well. Just type motion create followed by the folder name or the project name. You can add at the back just dash dash template iOS OSX or Android which will basically create the base file that you need for one application. So I can just do a quick one right now. Let's see go into scratch pad so I can do motion create hello right so basically what it does is you generate a whole bunch of files and we go to hello yeah so everything you need is here so it's very much like writing an iOS app so it starts with an app delegate which is the starting point of any iOS application right so it has the same kind of stuff that you need rather that you find in A's in a iOS app and even the method names are pretty much the same or rather it's close to being a one-to-one mapping of what you find in in Objective-C into Ruby right so in this case it's basically creating a root controller view controller and it's adding a navigation controller and then makes it visible right basically same stuff you'll find and to run it you basically all you do is just type motion no sorry it's all rig basically everything you need is in rig so just type rig it basically compiles the app and you can start and basically loads it up into a simulator so you can see it over here it's a very basic app right and you can also you can put a command key and you can actually inspect different parts of this thing you can go and say self.title or something yeah so we can set self.title equals hello again I hope this works okay fine theoretically you can go in and make the changes that you know yeah you know what the property name is and all that stuff so you can actually do use it to do some debugging yeah let's see what they have holy crap okay yeah it's pretty cool it actually does so you keep it's like I was trying to change the title but I guess I was pointing to the wrong place so I'm done just like exit I'm done if you can also run there is a testing framework that comes with the comes with it so okay so once let's go through the notes so basically command command line interface everything is in command line and basically all the things you do is in rig so you just type rig you can see all the tasks that they have so you can basically create a create a archive do the build build it for device or simulator or the default is actually just to run it in a simulator yes yeah yeah if you want you can also generate a static file if you want to include it in an existing iOS project you know just kind of nice so yeah and getting you can also do there's a test you can also run tests as well you know you can break spec so what they have is they don't use our spec but they use a clone of our spec called bacon yeah it's called bacon yeah it's a clone so in that case why I think it doesn't need the full aspect library and because it needs to statically compile it so there's probably some external dependency that is not required so basically as stripped down version the DSL is pretty much is quite quite intuitive in this case the test is failing so I will change this to two because there was like there's actually two windows so I can run that again I should pass hopefully yes pass great yeah so that's for the so you can basically I did this in your favorite to your can use a frame can use emacs there's even if you use really mind we might already has like support for this out of the box like I have a private running right now with here so basically the best part about using remind is that you get all the auto complete that that would come with with this with that stuff so basically if you actually finds all the methods and you can do all the complete this is kind of cool the intelligence rather the sense of that right so it's close to one-to-one mapping of iOS to iOS SDK so basically you have things I have delegate even the methods all look the same that's so you can you have full access to the full you have access to the full view control life cycle the names are pretty much mapped one-to-one one thing that I really that is one thing that they have is I hope you can see this so what some of this you can create like a view controller extends from the UI view controller loads view in this case I'm actually creating a button adding a target to it basically action but action to it basically is everything is here so it's like what we have in an iOS app like a messaging messages that you send in a object you see things are in square bracket and stuff it just translated into into a into a something like this so basically in it with title the second parameter is past past in as a hash so basically it's like whatever comes in subsequently is in a hash right it's kind of nice so it's pretty much for the same syntax that you find in Objective-C and which is kind of cool right so you can even do things yeah so you can a lot and it or you can just do new which is the Ruby way of doing it works as well if I'm running it on on I'm running this in Ruby mind so I can actually run the test I can run it in simulator right so pretty much everything you need and because I bound this to a method we should basically do like put index equals something and basically was echoing out as I press this first one one and two and stuff so basically you can you can see the output in the console as well below and I believe if you if I jump in here right now I can change the label I hope let's see I can change the label self what's this what's the self what label self dot title all right so in Objective-C there's a concept of delegate so basically you delegate a callback that comes with so a little bit has a bunch of callback delegates then basically this is the method that kind of triggers it so this there's a certain API that is correct this is the song you perform on the interface you should be pretty straightforward so in this one you don't actually have set it but if you want to do some action from based on web on the what the user types you have to delegate it to an object so it did not be this usually the best user the usual practice actually to delegate it to the set to the same class you can actually delegate it to an external class or you can pass in another object which is also kind of cool so basically this is the yeah so the similar thing in you were doing is Objective-C this is kind of like how you would do it so you have UI, UI allows you a lot and then you init with title and stuff like that so so this is the yeah what you have here and so button so this is how you how you would be if you're writing a I'll write this in iOS so all the square brackets would mean a method or message that you're trying to send to this yeah so I can run this of course you've seen it right I've seen you run this yeah why this the guys from we might we will be motion also added a whole bunch of sample quotes you can they can download yes there's a sample code project which has a whole bunch of sample quotes they can get all iOS Android and so on so forth it's all very cool like even say it supports all the native stuff that you get on on iOS so like maps you can access to the camera you can provide a sprite kit game this is kind of cool yeah so even Android games and even OS X apps you can get it from here so basically is one one giant people just check it out go into the folder type Rick basically you should run properly you want to load this into your for example I have here right now of a happy bird sprite kit game so basically like stuff you want to do if I want to load this into phone all you do just go to the red file and add this this this item here so basically it's a provision profile you familiar with writing apps in basically together okay right so in order to load an app into the phone for testing you get a developer account once you get a developer account you just log on and on Xcode basically detect all your devices that you want to use for testing and you generate a profile which will allow you to to usually is a one-to-one basically it's like one app as a group of devices that supported and that profile will contain all the devices that are known to work for development you can also create a generic profile which which is not bound to any application so usually they identify application based on a application name so in this case the application name is called Flappy so you can decide the namespace as well calm dot Flappy or calm not matching dot Flappy so that's usually that the app identify so if you what I have here is just a basic generic profile that could work on any app right yeah so it's a team profile so basically it is a profile you can share with your entire team Xcode basically phones home to Apple and downloads and generates the key for you I think other preferences accounts you can yeah yeah the old way is actually to go to the developer side generate the profiles on by one download the file and yeah you can actually create one if you need one I can just download new stuff usually you have to go to the website developer side to check to create a new app and once you create a new app you want that you wish to publish you will basically create a new profile here for you they can you can then download and registering devices is now done to Xcode so Xcode registers your device with something signed by Apple the phone is looking for yes yeah so yeah so so basically once you add this provisioning profile you can then deploy this into the device so I'll try and run this on a device now run on device which basically just basically is running Rick Rick device and it should it will come compile the app and just try to load it into the application is running but it's not showing up yeah it was for a lock okay so about that run device and I'll try to bring up so I create a new movie recording why why not there you go so this is this is actually you see what on my phone now we crashed my what essentially you have something it is yeah so it's something new that was added in in your use a mini so you can use the quick time to basically they're using this basically to like capture screen flows that you can then publish onto onto the app store yeah so the screen for you see the app store usually comes using this this very straightforward kind of recording so basically takes whatever is on the screen and help yeah no not really so which is which kind of sucks anyway yeah yeah so that you can basically interact with it can pass you the phone later if you need to play around yeah so when you're done it just close it yeah yeah so let's see what else is there okay so one more mapping right so the what's on advantages is like you there's no separate file that in Objective-C they actually have they require to both the header file and implement file which is kind of irritating so she's kind of like yeah so the header file which tells us what it has what what methods to expose and implement files yeah it's just a seat but the movie is just one file that handles all the memory management and all that stuff for you which is kind of kind of great yeah so there's no need to worry about memory management because we'll be motion that's all that for you so basically it will be a compile to OSX or iOS or Android the syntax rather than the files that it creates are a little bit different for for a OSX app for example OSX app it's the files like you still have delicate because it's an Objective-C but uses other things like menu which helps you generate the menu and all that stuff yeah so it's a little bit different for each of the platforms that you're building for for Android you create that the main activity but you saw the main activity file and you'll be in Ruby and stuff like that so yeah so you still need to know a little bit about the platform specific things that you need to work to work for testing tools as I said there's a there's a raw aspect called bacon for QQ you can also write acceptance tests using a cucumber like app called color bash I don't have a working sample but there's a there's some documents they can this is a website color bash which is yeah basically you can do you can automate clickings or swiping and all that's all the actions on the screen do I have to use color bash or sorry yeah I think I think there might be there might be I haven't really gone in depth right so in basically you can add to a party libraries using Ruby gems you can you basically have a there's a gem file which you can go in and then add additional stuff that you need so like the gem follow something like this so in this case they actually generates a yeah and you but the gems are very specific to Ruby motion so the guys at Ruby motion has has helped fully created a site for this trying to find it the route the motion to box has a whole bunch of gems that are Ruby motion compatible because mainly you need to have the library to be statically compiled so they can be included into the application so it says how you add to a party and stuff that you need let's see what else is there yeah so start a study compile you've seen a demo so there's three there's some projects so for example you can see that the coding coding an app in Ruby you're still following the same way of writing stuff in Objective C so it's like one to one mapping but it can be a little bit cumbersome and in this like a lot of things need to deal with so some guys has actually put together a Ruby DSL so you can just use that those DSLs right like simple things like bring up alert view of showing the camera and saving the images and stuff like that so bubble wrap is one of these projects which is kind of cool as well so yeah so basically it has so it has a whole bunch of different stuff you can do it has HTTP wrapper RSS parser you want to have access to the camera you can actually use that location is off here so let's have a look at the camera so it has a Ruby like for example this you want to do this in Objective C they'll be like you need to create a UI image picker and some other stuff a lot of boilerplate code so this guy this library basically wraps all that up into very simple DSL another one I've seen is promotion promotion yeah so promotion is another one which has it's like instead of writing app delegate you also it has a simpler DSL for doing this that's on load you can tell which screen you want and some of that so it's a very much Ruby like simpler DSL they work with it's all right all right cool there's even a I found this just recently it's called Nitron so basically lets you access the date I think it's a call data call date so on iOS there is a SQLite database they can load that you can use and this is a simple wrapper that lets you talk to the call data or rather the SQLite layer which is should be yeah so called it call data active record support so it's got active record kind of DSL it's kind of cool so in running an iOS or objective seek project there is usually a thing called interface builder so they have a storyboard which has which you can then drag and drop elements and even manage a flow between one screen the next screen and stuff like that you lose the use of this somehow because you're not you're not good doing this in the next code but there are libraries that lets you that lets you kind of still work with them or generate them in the command line one of them is called IV so it creates IV outlets for motion there's also a sample project that I found which shows you how we can use Ruby motion with a storyboard storyboard is like a drag and drag drag and drop we which kind of shows you can drag and drop elements and arrange them in on the screen yeah so it's kind of nice also for you for learning we motion there is a video podcast called motion in motion which is kind of kind of nice as well so it has a whole bunch of videos you can just watch and to learn so there's a series that you have now we're motion for Rails developers so for Rails developers can watch this and pretty much get a good sense of how everything is put together yeah especially we have no experience writing Objective-C or there was that so it gives you the it helps you mind it helps you map the concepts of all introduces introduces you to the concepts of in motion yeah and maps it to how it's like in in Objective-C it's kind of nice there's a you pay for subscription sorry yeah this is quite a lot they've been doing this for I think couple of years yeah I just got a subscription recently so it's kind of cool it's about 990 for per month so it's I think we good to get it and so you guys can learn yeah so his examples are mostly iOS I don't think he has any Android examples yet yeah yeah so anyway the guides on the Ruby motion website is actually quite quite quite good it also shows you how to write stuff in iOS and Android and even has a nice document on testing how do you write tests in in real motion right so it's kind of cool yeah I'm not yeah I'm not right I've not tried putting the any of Android apps yet so yeah yeah because I think we need to set up quite a fair bit of stuff like SDKs and DKs you got downloads on it yeah yeah only I only have like the yeah so I'm not actually tried like because if you use a library like oh right you would basically include all the stuff that you need like say call call location and all this extra stuff like when I was writing iOS apps I have to worry about adding the proper libraries and and I'm not sure how we will be motion I can handle saw that for you so it's something I get to explore yeah sure I last I checked there's only probably two or three yeah so there's only a few gems which are some other right now yeah so we won't this motion to box organizes things into the categories and stuff and even to the platforms so it's kind of kind of nice so on audio library it shows you which one to use because to the yeah I like what I really like is is a one-to-one mapping to to objective see so basically what you write in movie maps directly to it so it's like then you just not much so any doc any objective see or iOS specific documentation you find online would definitely work or rather we should be relevant to writing stuff like last night I was trying to create that UI alert view this UI I love you I forgot the syntax so this guy went online and Google the syntax you know objective see I got mapped it in so yeah yeah so it's like UI alert view yes you can actually under the guy on testing I believe there was something about duration device events finding views hmm okay yeah oh debugging sorry there is a there was a debugging there you go yeah I'm doing command for safe yeah nice okay yep so yeah so that's that's all I have actually so any any questions yeah if you're doing like a say a complex interface yeah I'll probably use storyboard and use auto layout to come drag and drop stuff and then try to consume that sorry what in so does Ruby motion allow you to like design interfaces or that's just purely like code so thanks we have code right now have you done any non-trivial apps no yeah do you know that yeah so interestingly one of the companies in Australia the frontier is doing a lot of motion for but I know like they said I mean that they actually have a really blog post on the other one of these I'm really interested in finding copies like if we you know in terms of Mary but our resources for it we made sense to just like focus on certainly or or yeah yep I'm not sure, I'm not sure, I don't actually try it but you can try and port a, you can probably try and create a gem, if it's a library that is shared between the different projects, you would create a gem, wrap it in a gem and it should be straightforward. It would be interesting to see how easy it is to mix and match. I think the other thing for me though is that that's why you can make decisions in individual development, but what I'm saying is that in terms of where we place our resources, in terms of how we do it, I think that's how it ends up. The other thing is, what it seems from what Michael's saying is that it's a guy who is basically working in the same framework to do the promotion and then as that's a hard part of learning something that's already framework used. So I don't, it doesn't look like it's wasted effort by the side. No, it looks, now we have to expect it from a perspective that it was the only other way to do it. So, yeah. But I think you can rewrite everything in Ruby. From past experience managing an app using Xcode is a whole lot of stuff you need to deal with inside the IDE, like dependencies and all that stuff. And even making sure it's got the right configuration for which target it's deploying to and all that stuff. So I think if I can manage all that in code as simply as just updating a rig file, that is actually pretty nice. I mean there's actually documentation on the runtime. There's even a section on memory management. So you can actually do a bit more granular control, like weak references and stuff like that. So this page actually gives you a fair bit of overview of the more fine grain controls you want over how things work. Yeah, we do. There's an email from Mike Mazzur some time last year. If you're not familiar with the UI elements, this is all that. Terminology and some sample code here as well. So basically what you see here pretty much can map directly into remotion. It's kind of nice. Like a UI overview, like what I've shown you just now. So basically the behavior, the callback, that's why I use it. Yeah, dismiss, click the button. How long does it take remotion to get the latest iOS updates? I'm not sure, but updating remotion is fairly simple. I think you just type pseudo-motion updates. So you need to wait for your motion to support whatever's new in the framework. So you can utilize it. Like sweet things, bags, and other things. People I know would really accept it and please with a sneak at a remotion. Do you know what's in the background about the people behind remotion? No, I'm not familiar. I don't remember the details. I probably wasn't wrong, but my instinct is because I've read about this once. It was some people who were really heavily involved at Apple and really understand this stuff. Decided to make this. This wasn't just some pretty fanboys who were like, we'll figure this out. It was like, I know how this stuff works in Apple. So the name? The greatest name. Yeah, I used to go up and eat. I think we found a bridge of some other thing that wasn't wrong. We did Mac Ruby. One of them is coming for Red Dot Ruby Conference. Mac Ruby wasn't related to anything like that. One of them is coming. Yeah, he's coming. All right, there's relevance. Yeah, he's coming. All sort of cats. I'll share this document later and you guys can check it out.