This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def my_haml_helper | |
haml_tag :div do | |
haml_tag :span, 'foo' | |
end | |
end | |
would produce: | |
<div> | |
<span>foo</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in file helper_test.rb: | |
def haml_tag_helper_method | |
haml_buffer.options[:escape_html] = true | |
haml_tag :div do | |
haml_tag :span, 'foo' | |
end | |
end | |
def test_haml_tag_with_block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Regular Expression Validation for IPv6 addresses in Ruby | |
# | |
# Inspired by (if not to say copied from): http://forums.dartware.com/viewtopic.php?t=452 | |
# Thanks, Dartware! | |
IPV6_REGEX = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- create new user and give permissions to all databases of names starting with "USERNAME_" | |
CREATE USER 'my_new_user'@'localhost' IDENTIFIED BY '9ixv[jX6g33yD#lZl#T5dV5l882_Y'; | |
GRANT ALL ON `my_new_user\_%`.* TO 'my_new_user'@'localhost'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
irb_extensions = [] | |
begin | |
# load wirble | |
require 'wirble' | |
# start wirble (with color) | |
Wirble.init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
irb_extensions = [] | |
begin | |
# load wirble | |
require 'wirble' | |
# start wirble (with color) | |
Wirble.init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From e35a6eaef85051163204a1ba5c7fa4facdad6420 Mon Sep 17 00:00:00 2001 | |
From: Christoph Petschnig <[email protected]> | |
Date: Wed, 21 Jul 2010 09:52:27 +0200 | |
Subject: [PATCH 1/2] Added 'rake test' | |
--- | |
Rakefile | 7 +++++++ | |
1 files changed, 7 insertions(+), 0 deletions(-) | |
diff --git a/Rakefile b/Rakefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From d775b59b47c284fe43086772cffe7481b951d36a Mon Sep 17 00:00:00 2001 | |
From: Christoph Petschnig <[email protected]> | |
Date: Thu, 22 Jul 2010 08:21:35 +0200 | |
Subject: [PATCH] Added tests for start/stop log messages | |
--- | |
test/daemon_spawn_test.rb | 14 ++++++++++++++ | |
1 files changed, 14 insertions(+), 0 deletions(-) | |
diff --git a/test/daemon_spawn_test.rb b/test/daemon_spawn_test.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# one line version: | |
# t = Time.new; puts (65.upto(90).map{|i|s = "%%#{i.chr}: %#{i.chr}"; t.strftime(s).ljust(25) + t.strftime(s.downcase)}.join("\n")) | |
# Output: | |
# | |
# %A: Tuesday %a: Tue | |
# %B: September %b: Sep | |
# %C: 20 %c: Tue Sep 21 08:53:35 2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 7878ed28ba6bafbe4f90286f4b86ab35e223939e Mon Sep 17 00:00:00 2001 | |
From: Christoph Petschnig <[email protected]> | |
Date: Fri, 5 Nov 2010 19:10:37 +0100 | |
Subject: [PATCH] Added config option #order | |
--- | |
lib/looksee.rb | 21 ++++++++++++++++++++- | |
spec/looksee_spec.rb | 10 ++++++++++ | |
2 files changed, 30 insertions(+), 1 deletions(-) |
OlderNewer