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
# Specify the handlers to create in the root logger | |
# (all loggers are children of the root logger) | |
# The following creates two handlers | |
handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler | |
# Set the default logging level for the root logger | |
.level = ALL | |
# Set the default logging level for new ConsoleHandler instances | |
java.util.logging.ConsoleHandler.level = INFO |
package br.com.caelum.teste; | |
import java.util.Set; | |
import javax.validation.ConstraintViolation; | |
import javax.validation.Validation; | |
import javax.validation.Validator; | |
import javax.validation.ValidatorFactory; | |
import org.hibernate.validator.constraints.ScriptAssert; |
require 'net/http' | |
require 'uri' | |
require 'cgi' | |
text = "<html><head><title>Delicious2Google</title></head><body>" + | |
"<h1>Upload</h1>" + | |
"<form action='https://www.google.com/bookmarks/mark?op=upload&zx=#{rand(65535)}' method='POST'>" + | |
"<input type='submit'/><input type='hidden' id='data'></form>" + | |
"<textarea id='xml' style='display:none'>\n<bookmarks>" |
class Fixnum | |
def seconds | |
self | |
end | |
def minutes | |
self * 60 | |
end | |
def hours |
# When anything, including nil, is a valid param and you need | |
# a clear way to know if a param was set or not, use `None`. | |
None = Object.new | |
def foo(a, b=None) | |
result = [a] | |
if b != None | |
result << b | |
end |
# Using Git? Want to ignore changes to a noisy (e.g. tool-updated file), yet have to have it exist to satisfy said tool? | |
# Check it in once to source code control, then ignore all future changes. This option only applies to your local clone. | |
# Use this by typing 'git ignorechanges MYFILE' | |
git config --global alias.ignorechanges = update-index --assume-unchanged | |
# Use this by typing 'git noticechanges MYFILE' | |
git config --global alias.noticechanges = update-index --no-assume-unchanged | |
~/projects/jruby ➔ jruby rbx_actor_example.rb | |
Processing: 0 | |
Processing: 4 | |
Processing: 7 | |
Processing: 5 | |
Processing: 8 | |
Processing: 3 | |
Processing: 2 | |
Processing: 6 | |
Processing: 1 |
#!/usr/bin/env ruby | |
unless RUBY_VERSION.start_with? "1.9" | |
puts "This test file is for Ruby 1.9.x" | |
exit -1 | |
end | |
require 'csv' | |
require 'test/unit' |
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require "rubygems" | |
require "amqp" | |
EventMachine.run do | |
AMQP.connect(:host => '127.0.0.1') do |connection| | |
puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..." |