Rib Rdb writes: "The new parser doesn't support this". Use single line comments instead
The ruby object model is not the same as the java object model. The
$ sudo jruby -S gem install dubious | |
Successfully installed bitescript-0.0.7 | |
Successfully installed mirah-0.0.4-java | |
Successfully installed thor-0.13.8 | |
Successfully installed activesupport-3.0.3 | |
Successfully installed i18n-0.4.2 | |
Successfully installed appengine-sdk-1.3.8 | |
Successfully installed dubious-0.0.1-java | |
7 gems installed |
class ShowException | |
def initialize | |
@html = '<html> | |
<style> | |
body { | |
font-family:arial; | |
margin:0; | |
padding:0; | |
} |
#! /usr/bin/env ruby | |
# usage: gemdir gemname | |
# | |
# eg: cd `gemdir yajl` | |
# | |
require 'rubygems' | |
arg = ARGV.first |
require 'fiber' | |
module Eigenclass | |
def eigenclass | |
class << self; self end | |
end | |
module_function :eigenclass | |
public :eigenclass | |
end |
#Dr StrangeCode or "How I Learned to Stop Worrying and Love the Rails 3.0 Upgrade"* I recently upgraded one of my Rails applications from 2.3.5 to 3.0.0 (and from ruby 1.8.7 to 1.9.2). I took a series of notes of all the problems and issues I ran into. ##Ruby 1.8.7 to 1.9.2 upgrade
hours = case r[6..6] when "M": [0,11] when "A": [12, 18]
# Gemfile for Rails 3.0 | |
source 'http://rubygems.org' | |
gem 'rails', '3.0.0' | |
gem 'activerecord-nulldb-adapter' # for now | |
gem 'jruby-openssl' # for cookie sessions | |
gem 'appengine-rack' # jruby-jars & jruby-rack |
$ jgem install dubious-0.0.0-java.gem | |
$ dubious init hubouhe | |
create hubouhe | |
create hubouhe/Rakefile | |
create hubouhe/app/controllers/application_controller.mirah | |
create hubouhe/public/404.html | |
create hubouhe/public/422.html | |
create hubouhe/public/500.html | |
create hubouhe/public/favicon.ico |
# 30 minutes Lisp in Ruby | |
# Hong Minhee <http://dahlia.kr/> | |
# | |
# This Lisp implementation does not provide a s-expression reader. | |
# Instead, it uses Ruby syntax like following code: | |
# | |
# [:def, :factorial, | |
# [:lambda, [:n], | |
# [:if, [:"=", :n, 1], | |
# 1, |
# In here, we monkey-patch Net::SSH. Beware, there be dragons. | |
# Net::SSH can add hosts to the known_hosts file, but can't remove | |
module Net; module SSH | |
class KnownHosts | |
# Looks in all user known host files (see KnownHosts.hostfiles) and tries to | |
# remove an entry for the given host and key to the first file it is able to. | |
def self.remove(host, options={}) | |
hostfiles(options, :user).each do |file| | |
begin |