Sha256: 4beeb245dac0aa3e6ef655a5063445573eb8df2f3a1fb8b2611d340009501fe7

Contents?: true

Size: 908 Bytes

Versions: 7

Compression:

Stored size: 908 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 []
    
    original "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

7 entries across 7 versions & 1 rubygems

Version Path
caboodle-0.2.1 lib/caboodle/kits/github/github.rb
caboodle-0.2.0 lib/caboodle/kits/github/github.rb
caboodle-0.1.9 lib/caboodle/kits/github/github.rb
caboodle-0.1.8 lib/caboodle/kits/github/github.rb
caboodle-0.1.7 lib/caboodle/kits/github/github.rb
caboodle-0.1.6 lib/caboodle/kits/github/github.rb
caboodle-0.1.5 lib/caboodle/kits/github/github.rb