Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Commit

Permalink
preferring psych if available
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jan 1, 2011
1 parent e64e5a1 commit 663d13e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 0 additions & 2 deletions README.rdoc
Expand Up @@ -4,8 +4,6 @@ This is the source code for the rubycommitters.org website.

== Hacking

Ruby 1.9.2 is required!!!!

First clone the repo:

$ git clone git://github.com/tenderlove/rubycommitters.org.git
Expand Down
10 changes: 8 additions & 2 deletions app/models/account.rb
Expand Up @@ -10,9 +10,15 @@ class Account < ActiveRecord::Base
# Import +io+ object that contains a YAML representation of the
# ruby-committers
def self.import io
require 'psych'
begin
require 'psych'
yamler = Psych
rescue LoadError
require 'yaml'
yamler = YAML
end

doc = Psych.load io
doc = yamler.load io
doc.each do |record|
account = Account.create!(:username => record['account'])
(record['name'] || []).each do |name|
Expand Down

0 comments on commit 663d13e

Please sign in to comment.