Skip to content

Instantly share code, notes, and snippets.

@rubiii
rubiii / Gemfile
Created February 10, 2010 11:06 — forked from samgranieri/Gemfile
source :gemcutter
gem 'rails', '~> 2.3.5', :require => nil
require 'rack/utils'
module Rack
#
# EnforceSSL is a Rack middleware app that enforces that users visit
# specific paths via HTTPS. If a sensitive path is requested over
# plain-text HTTP, a 307 Redirect will be issued leading to the HTTPS
# version of the Requested URI.
#
# MIT License - Hal Brodigan (postmodern.mod3 at gmail.com)
SOAP request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_0.validation.ws.chief.blau.de/">
<soapenv:Header/>
<soapenv:Body>
<v1:validateName>
<validationRequest>
<names>
<firstName>David</firstName>
<lastName>Hasselhoff</lastName>
This example shows how to setup an environment running Rails 3 beta 3 under 1.9.2-head with a 'rails3' gem set.
∴ rvm update --head
# ((Open a new shell)) or do 'rvm reload'
# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.2-head
# Switch to 1.9.2-head and gemset rails3, create if it doesn't exist.
∴ rvm --create use 1.9.2-head@rails3
This example shows how to setup an environment running Rails 3 beta 3 under 1.9.2-head with a 'rails3' gem set.
∴ rvm update --head
# ((Open a new shell)) or do 'rvm reload'
# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.2-head
# Switch to 1.9.2-head and gemset rails3, create if it doesn't exist.
∴ rvm --create use 1.9.2-head@rails3
@rubiii
rubiii / gemspec
Created May 13, 2010 18:12 — forked from defunkt/gemspec
#!/usr/bin/env ruby
# Usage: gemspec [-s] GEMNAME
#
# Prints a basic gemspec for GEMNAME based on your git-config info.
# If -s is passed, saves it as a GEMNAME.gemspec in the current
# directory. Otherwise prints to standard output.
#
# Once you check this gemspec into your project, releasing a new gem
# is dead simple:
#
require "active_model"
# = EmailValidator
#
# Validates whether the value of the specified attribute is a valid email address.
# Borrowed from http://github.com/dancroak/validates_email_format_of and ported to Rails 3.
#
# ==== Example
#
# class User
require "savon"
client = Savon::Client.new "http://example.com"
client.login! { |soap| soap.body = { :username => 'un', :password => 'pw' } }
# Expected debug output:
#
# SOAP request: http://example.com
# SOAPAction: login, Content-Type: text/xml;charset=UTF-8
# <?xml version="1.0" encoding="UTF-8"?>

Hi,

I would love to hear your opinion on the idea of “combining RDoc and RSpec to create testable documentation”. Let me explain:

Given you have several RDoc files like this one:

= Examples

Some example code snippets.