CocoaPods / search.cocoapods.org

This is the CocoaPods search engine repo, please direct CocoaPods issues to the main CocoaPods repository.
25 stars 11 forks source link

Handle subspecs. #9

Closed alloy closed 12 years ago

alloy commented 12 years ago

Currently we only show the spec that wraps subspecs, but we should show the subspecs separately. An example of this is the RestKit spec.

floere commented 12 years ago

In the results you mean?

alloy commented 12 years ago

Yes :)

floere commented 12 years ago

What's the reason? Is that important?

alloy commented 12 years ago

Yeah. They are basically separate modules, like the rails gem which is just a meta spec for its dependencies.

floere commented 12 years ago

But do users of a pod actually ever refer to the subspecs, or do they pull in the BlocksKit as a whole, like we do with gems? (Well, not exactly, but in general)

alloy commented 12 years ago

Yes they do. And actually, because of a incomplete feature/bug, it is currently mandatory that they choose subspecs of a meta/wrapper spec, so it would be nice if they are easily found without reading the podspec source. See:

floere commented 12 years ago

Aha! Thanks for taking the time and explaining.

floere commented 12 years ago

Umm… design ideas? :)

alloy commented 12 years ago

I think they should be shown like any other pod, but with the full name. E.g. "RestKit/ObjectMapping/JSONKit". And perhaps we should add a list of links to the sub pods from the main pod, e.g. ‘RestKit’.

@mk @joe-loco What are your thoughts on this?

floere commented 12 years ago

I thought I got it, but now I don't anymore.

So the JSONKit pod is findable currently: http://cocoapods.org/?q=on%3Aosx%20on%3Aios%20json%20kit

The change is that you think it's important to find the "RestKit/ObjectMapping/JSONKit" when e.g. searching for RestKit?

Shouldn't we just list the JSONKit in the RestKit result itself? (And this is only found when searching for e.g. rest kit)

alloy commented 12 years ago

True, although that might just be this example where they are so closely connected to each other. It might happen that someone creates subspecs for a bigger framework, where individual modules are real separate components, though that hasn’t happened yet.

floere commented 12 years ago

Ok. Note that I don't advocate one approach over the other. I'm just trying to find out the best approach. Perhaps we could just try one? (Although… it's bed time for old me :|)

alloy commented 12 years ago

I’m all for just trying and I would start with the simplest solution, which is probably your last suggestion :)

floere commented 12 years ago

Okiedokie. I can do it, but would be happy if you told me how to get at the subspecs (yeah, lazy, I know ;) ).

alloy commented 12 years ago

Mais oui! Currently there is no method yet that gets a list of all subspecs, so you’d have to traverse it like so:

mapper = lambda do |spec|
  spec.subspecs.map do |subspec|
    [subspec, *mapper.call(subspec)]
  end.flatten
end

mapper.call(wrapper_spec)

This is untested code, though :) And if you feel like it, it might be more appropriate to add it to CocoaPods itself, but I can do that afterwards too.

Now first get some sleep! :)

floere commented 12 years ago

Nice one! flatten is not necessary, if I see that correctly? We can't run into circularity problems, I assume?

I think too that this would be useful in CocoaPods itself :)

Anyway… Yeah, sleep :) Have a great day!

floere commented 12 years ago

Btw, 122 indexed specs! Wohoo…

alloy commented 12 years ago

Yeah the flatten was just-in-case because of it being untested code :)

Btw, 122 indexed specs! Wohoo…

Awesome!!

floere commented 12 years ago

You were right about the flatten :)

'tis released: http://cocoapods.org/?q=on%3Aosx%20on%3Aios%20rest%20kit

Have fun!

I'm closing this – reopen a new issue if something needs to be changed. (Or change it yourself, of course :) )

alloy commented 12 years ago

Thanks, bro.

I think it needs some more work, e.g. you can't find it when looking for, for instance, CoreData. I’ll get that to that somewhere next week :)

floere commented 12 years ago

Should a parent spec be findable using its subspecs? (Because I only implemented showing them in the result) As soon as my brain gets around the idea of subspecs, I'll be able to really help ;)