A proof of concept of having Sinatra like routes inside your controllers.
Since the router is gone, feel free to remove config/routes.rb
.
Then add the file below to lib/action_controller/inline_routes.rb
inside your app.
class Foo | |
include Module.new { | |
def this_works | |
end | |
} | |
include Module.new do | |
def this_doesnt_work | |
end | |
end |
These are the specs for the RubyMotion MacBacon UI layer. They will be in the main repo in the near future.
package br.com.caelum.example.monad; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Iterator; | |
interface Monad<A> { | |
<B> Monad<B> map(Function<A, B> f); | |
} |
def output name=((default=true); "caius") | |
puts "name: #{name.inspect}" | |
puts "default: #{default.inspect}" | |
end | |
output | |
# >> name: "caius" | |
# >> default: true | |
output "avdi" |
# The latest version of this script is now available at | |
# https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh | |
VERSION=1.9.3-p286 | |
brew update | |
brew install rbenv ruby-build rbenv-vars readline ctags | |
if [ -n "${ZSH_VERSION:-}" ]; then | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc | |
else | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile |
# Moved to its own repo: http://github.com/fnando/rubygems_proxy |
class Message | |
def initialize(&block) | |
instance_eval(&block) if block_given? | |
end | |
def to(name) | |
@to = name | |
self | |
end |
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'thread' | |
class CountDownLatch | |
attr_reader :count | |
def initialize(to) | |
@count = to.to_i |