Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

preferring psych if available

  • Loading branch information...
commit 663d13e817c8580a4c5d7358d9d4c0012daaeb1b 1 parent e64e5a1
Aaron Patterson authored January 01, 2011
2  README.rdoc
Source Rendered
@@ -4,8 +4,6 @@ This is the source code for the rubycommitters.org website.
4 4
 
5 5
 == Hacking
6 6
 
7  
-Ruby 1.9.2 is required!!!!
8  
-
9 7
 First clone the repo:
10 8
 
11 9
     $ git clone git://github.com/tenderlove/rubycommitters.org.git
10  app/models/account.rb
@@ -10,9 +10,15 @@ class Account < ActiveRecord::Base
10 10
   # Import +io+ object that contains a YAML representation of the
11 11
   # ruby-committers
12 12
   def self.import io
13  
-    require 'psych'
  13
+    begin
  14
+      require 'psych'
  15
+      yamler = Psych
  16
+    rescue LoadError
  17
+      require 'yaml'
  18
+      yamler = YAML
  19
+    end
14 20
 
15  
-    doc = Psych.load io
  21
+    doc = yamler.load io
16 22
     doc.each do |record|
17 23
       account = Account.create!(:username => record['account'])
18 24
       (record['name'] || []).each do |name|

0 notes on commit 663d13e

Please sign in to comment.
Something went wrong with that request. Please try again.