Sha256: 9c09b11fb60480a6c249be67072a415f423f36681db2b243f0cfeff08dc9071d

Contents?: true

Size: 906 Bytes

Versions: 11

Compression:

Stored size: 906 Bytes

Contents

module Caboodle
  class Github < Caboodle::Kit
        
    menu "Code", "/code" do
      @title = "Code"
      @repos = GithubAPI.repositories
      
      @repos.sort!{|a, b| a.watchers <=> b.watchers}.reverse!
      @my_repos = @repos.clone
      @my_repos.delete_if{|a| a.fork }
      
      @forked_repos = @repos.clone
      @forked_repos.delete_if{|a| !a.fork }
      
      haml :github
    end
    
    required [:github_username]
    
    defaults []
    
    credit "http://gitbhu.com/#{Site.github_username}"
  end

  class GithubAPI < Weary::Base
    
      declare "repositories" do |r|
        r.url = "http://github.com/api/v2/json/repos/show/#{Caboodle::Site.github_username}"
        r.via = :get
      end
      
      def self.repositories
        a = Hashie::Mash.new(GithubAPI.new.repositories.perform_sleepily.parse).repositories
        puts a.inspect
        a
      end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
caboodle-0.2.13 lib/caboodle/kits/github/github.rb
caboodle-0.2.12 lib/caboodle/kits/github/github.rb
caboodle-0.2.11 lib/caboodle/kits/github/github.rb
caboodle-0.2.10 lib/caboodle/kits/github/github.rb
caboodle-0.2.9 lib/caboodle/kits/github/github.rb
caboodle-0.2.8 lib/caboodle/kits/github/github.rb
caboodle-0.2.7 lib/caboodle/kits/github/github.rb
caboodle-0.2.6 lib/caboodle/kits/github/github.rb
caboodle-0.2.5 lib/caboodle/kits/github/github.rb
caboodle-0.2.3 lib/caboodle/kits/github/github.rb
caboodle-0.2.2 lib/caboodle/kits/github/github.rb