Skip to content
Browse files

sync repositories from github

  • Loading branch information...
1 parent ea1a6c0 commit 811e03248f5ac525a44886a779554fe77daf7879 @flyerhzm flyerhzm committed Nov 25, 2011
View
16 Gemfile
@@ -1,6 +1,6 @@
source 'http://rubygems.org'
-gem 'rails', '3.1.1'
+gem 'rails', '3.1.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
@@ -15,6 +15,7 @@ gem 'devise'
gem 'oa-core'
gem 'twitter-bootstrap-rails'
gem 'gravtastic'
+gem 'octokit'
# Gems used only for assets and not required
# in production environments by default.
@@ -40,19 +41,30 @@ gem 'capistrano'
group :develop do
gem 'thin'
+ gem 'rb-fsevent'
+ gem 'guard'
+ gem 'guard-bundler'
end
group :test do
+ gem 'spork', '0.9.0.rc9'
gem 'rspec'
gem 'rspec-rails'
+ gem 'shoulda-matchers'
gem 'factory_girl'
gem 'factory_girl_rails'
gem 'cucumber'
- gem 'cucumber-rails'
+ gem 'cucumber-rails', :require => 'cucumber/rails'
gem 'capybara'
gem 'database_cleaner'
gem 'launchy'
gem 'pickle'
+ gem 'webmock'
gem 'rails3-generators'
+
+ gem 'guard-spork'
+ gem 'guard-rspec'
+
+ gem 'growl'
end
View
92 Gemfile.lock
@@ -1,33 +1,33 @@
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.1.1)
- actionpack (= 3.1.1)
+ actionmailer (3.1.3)
+ actionpack (= 3.1.3)
mail (~> 2.3.0)
- actionpack (3.1.1)
- activemodel (= 3.1.1)
- activesupport (= 3.1.1)
+ actionpack (3.1.3)
+ activemodel (= 3.1.3)
+ activesupport (= 3.1.3)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
- rack (~> 1.3.2)
+ rack (~> 1.3.5)
rack-cache (~> 1.1)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
- sprockets (~> 2.0.2)
- activemodel (3.1.1)
- activesupport (= 3.1.1)
+ sprockets (~> 2.0.3)
+ activemodel (3.1.3)
+ activesupport (= 3.1.3)
builder (~> 3.0.0)
i18n (~> 0.6)
- activerecord (3.1.1)
- activemodel (= 3.1.1)
- activesupport (= 3.1.1)
+ activerecord (3.1.3)
+ activemodel (= 3.1.3)
+ activesupport (= 3.1.3)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
- activeresource (3.1.1)
- activemodel (= 3.1.1)
- activesupport (= 3.1.1)
- activesupport (3.1.1)
+ activeresource (3.1.3)
+ activemodel (= 3.1.3)
+ activesupport (= 3.1.3)
+ activesupport (3.1.3)
multi_json (~> 1.0)
addressable (2.2.6)
arel (2.2.1)
@@ -56,6 +56,7 @@ GEM
execjs
coffee-script-source (1.1.2)
colored (1.2)
+ crack (0.3.1)
cucumber (1.1.0)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
@@ -86,10 +87,23 @@ GEM
addressable (~> 2.2.6)
multipart-post (~> 1.1.3)
rack (>= 1.1.0, < 2)
+ faraday_middleware (0.7.0)
+ faraday (~> 0.7.3)
ffi (1.0.9)
gherkin (2.5.2)
json (>= 1.4.6)
gravtastic (3.0.0)
+ growl (1.0.3)
+ guard (0.8.8)
+ thor (~> 0.14.6)
+ guard-bundler (0.1.3)
+ bundler (>= 1.0.0)
+ guard (>= 0.2.2)
+ guard-rspec (0.5.5)
+ guard (>= 0.8.4)
+ guard-spork (0.3.2)
+ guard (>= 0.8.4)
+ spork (>= 0.8.4)
haml (3.1.3)
hashie (1.2.0)
highline (1.6.2)
@@ -128,6 +142,12 @@ GEM
oauth2 (0.5.1)
faraday (~> 0.7.4)
multi_json (~> 1.0.3)
+ octokit (0.6.5)
+ addressable (~> 2.2.6)
+ faraday (~> 0.7.4)
+ faraday_middleware (~> 0.7.0)
+ hashie (~> 1.2.0)
+ multi_json (~> 1.0.2)
omniauth (1.0.0)
hashie (~> 1.2)
rack
@@ -152,14 +172,14 @@ GEM
rack
rack-test (0.6.1)
rack (>= 1.0)
- rails (3.1.1)
- actionmailer (= 3.1.1)
- actionpack (= 3.1.1)
- activerecord (= 3.1.1)
- activeresource (= 3.1.1)
- activesupport (= 3.1.1)
+ rails (3.1.3)
+ actionmailer (= 3.1.3)
+ actionpack (= 3.1.3)
+ activerecord (= 3.1.3)
+ activeresource (= 3.1.3)
+ activesupport (= 3.1.3)
bundler (~> 1.0)
- railties (= 3.1.1)
+ railties (= 3.1.3)
rails3-generators (0.17.4)
railties (>= 3.0.0)
rails_best_practices (1.2.0)
@@ -169,14 +189,15 @@ GEM
i18n
progressbar
sexp_processor
- railties (3.1.1)
- actionpack (= 3.1.1)
- activesupport (= 3.1.1)
+ railties (3.1.3)
+ actionpack (= 3.1.3)
+ activesupport (= 3.1.3)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
+ rb-fsevent (0.4.3.1)
rdoc (3.11)
json (~> 1.4)
rspec (2.7.0)
@@ -206,9 +227,11 @@ GEM
json_pure
rubyzip
sexp_processor (3.0.7)
+ shoulda-matchers (1.0.0)
simple_form (1.5.2)
actionpack (~> 3.0)
activemodel (~> 3.0)
+ spork (0.9.0.rc9)
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
@@ -231,12 +254,15 @@ GEM
less
less-rails (~> 2.1.0)
railties
- tzinfo (0.3.30)
+ tzinfo (0.3.31)
uglifier (1.0.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
warden (1.0.6)
rack (>= 1.0)
+ webmock (1.7.8)
+ addressable (~> 2.2, > 2.2.5)
+ crack (>= 0.1.7)
xpath (0.1.4)
nokogiri (~> 1.3)
@@ -254,21 +280,31 @@ DEPENDENCIES
factory_girl
factory_girl_rails
gravtastic
+ growl
+ guard
+ guard-bundler
+ guard-rspec
+ guard-spork
haml
jquery-rails
launchy
mysql2
oa-core
+ octokit
omniauth
omniauth-github
pickle
- rails (= 3.1.1)
+ rails (= 3.1.3)
rails3-generators
rails_best_practices
+ rb-fsevent
rspec
rspec-rails
sass-rails (~> 3.1.4)
+ shoulda-matchers
simple_form
+ spork (= 0.9.0.rc9)
thin
twitter-bootstrap-rails
uglifier (>= 1.0.3)
+ webmock
View
39 Guardfile
@@ -0,0 +1,39 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' }, :cucumber => false, :test_unit => false, :bundler => false do
+ watch('config/application.rb')
+ watch('config/environment.rb')
+ watch(%r{^config/environments/.+\.rb$})
+ watch(%r{^config/initializers/.+\.rb$})
+ watch('Gemfile')
+ watch('Gemfile.lock')
+ watch('spec/spec_helper.rb')
+ # watch('test/test_helper.rb')
+end
+
+
+guard 'rspec', :version => 2, :all_after_pass => false, :all_on_start => false, :cli => "--color --format nested --fail-fast --drb" do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+
+ # Rails example
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
+ watch('spec/spec_helper.rb') { "spec" }
+ watch('config/routes.rb') { "spec/routing" }
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
+ # Capybara request specs
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
+end
+
+guard 'bundler' do
+ watch('Gemfile')
+ # Uncomment next line if Gemfile contain `gemspec' command
+ # watch(/^.+\.gemspec/)
+end
View
1 app/controllers/home_controller.rb
@@ -1,4 +1,5 @@
class HomeController < ApplicationController
def index
+ current_user.try(:repositories)
end
end
View
3 app/models/repository.rb
@@ -0,0 +1,3 @@
+class Repository < ActiveRecord::Base
+ validates :github_id, :presence => true, :uniqueness => true
+end
View
23 app/models/user.rb
@@ -11,12 +11,18 @@ class User < ActiveRecord::Base
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
+ has_many :user_repositories
+ has_many :repositories, :through => :user_repositories
+
+ after_create :sync_repositories
+
def self.find_for_github_oauth(data)
if user = User.find_by_github_uid(data.uid)
user
else # Create a user with a stub password.
user = User.new(:email => data.info.email, :password => Devise.friendly_token[0, 20])
user.github_uid = data.uid
+ user.github_token = data.credentials.token
user.name = data.info.name
user.nickname = data.info.nickname
user.save
@@ -31,4 +37,21 @@ def self.new_with_session(params, session)
end
end
end
+
+ def sync_repositories
+ client = Octokit::Client.new(oauth_token: github_token)
+ client.repositories.each do |repo|
+ repositories << Repository.create(
+ :url => repo.url,
+ :git_url => repo.git_url,
+ :name => repo.name,
+ :description => repo.description,
+ :private => repo.private,
+ :fork => repo.fork,
+ :master_branch => repo.master_branch,
+ :pushed_at => repo.pushed_at,
+ :github_id => repo.id
+ )
+ end
+ end
end
View
4 app/models/user_repository.rb
@@ -0,0 +1,4 @@
+class UserRepository < ActiveRecord::Base
+ belongs_to :user
+ belongs_to :repository
+end
View
5 db/migrate/20111123140221_add_github_token_to_users.rb
@@ -0,0 +1,5 @@
+class AddGithubTokenToUsers < ActiveRecord::Migration
+ def change
+ add_column :users, :github_token, :string
+ end
+end
View
16 db/migrate/20111123144809_create_repositories.rb
@@ -0,0 +1,16 @@
+class CreateRepositories < ActiveRecord::Migration
+ def change
+ create_table :repositories do |t|
+ t.string :url
+ t.string :git_url
+ t.string :name
+ t.string :description
+ t.boolean :private
+ t.boolean :fork
+ t.string :master_branch
+ t.datetime :pushed_at
+
+ t.timestamps
+ end
+ end
+end
View
8 db/migrate/20111123153743_create_user_repositories.rb
@@ -0,0 +1,8 @@
+class CreateUserRepositories < ActiveRecord::Migration
+ def change
+ create_table :user_repositories do |t|
+ t.integer :user_id
+ t.integer :repository_id
+ end
+ end
+end
View
5 db/migrate/20111125035808_add_github_id_to_repositories.rb
@@ -0,0 +1,5 @@
+class AddGithubIdToRepositories < ActiveRecord::Migration
+ def change
+ add_column :repositories, :github_id, :integer
+ end
+end
View
22 db/schema.rb
@@ -11,7 +11,26 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20111122133254) do
+ActiveRecord::Schema.define(:version => 20111125035808) do
+
+ create_table "repositories", :force => true do |t|
+ t.string "url"
+ t.string "git_url"
+ t.string "name"
+ t.string "description"
+ t.boolean "private"
+ t.boolean "fork"
+ t.string "master_branch"
+ t.datetime "pushed_at"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "github_id"
+ end
+
+ create_table "user_repositories", :force => true do |t|
+ t.integer "user_id"
+ t.integer "repository_id"
+ end
create_table "users", :force => true do |t|
t.string "email", :default => "", :null => false
@@ -29,6 +48,7 @@
t.integer "github_uid"
t.string "nickname"
t.string "name"
+ t.string "github_token"
end
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
View
121 features/support/env.rb
@@ -1,66 +1,71 @@
-# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
-# It is recommended to regenerate this file in the future when you upgrade to a
-# newer version of cucumber-rails. Consider adding your own code to a new file
-# instead of editing this one. Cucumber will automatically load all features/**/*.rb
-# files.
+require 'rubygems'
+require 'spork'
-require 'cucumber/rails'
+Spork.prefork do
+ require 'cucumber/rails'
-# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
-# order to ease the transition to Capybara we set the default here. If you'd
-# prefer to use XPath just remove this line and adjust any selectors in your
-# steps to use the XPath syntax.
-Capybara.default_selector = :css
+ # Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
+ # order to ease the transition to Capybara we set the default here. If you'd
+ # prefer to use XPath just remove this line and adjust any selectors in your
+ # steps to use the XPath syntax.
+ Capybara.default_selector = :css
-# By default, any exception happening in your Rails application will bubble up
-# to Cucumber so that your scenario will fail. This is a different from how
-# your application behaves in the production environment, where an error page will
-# be rendered instead.
-#
-# Sometimes we want to override this default behaviour and allow Rails to rescue
-# exceptions and display an error page (just like when the app is running in production).
-# Typical scenarios where you want to do this is when you test your error pages.
-# There are two ways to allow Rails to rescue exceptions:
-#
-# 1) Tag your scenario (or feature) with @allow-rescue
-#
-# 2) Set the value below to true. Beware that doing this globally is not
-# recommended as it will mask a lot of errors for you!
-#
-ActionController::Base.allow_rescue = false
+ # By default, any exception happening in your Rails application will bubble up
+ # to Cucumber so that your scenario will fail. This is a different from how
+ # your application behaves in the production environment, where an error page will
+ # be rendered instead.
+ #
+ # Sometimes we want to override this default behaviour and allow Rails to rescue
+ # exceptions and display an error page (just like when the app is running in production).
+ # Typical scenarios where you want to do this is when you test your error pages.
+ # There are two ways to allow Rails to rescue exceptions:
+ #
+ # 1) Tag your scenario (or feature) with @allow-rescue
+ #
+ # 2) Set the value below to true. Beware that doing this globally is not
+ # recommended as it will mask a lot of errors for you!
+ #
+ ActionController::Base.allow_rescue = false
-# Remove/comment out the lines below if your app doesn't have a database.
-# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
-begin
- DatabaseCleaner.strategy = :transaction
-rescue NameError
- raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
+ # Remove/comment out the lines below if your app doesn't have a database.
+ # For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
+ begin
+ DatabaseCleaner.strategy = :transaction
+ rescue NameError
+ raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
+ end
+
+ OmniAuth.config.test_mode = true
+ OmniAuth.config.mock_auth[:github] = Hashie::Mash.new({
+ provider: 'github',
+ uid: '123456',
+ info: {
+ nickname: 'flyerhzm',
+ email: 'flyerhzm@gmail.com',
+ name: 'Richard Huang',
+ },
+ credentials: {
+ token: 'abcdefg',
+ secret: 'abcdefg'
+ }
+ })
+
+
+ # You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
+ # See the DatabaseCleaner documentation for details. Example:
+ #
+ # Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
+ # DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]}
+ # end
+ #
+ # Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
+ # DatabaseCleaner.strategy = :transaction
+ # end
+ #
end
-OmniAuth.config.test_mode = true
-OmniAuth.config.mock_auth[:github] = Hashie::Mash.new({
- provider: 'github',
- uid: '123456',
- info: {
- nickname: 'flyerhzm',
- email: 'flyerhzm@gmail.com',
- name: 'Richard Huang',
- },
- credentials: {
- token: 'abcdefg',
- secret: 'abcdefg'
- }
-})
+Spork.each_run do
+ # This code will be run each time you run your specs.
+end
-# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
-# See the DatabaseCleaner documentation for details. Example:
-#
-# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
-# DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]}
-# end
-#
-# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
-# DatabaseCleaner.strategy = :transaction
-# end
-#
View
14 spec/factories/repositories.rb
@@ -0,0 +1,14 @@
+# Read about factories at http://github.com/thoughtbot/factory_girl
+
+FactoryGirl.define do
+ factory :repository do
+ url "MyString"
+ git_url "MyString"
+ name "MyString"
+ description "MyString"
+ private false
+ fork false
+ master_branch "MyString"
+ pushed_at "2011-11-23 22:48:10"
+ end
+end
View
8 spec/factories/user_repositories.rb
@@ -0,0 +1,8 @@
+# Read about factories at http://github.com/thoughtbot/factory_girl
+
+FactoryGirl.define do
+ factory :user_repository do
+ user_id 1
+ repository_id 1
+ end
+end
View
10 spec/factories/users.rb
@@ -0,0 +1,10 @@
+# Read about factories at http://github.com/thoughtbot/factory_girl
+
+FactoryGirl.define do
+ factory :user do
+ sequence(:email) { |i| "user#{i}@gmail.com" }
+ password "testtest"
+ password_confirmation "testtest"
+ end
+end
+
View
902 spec/fixtures/repositories.json
@@ -0,0 +1,902 @@
+[
+ {
+ "clone_url":"https://github.com/flyerhzm/rack.git",
+ "created_at":"2009-03-25T06:27:56Z",
+ "description":"a modular Ruby webserver interface",
+ "fork":true,
+ "forks":0,
+ "git_url":"git://github.com/flyerhzm/rack.git",
+ "homepage":"http://rack.rubyforge.org/",
+ "html_url":"https://github.com/flyerhzm/rack",
+ "id":158833,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"rack",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2009-03-25T06:42:28Z",
+ "size":156,
+ "ssh_url":"git@github.com:flyerhzm/rack.git",
+ "svn_url":"https://svn.github.com/flyerhzm/rack",
+ "updated_at":"2011-10-03T23:44:56Z",
+ "url":"https://api.github.com/repos/flyerhzm/rack",
+ "watchers":1
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/codelinestatistics.git",
+ "created_at":"2009-06-08T07:40:41Z",
+ "description":"The code line statistics takes files and directories from GUI, counts the total files, total sizes of files, total lines, lines of codes, lines of comments and lines of blanks in the files, displays the results and can also export results to html file.",
+ "fork":false,
+ "forks":1,
+ "git_url":"git://github.com/flyerhzm/codelinestatistics.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/codelinestatistics",
+ "id":221383,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"codelinestatistics",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2009-06-11T13:12:16Z",
+ "size":600,
+ "ssh_url":"git@github.com:flyerhzm/codelinestatistics.git",
+ "svn_url":"https://svn.github.com/flyerhzm/codelinestatistics",
+ "updated_at":"2011-10-04T00:00:14Z",
+ "url":"https://api.github.com/repos/flyerhzm/codelinestatistics",
+ "watchers":2
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/visual_partial.git",
+ "created_at":"2009-06-13T03:28:47Z",
+ "description":"This plugin provides a way that you can see all the partial pages rendered. So it can prevent you from, using partial page too much, which hurts the performance.",
+ "fork":false,
+ "forks":1,
+ "git_url":"git://github.com/flyerhzm/visual_partial.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/visual_partial",
+ "id":225966,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"visual_partial",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2009-08-22T03:04:48Z",
+ "size":288,
+ "ssh_url":"git@github.com:flyerhzm/visual_partial.git",
+ "svn_url":"https://svn.github.com/flyerhzm/visual_partial",
+ "updated_at":"2011-10-04T00:01:41Z",
+ "url":"https://api.github.com/repos/flyerhzm/visual_partial",
+ "watchers":7
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/regexp_crawler.git",
+ "created_at":"2009-07-08T12:20:26Z",
+ "description":"A crawler which uses regular expression to catch data from website.",
+ "fork":false,
+ "forks":4,
+ "git_url":"git://github.com/flyerhzm/regexp_crawler.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/regexp_crawler",
+ "id":246086,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"regexp_crawler",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-02-06T14:43:04Z",
+ "size":1816,
+ "ssh_url":"git@github.com:flyerhzm/regexp_crawler.git",
+ "svn_url":"https://svn.github.com/flyerhzm/regexp_crawler",
+ "updated_at":"2011-10-12T17:25:27Z",
+ "url":"https://api.github.com/repos/flyerhzm/regexp_crawler",
+ "watchers":32
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/chinese_permalink.git",
+ "created_at":"2009-07-12T12:55:35Z",
+ "description":"This plugin adds a capability for AR model to create a seo permalink with your chinese text. It will translate your chinese text to english url, based on google translate.",
+ "fork":false,
+ "forks":3,
+ "git_url":"git://github.com/flyerhzm/chinese_permalink.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/chinese_permalink",
+ "id":249215,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"chinese_permalink",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2011-10-26T14:49:51Z",
+ "size":132,
+ "ssh_url":"git@github.com:flyerhzm/chinese_permalink.git",
+ "svn_url":"https://svn.github.com/flyerhzm/chinese_permalink",
+ "updated_at":"2011-10-26T14:49:51Z",
+ "url":"https://api.github.com/repos/flyerhzm/chinese_permalink",
+ "watchers":19
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/chinese_regions.git",
+ "created_at":"2009-07-26T09:03:42Z",
+ "description":"provides all chinese regions, cities and districts",
+ "fork":false,
+ "forks":3,
+ "git_url":"git://github.com/flyerhzm/chinese_regions.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/chinese_regions",
+ "id":260827,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"chinese_regions",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2009-08-22T02:55:33Z",
+ "size":388,
+ "ssh_url":"git@github.com:flyerhzm/chinese_regions.git",
+ "svn_url":"https://svn.github.com/flyerhzm/chinese_regions",
+ "updated_at":"2011-11-24T15:40:34Z",
+ "url":"https://api.github.com/repos/flyerhzm/chinese_regions",
+ "watchers":26
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/sitemap.git",
+ "created_at":"2009-08-08T15:48:50Z",
+ "description":"This plugin will generate a sitemap.xml from sitemap.rb whose format is very similar to routes.rb",
+ "fork":false,
+ "forks":2,
+ "git_url":"git://github.com/flyerhzm/sitemap.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/sitemap",
+ "id":272555,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"sitemap",
+ "open_issues":3,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-04-05T04:10:44Z",
+ "size":1360,
+ "ssh_url":"git@github.com:flyerhzm/sitemap.git",
+ "svn_url":"https://svn.github.com/flyerhzm/sitemap",
+ "updated_at":"2011-10-04T00:13:16Z",
+ "url":"https://api.github.com/repos/flyerhzm/sitemap",
+ "watchers":36
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/bullet.git",
+ "created_at":"2009-08-13T15:47:31Z",
+ "description":"A rails plugin/gem to kill N+1 queries and unused eager loading",
+ "fork":false,
+ "forks":29,
+ "git_url":"git://github.com/flyerhzm/bullet.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/bullet",
+ "id":277089,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"bullet",
+ "open_issues":14,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2011-11-03T02:07:23Z",
+ "size":192,
+ "ssh_url":"git@github.com:flyerhzm/bullet.git",
+ "svn_url":"https://svn.github.com/flyerhzm/bullet",
+ "updated_at":"2011-11-23T12:47:06Z",
+ "url":"https://api.github.com/repos/flyerhzm/bullet",
+ "watchers":892
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/rfetion.git",
+ "created_at":"2009-09-16T02:17:34Z",
+ "description":"rfetion is a ruby gem for China Mobile fetion service that you can send SMS free.",
+ "fork":false,
+ "forks":8,
+ "git_url":"git://github.com/flyerhzm/rfetion.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/rfetion",
+ "id":308426,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"rfetion",
+ "open_issues":4,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-06-02T09:02:57Z",
+ "size":976,
+ "ssh_url":"git@github.com:flyerhzm/rfetion.git",
+ "svn_url":"https://svn.github.com/flyerhzm/rfetion",
+ "updated_at":"2011-11-09T06:18:51Z",
+ "url":"https://api.github.com/repos/flyerhzm/rfetion",
+ "watchers":57
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/contactlist.git",
+ "created_at":"2009-09-19T01:31:05Z",
+ "description":"java api to retrieve contact list of email(hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah, 189 and 139) and im(msn)",
+ "fork":false,
+ "forks":8,
+ "git_url":"git://github.com/flyerhzm/contactlist.git",
+ "homepage":"http://code.google.com/p/contact-list/",
+ "html_url":"https://github.com/flyerhzm/contactlist",
+ "id":311472,
+ "language":"Java",
+ "master_branch":null,
+ "name":"contactlist",
+ "open_issues":12,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-07-04T09:05:34Z",
+ "size":2220,
+ "ssh_url":"git@github.com:flyerhzm/contactlist.git",
+ "svn_url":"https://svn.github.com/flyerhzm/contactlist",
+ "updated_at":"2011-10-26T08:48:32Z",
+ "url":"https://api.github.com/repos/flyerhzm/contactlist",
+ "watchers":32
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/css_sprite.git",
+ "created_at":"2009-09-26T15:10:21Z",
+ "description":"automatically css sprite",
+ "fork":false,
+ "forks":13,
+ "git_url":"git://github.com/flyerhzm/css_sprite.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/css_sprite",
+ "id":318338,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"css_sprite",
+ "open_issues":4,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-07-13T02:00:57Z",
+ "size":3692,
+ "ssh_url":"git@github.com:flyerhzm/css_sprite.git",
+ "svn_url":"https://svn.github.com/flyerhzm/css_sprite",
+ "updated_at":"2011-11-18T15:39:37Z",
+ "url":"https://api.github.com/repos/flyerhzm/css_sprite",
+ "watchers":163
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/activemerchant_patch_for_china.git",
+ "created_at":"2009-09-27T14:38:47Z",
+ "description":"A rails plugin to add an active_merchant patch for china online payment platform including alipay (支付宝), 99bill (快钱) and tenpay (财付通)",
+ "fork":false,
+ "forks":15,
+ "git_url":"git://github.com/flyerhzm/activemerchant_patch_for_china.git",
+ "homepage":"http://donatecn.com",
+ "html_url":"https://github.com/flyerhzm/activemerchant_patch_for_china",
+ "id":319042,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"activemerchant_patch_for_china",
+ "open_issues":3,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2011-08-21T07:42:00Z",
+ "size":224,
+ "ssh_url":"git@github.com:flyerhzm/activemerchant_patch_for_china.git",
+ "svn_url":"https://svn.github.com/flyerhzm/activemerchant_patch_for_china",
+ "updated_at":"2011-11-24T02:47:12Z",
+ "url":"https://api.github.com/repos/flyerhzm/activemerchant_patch_for_china",
+ "watchers":105
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/monitor.git",
+ "created_at":"2009-10-15T15:09:55Z",
+ "description":"Monitor gem can display ruby methods call stack on browser based on unroller",
+ "fork":false,
+ "forks":3,
+ "git_url":"git://github.com/flyerhzm/monitor.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/monitor",
+ "id":338459,
+ "language":"JavaScript",
+ "master_branch":null,
+ "name":"monitor",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2009-10-29T15:02:15Z",
+ "size":2150,
+ "ssh_url":"git@github.com:flyerhzm/monitor.git",
+ "svn_url":"https://svn.github.com/flyerhzm/monitor",
+ "updated_at":"2011-11-09T14:32:42Z",
+ "url":"https://api.github.com/repos/flyerhzm/monitor",
+ "watchers":13
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/contactlist-client.git",
+ "created_at":"2009-10-28T01:39:50Z",
+ "description":"The contactlist-client gem is a ruby client to contactlist service which retrieves contact list of email(hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah, 189, and, 139) and im(msn)",
+ "fork":false,
+ "forks":1,
+ "git_url":"git://github.com/flyerhzm/contactlist-client.git",
+ "homepage":null,
+ "html_url":"https://github.com/flyerhzm/contactlist-client",
+ "id":352166,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"contactlist-client",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-06-02T13:46:35Z",
+ "size":640,
+ "ssh_url":"git@github.com:flyerhzm/contactlist-client.git",
+ "svn_url":"https://svn.github.com/flyerhzm/contactlist-client",
+ "updated_at":"2011-10-04T00:34:52Z",
+ "url":"https://api.github.com/repos/flyerhzm/contactlist-client",
+ "watchers":17
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/rails_best_practices.git",
+ "created_at":"2009-11-03T13:41:10Z",
+ "description":"a code metric tool for, rails projects",
+ "fork":false,
+ "forks":46,
+ "git_url":"git://github.com/flyerhzm/rails_best_practices.git",
+ "homepage":"http://rails-bestpractices.com",
+ "html_url":"https://github.com/flyerhzm/rails_best_practices",
+ "id":359371,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"rails_best_practices",
+ "open_issues":11,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2011-11-24T13:11:45Z",
+ "size":292,
+ "ssh_url":"git@github.com:flyerhzm/rails_best_practices.git",
+ "svn_url":"https://svn.github.com/flyerhzm/rails_best_practices",
+ "updated_at":"2011-11-24T13:11:45Z",
+ "url":"https://api.github.com/repos/flyerhzm/rails_best_practices",
+ "watchers":942
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/taobao.git",
+ "created_at":"2009-12-04T01:58:23Z",
+ "description":"Ruby, Client Library for Taobao Open Platform",
+ "fork":false,
+ "forks":6,
+ "git_url":"git://github.com/flyerhzm/taobao.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/taobao",
+ "id":394867,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"taobao",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2009-12-05T12:46:38Z",
+ "size":204,
+ "ssh_url":"git@github.com:flyerhzm/taobao.git",
+ "svn_url":"https://svn.github.com/flyerhzm/taobao",
+ "updated_at":"2011-10-16T08:22:22Z",
+ "url":"https://api.github.com/repos/flyerhzm/taobao",
+ "watchers":12
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/metric_fu.git",
+ "created_at":"2009-12-21T14:24:03Z",
+ "description":"A fist full of code metrics",
+ "fork":true,
+ "forks":2,
+ "git_url":"git://github.com/flyerhzm/metric_fu.git",
+ "homepage":"http://metric-fu.rubyforge.org/",
+ "html_url":"https://github.com/flyerhzm/metric_fu",
+ "id":444723,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"metric_fu",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2011-01-01T17:07:53Z",
+ "size":120,
+ "ssh_url":"git@github.com:flyerhzm/metric_fu.git",
+ "svn_url":"https://svn.github.com/flyerhzm/metric_fu",
+ "updated_at":"2011-10-04T14:09:41Z",
+ "url":"https://api.github.com/repos/flyerhzm/metric_fu",
+ "watchers":36
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/exception_notification.git",
+ "created_at":"2009-12-24T03:25:18Z",
+ "description":"Exception Notifier Plugin for Rails and generate test codes to reproduce the exception",
+ "fork":true,
+ "forks":1,
+ "git_url":"git://github.com/flyerhzm/exception_notification.git",
+ "homepage":"http://rubyonrails.org",
+ "html_url":"https://github.com/flyerhzm/exception_notification",
+ "id":447757,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"exception_notification",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2009-12-24T06:45:40Z",
+ "size":132,
+ "ssh_url":"git@github.com:flyerhzm/exception_notification.git",
+ "svn_url":"https://svn.github.com/flyerhzm/exception_notification",
+ "updated_at":"2011-10-04T01:01:26Z",
+ "url":"https://api.github.com/repos/flyerhzm/exception_notification",
+ "watchers":1
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/typus.git",
+ "created_at":"2010-02-22T08:34:05Z",
+ "description":"Ruby on Rails easy-to-use interface to allow trusted users edit structured content. (Admin scaffold generator)",
+ "fork":true,
+ "forks":2,
+ "git_url":"git://github.com/flyerhzm/typus.git",
+ "homepage":"http://intraducibles.com/projects/typus",
+ "html_url":"https://github.com/flyerhzm/typus",
+ "id":529856,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"typus",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-02-22T08:40:50Z",
+ "size":4100,
+ "ssh_url":"git@github.com:flyerhzm/typus.git",
+ "svn_url":"https://svn.github.com/flyerhzm/typus",
+ "updated_at":"2011-10-04T01:25:13Z",
+ "url":"https://api.github.com/repos/flyerhzm/typus",
+ "watchers":2
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/seo_checker.git",
+ "created_at":"2010-02-28T15:15:27Z",
+ "description":"check your website if it is seo.",
+ "fork":false,
+ "forks":5,
+ "git_url":"git://github.com/flyerhzm/seo_checker.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/seo_checker",
+ "id":539936,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"seo_checker",
+ "open_issues":1,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-03-07T09:37:31Z",
+ "size":1028,
+ "ssh_url":"git@github.com:flyerhzm/seo_checker.git",
+ "svn_url":"https://svn.github.com/flyerhzm/seo_checker",
+ "updated_at":"2011-11-23T13:11:19Z",
+ "url":"https://api.github.com/repos/flyerhzm/seo_checker",
+ "watchers":91
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/twitter_connect.git",
+ "created_at":"2010-03-09T15:08:47Z",
+ "description":"facebook connect style twitter oauth",
+ "fork":false,
+ "forks":5,
+ "git_url":"git://github.com/flyerhzm/twitter_connect.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/twitter_connect",
+ "id":554324,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"twitter_connect",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-07-06T06:11:24Z",
+ "size":1192,
+ "ssh_url":"git@github.com:flyerhzm/twitter_connect.git",
+ "svn_url":"https://svn.github.com/flyerhzm/twitter_connect",
+ "updated_at":"2011-10-04T01:32:25Z",
+ "url":"https://api.github.com/repos/flyerhzm/twitter_connect",
+ "watchers":41
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/chinese_pinyin.git",
+ "created_at":"2010-03-10T14:19:59Z",
+ "description":"translate chinese, hanzi to pinyin",
+ "fork":false,
+ "forks":6,
+ "git_url":"git://github.com/flyerhzm/chinese_pinyin.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/chinese_pinyin",
+ "id":555970,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"chinese_pinyin",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2011-10-08T13:31:01Z",
+ "size":144,
+ "ssh_url":"git@github.com:flyerhzm/chinese_pinyin.git",
+ "svn_url":"https://svn.github.com/flyerhzm/chinese_pinyin",
+ "updated_at":"2011-11-22T07:40:27Z",
+ "url":"https://api.github.com/repos/flyerhzm/chinese_pinyin",
+ "watchers":26
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/resque-restriction.git",
+ "created_at":"2010-04-29T09:26:45Z",
+ "description":"resque-restriction is an extension to resque, queue system that restricts the execution number of certain jobs in a period time.",
+ "fork":false,
+ "forks":5,
+ "git_url":"git://github.com/flyerhzm/resque-restriction.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/resque-restriction",
+ "id":637868,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"resque-restriction",
+ "open_issues":4,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-11-04T15:33:52Z",
+ "size":1704,
+ "ssh_url":"git@github.com:flyerhzm/resque-restriction.git",
+ "svn_url":"https://svn.github.com/flyerhzm/resque-restriction",
+ "updated_at":"2011-11-05T15:48:58Z",
+ "url":"https://api.github.com/repos/flyerhzm/resque-restriction",
+ "watchers":63
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/authlogic_renren_connect.git",
+ "created_at":"2010-05-04T08:10:37Z",
+ "description":"Extension of the Authlogic library to add Renren Connect support built upon the renren plugin",
+ "fork":false,
+ "forks":2,
+ "git_url":"git://github.com/flyerhzm/authlogic_renren_connect.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/authlogic_renren_connect",
+ "id":646247,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"authlogic_renren_connect",
+ "open_issues":1,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-05-28T06:51:44Z",
+ "size":312,
+ "ssh_url":"git@github.com:flyerhzm/authlogic_renren_connect.git",
+ "svn_url":"https://svn.github.com/flyerhzm/authlogic_renren_connect",
+ "updated_at":"2011-10-04T01:56:51Z",
+ "url":"https://api.github.com/repos/flyerhzm/authlogic_renren_connect",
+ "watchers":3
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/clock_chrome_extension.git",
+ "created_at":"2010-06-17T15:31:39Z",
+ "description":"google chrome extension to display multiple clock analogs for multiple timezones",
+ "fork":false,
+ "forks":1,
+ "git_url":"git://github.com/flyerhzm/clock_chrome_extension.git",
+ "homepage":"https://chrome.google.com/extensions/detail/dfgmialafiaodlncfdbafambkjmjkkam?hl:en",
+ "html_url":"https://github.com/flyerhzm/clock_chrome_extension",
+ "id":726154,
+ "language":null,
+ "master_branch":null,
+ "name":"clock_chrome_extension",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-06-18T15:37:53Z",
+ "size":384,
+ "ssh_url":"git@github.com:flyerhzm/clock_chrome_extension.git",
+ "svn_url":"https://svn.github.com/flyerhzm/clock_chrome_extension",
+ "updated_at":"2011-10-04T02:19:08Z",
+ "url":"https://api.github.com/repos/flyerhzm/clock_chrome_extension",
+ "watchers":1
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/rails3-template.git",
+ "created_at":"2010-06-28T15:21:15Z",
+ "description":"rails3 template includes a lot of useful plugins/gems",
+ "fork":false,
+ "forks":3,
+ "git_url":"git://github.com/flyerhzm/rails3-template.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/rails3-template",
+ "id":744939,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"rails3-template",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-08-09T15:23:13Z",
+ "size":1404,
+ "ssh_url":"git@github.com:flyerhzm/rails3-template.git",
+ "svn_url":"https://svn.github.com/flyerhzm/rails3-template",
+ "updated_at":"2011-10-04T02:24:16Z",
+ "url":"https://api.github.com/repos/flyerhzm/rails3-template",
+ "watchers":6
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/rails-bestpractices.com.git",
+ "created_at":"2010-07-03T16:16:03Z",
+ "description":"rails-bestpractices.com",
+ "fork":false,
+ "forks":13,
+ "git_url":"git://github.com/flyerhzm/rails-bestpractices.com.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/rails-bestpractices.com",
+ "id":755266,
+ "language":"JavaScript",
+ "master_branch":null,
+ "name":"rails-bestpractices.com",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2011-11-19T04:14:40Z",
+ "size":136,
+ "ssh_url":"git@github.com:flyerhzm/rails-bestpractices.com.git",
+ "svn_url":"https://svn.github.com/flyerhzm/rails-bestpractices.com",
+ "updated_at":"2011-11-23T13:11:45Z",
+ "url":"https://api.github.com/repos/flyerhzm/rails-bestpractices.com",
+ "watchers":48
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/mongoid.git",
+ "created_at":"2010-10-03T12:43:07Z",
+ "description":"Ruby, ODM, framework, for, MongoDB",
+ "fork":true,
+ "forks":0,
+ "git_url":"git://github.com/flyerhzm/mongoid.git",
+ "homepage":"http://mongoid.org",
+ "html_url":"https://github.com/flyerhzm/mongoid",
+ "id":958303,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"mongoid",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2011-01-24T12:52:32Z",
+ "size":416,
+ "ssh_url":"git@github.com:flyerhzm/mongoid.git",
+ "svn_url":"https://svn.github.com/flyerhzm/mongoid",
+ "updated_at":"2011-10-04T03:24:00Z",
+ "url":"https://api.github.com/repos/flyerhzm/mongoid",
+ "watchers":1
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/jQuery-Tokenizing-Autocomplete-Plugin.git",
+ "created_at":"2010-10-13T06:38:35Z",
+ "description":"This, is, a, jQuery, plugin, to, allow, users, to, select, multiple, items, from, a, predefined, list, using, autocompletion, as, they, type, to, find, each, item.",
+ "fork":true,
+ "forks":0,
+ "git_url":"git://github.com/flyerhzm/jQuery-Tokenizing-Autocomplete-Plugin.git",
+ "homepage":"http://loopj.com/2009/04/25/jquery-plugin-tokenizing-autocomplete-text-entry/",
+ "html_url":"https://github.com/flyerhzm/jQuery-Tokenizing-Autocomplete-Plugin",
+ "id":983294,
+ "language":"JavaScript",
+ "master_branch":null,
+ "name":"jQuery-Tokenizing-Autocomplete-Plugin",
+ "open_issues":0,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2010-10-14T04:48:02Z",
+ "size":132,
+ "ssh_url":"git@github.com:flyerhzm/jQuery-Tokenizing-Autocomplete-Plugin.git",
+ "svn_url":"https://svn.github.com/flyerhzm/jQuery-Tokenizing-Autocomplete-Plugin",
+ "updated_at":"2011-10-04T03:31:34Z",
+ "url":"https://api.github.com/repos/flyerhzm/jQuery-Tokenizing-Autocomplete-Plugin",
+ "watchers":2
+ },
+ {
+ "clone_url":"https://github.com/flyerhzm/mongoid-eager-loading.git",
+ "created_at":"2010-10-26T10:59:43Z",
+ "description":"eager, loading, for, mongoid, (DEPRECATED)",
+ "fork":false,
+ "forks":5,
+ "git_url":"git://github.com/flyerhzm/mongoid-eager-loading.git",
+ "homepage":"",
+ "html_url":"https://github.com/flyerhzm/mongoid-eager-loading",
+ "id":1025169,
+ "language":"Ruby",
+ "master_branch":null,
+ "name":"mongoid-eager-loading",
+ "open_issues":4,
+ "owner":{
+ "avatar_url":"https://secure.gravatar.com/avatar/13c60e2a5806406b537daa542d3495da?d:https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
+ "gravatar_id":"13c60e2a5806406b537daa542d3495da",
+ "id":66836,
+ "login":"flyerhzm",
+ "url":"https://api.github.com/users/flyerhzm"
+ },
+ "private":false,
+ "pushed_at":"2011-11-23T14:36:24Z",
+ "size":832,
+ "ssh_url":"git@github.com:flyerhzm/mongoid-eager-loading.git",
+ "svn_url":"https://svn.github.com/flyerhzm/mongoid-eager-loading",
+ "updated_at":"2011-11-23T14:37:38Z",
+ "url":"https://api.github.com/repos/flyerhzm/mongoid-eager-loading",
+ "watchers":60
+ }
+]
View
5 spec/models/repository_spec.rb
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe Repository do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
View
6 spec/models/user_repository_spec.rb
@@ -0,0 +1,6 @@
+require 'spec_helper'
+
+describe UserRepository do
+ it { should belong_to(:user) }
+ it { should belong_to(:repository) }
+end
View
16 spec/models/user_spec.rb
@@ -1,5 +1,19 @@
require 'spec_helper'
describe User do
- pending "add some examples to (or delete) #{__FILE__}"
+ it { should have_many(:user_repositories) }
+ it { should have_many(:repositories).through(:user_repositories) }
+
+ context "#sync_repositories" do
+ before :each do
+ repos = File.read(Rails.root.join("spec/fixtures/repositories.json"))
+ stub_request(:get, "https://api.github.com/user/repos").to_return(:body => repos)
+
+ @user = Factory(:user)
+ end
+
+ it "should sync user repositories" do
+ @user.should have(30).repositories
+ end
+ end
end
View
89 spec/spec_helper.rb
@@ -1,33 +1,58 @@
-# This file is copied to spec/ when you run 'rails generate rspec:install'
-ENV["RAILS_ENV"] ||= 'test'
-require File.expand_path("../../config/environment", __FILE__)
-require 'rspec/rails'
-require 'rspec/autorun'
-
-# Requires supporting ruby files with custom matchers and macros, etc,
-# in spec/support/ and its subdirectories.
-Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
-
-RSpec.configure do |config|
- # == Mock Framework
- #
- # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
- #
- # config.mock_with :mocha
- # config.mock_with :flexmock
- # config.mock_with :rr
- config.mock_with :rspec
-
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
-
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
- # examples within a transaction, remove the following line or assign false
- # instead of true.
- config.use_transactional_fixtures = true
-
- # If true, the base class of anonymous controllers will be inferred
- # automatically. This will be the default behavior in future versions of
- # rspec-rails.
- config.infer_base_class_for_anonymous_controllers = false
+require 'rubygems'
+require 'spork'
+
+Spork.prefork do
+ ENV["RAILS_ENV"] ||= 'test'
+ require File.expand_path("../../config/environment", __FILE__)
+ require 'rspec/rails'
+ require 'rspec/autorun'
+ require 'webmock/rspec'
+ require 'database_cleaner'
+
+ # Requires supporting ruby files with custom matchers and macros, etc,
+ # in spec/support/ and its subdirectories.
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+
+ RSpec.configure do |config|
+ # == Mock Framework
+ #
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+ config.mock_with :rspec
+
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
+
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
+ # examples within a transaction, remove the following line or assign false
+ # instead of true.
+ config.use_transactional_fixtures = true
+
+ # If true, the base class of anonymous controllers will be inferred
+ # automatically. This will be the default behavior in future versions of
+ # rspec-rails.
+ config.infer_base_class_for_anonymous_controllers = false
+
+ config.before(:each) do
+ DatabaseCleaner.start
+ end
+
+ config.after(:each) do
+ DatabaseCleaner.clean
+ end
+ end
+end
+
+Spork.each_run do
+ require 'factory_girl_rails'
+ FactoryGirl.reload
+
+ # reload all the models
+ Dir["#{Rails.root}/app/models/**/*.rb"].each do |model|
+ load model
+ end
end
+

0 comments on commit 811e032

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