Skip to content
This repository has been archived by the owner on Sep 2, 2018. It is now read-only.

Commit

Permalink
use Drawer to display detail informations
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Nov 21, 2011
1 parent 8e7c653 commit 8704d50
Show file tree
Hide file tree
Showing 2 changed files with 1,084 additions and 2,997 deletions.
33 changes: 28 additions & 5 deletions PodCreator/PodList.rb
Expand Up @@ -3,13 +3,39 @@
# PodCreator
#

module Spec
ITEMS = ['name', 'homepage', 'description', 'version', 'authors', 'license']

module_function
def list
result = []

pods = Pod::Source::search_by_name("", false)
pods.each do |pod|
h = {}
ITEMS.each do |item|
h[item] = eval("pod.specification.#{item}") || ""
end

author = []
h['authors'].keys.each do |k|
author << "#{k} : #{h['authors'][k]}"
end
h['authors'] = author.join(', ')

result << h
end
result
end
end

class PodList < NSWindowController
attr_accessor :delegate
attr_accessor :tableView
attr_accessor :arrayController

def init
@pods = Pod::Source::search_by_name("", true)
@pods = Spec::list

super
self.initWithWindowNibName("PodList")
Expand All @@ -19,10 +45,7 @@ def awakeFromNib
tableView.setTarget(self)
tableView.setDoubleAction("selectPods:")
@pods.each do |pod|
arrayController.addObject({'name' => pod.name,
'version' => pod.versions.join(", "),
'description' => pod.specification.summary
})
arrayController.addObjects(@pods)
end
end

Expand Down

0 comments on commit 8704d50

Please sign in to comment.