RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

galori — 5 posts

http://blog.ragingstudios.com

"swift-ruby" is designed to bring over some good features from Apple's new Swift language to Ruby:

https://github.com/galori/swift-ruby

I implemented only one thing, the ? Optional method operator..please jump in and submit some Pull Requests!

Background:

I just came from Apple's WWDC and watched their introduction of the new Apple Swift programming language.

From Chris Lattner, a Swift developer at Apple personal site: "Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list."

The ? Optional operator is equivalent to ActiveSupport's "try":

The active support version would look like this:

e = Employee.new
e.try(:transfer)


The Swift-Ruby version:

e = Employee.new
e.transfer?


So, clone the repo: https://github.com/galori/swift-ruby, see Apple's reference: https://developer.apple.com/swift/, and submit some PR's.
I was surprised at how minimal the code actually is. Here are the steps:

http://blog.ragingstudios.com/blog/2012/10/24/absolutely-dead-simple-login-system-for-rails-with-omniauth-and-facebook/
I just posted two new blog posts covering some useful git actions:

Using git to tag deploys and then using the "--contains" switch to determine the exact time & date a certain feature went live: http://blog.ragingstudios.com/2011/06/05/when-did-this-feature-go-live/

..and a collection of useful git commands and workflows, including Diffing Diff's, common ancestors of commits or branches, recommitting a commit, viewing a file in another branch without actually checking it out - and more: http://blog.ragingstudios.com/2011/06/05/i-heart-git/
array#only for ruby  blog.ragingstudios.com
A small post providing a semantic replacement for array.first when you only expect it to contain one item.
simple-useragent” gem - provides the ability to for cleaner browser specific CSS targeting*. For example, instead of the targeting IE7 with a CSS hack such as: *:first-child+html #content {height: 500px;} /* IE7 */ - you can now do this: .ie7 #content {height: 500px;}