Permalink
Browse files

use Drawer to display detail informations

  • Loading branch information...
1 parent 8e7c653 commit 8704d50dd106486e025cfb3fb4eab60e191f4d82 @Watson1978 committed Nov 21, 2011
Showing with 1,084 additions and 2,997 deletions.
  1. +28 −5 PodCreator/PodList.rb
  2. +1,056 −2,992 PodCreator/en.lproj/MainMenu.xib
View
@@ -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")
@@ -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
Oops, something went wrong.

0 comments on commit 8704d50

Please sign in to comment.