-
Indent with two spaces. This is very nearly universally accepted among Rubyists.
-
Never rescue
Exception
. (See http://technomancy.us/114 for details.) Don't rescueStandardError
(without conditionally re-raising it) unless you have a really good reason. Doing this
This file contains hidden or 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
(defn take-thing [thing] | |
(dosync | |
(if (room-contains? @*current-room* thing) | |
(do (commute *inventory* conj (keyword thing)) | |
(alter (:items @*current-room*) | |
(partial remove #(= % (keyword thing)))) | |
(str "You picked up the " thing ".")) | |
(str "There isn't any " thing " here.")))) |
This file contains hidden or 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
(ns clojure.contrib.test-contrib.chrono | |
(:use clojure.contrib.test-is | |
clojure.contrib.chrono)) | |
(def christmas (date 2007 12 25, 3 00 02)) | |
(def new-years (date 2008 1 1)) | |
(def day-one (date 2008 11 21, 11 21 48)) | |
(deftest test-date-creation | |
;; TODO: Not sure about the interface here. We may not be able to |
This file contains hidden or 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
;;; clojure-test-mode --- Minor mode for Clojure tests | |
;; Copyright (C) 2009 Phil Hagelberg | |
;; Author: Phil Hagelberg <[email protected]> | |
;; URL: http://emacswiki.org/cgi-bin/wiki/ClojureTestMode | |
;; Version: 0.1 | |
;; Keywords: languages, lisp | |
;; This file is not part of GNU Emacs. |
This file contains hidden or 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
;;; clojure-test-mode --- Minor mode for Clojure tests | |
;; Copyright (C) 2009 Phil Hagelberg | |
;; Author: Phil Hagelberg <[email protected]> | |
;; URL: http://emacswiki.org/cgi-bin/wiki/ClojureTestMode | |
;; Version: 0.1 | |
;; Keywords: languages, lisp | |
;; This file is not part of GNU Emacs. |
This file contains hidden or 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
;;; clojure-test-mode --- Minor mode for Clojure tests | |
;; Copyright (C) 2009 Phil Hagelberg | |
;; Author: Phil Hagelberg <[email protected]> | |
;; URL: http://emacswiki.org/cgi-bin/wiki/ClojureTestMode | |
;; Version: 0.1 | |
;; Keywords: languages, lisp | |
;; This file is not part of GNU Emacs. |
This file contains hidden or 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
[13:32] phil> wait, are you using sqlite in production? | |
[13:33] Seth> oh totally. We're replacing those query tokens with | |
sqlite databases embedded in XML responses | |
[13:33] phil> nice | |
[13:33] phil> base64-encoded? | |
[13:34] Seth> then we'll process those client side using the browser's | |
embedded sqlite | |
[13:34] phil> that's good | |
[13:34] phil> better rot13 them too for security's sake | |
[13:34] phil> you know how important security is these days. |
This file contains hidden or 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' | |
require 'minitest/unit' | |
class MiniTest::Unit | |
def TestCase.test_methods | |
methods = public_instance_methods(true).map { |m| m.to_s } | |
methods -= MiniTest::Unit::TestCase.public_instance_methods(true) | |
methods.sort_by { |m| test_order == :random ? rand : m } | |
end | |
end |
This file contains hidden or 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
;;; A date library that follows principle of least surprise | |
;;; | |
;;; A few usage examples: | |
;;; | |
;;; user> (now) | |
;;; {:second 24, :minute 10, :hour 0, :type | |
;;; :clojure.contrib.date/DateTime, :year 2009, :month 1, :day 23 | |
;;; :zone "America/New_York"} | |
;;; | |
;;; user> (today) |
This file contains hidden or 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
diff --git a/lib/hoe/git.rb b/lib/hoe/git.rb | |
index 106fb1b..abb1ac8 100644 | |
--- a/lib/hoe/git.rb | |
+++ b/lib/hoe/git.rb | |
@@ -77,6 +77,10 @@ class Hoe #:nodoc: | |
task :release => "git:tag" | |
+ "Replace Manifest.txt with a listing of files from your repository." | |
+ task :dump_manifest do |
OlderNewer