npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gistpod

v0.2.2

Published

CLI helpers for hosting ad-hoc CocoaPods podspecs as GitHub gists during rapid development

Downloads

3

Readme

gistpod

Usage: gistpod [options] [command]


  Commands:

    username <username>         set the GitHub username from which to retrieve gists (config file: ~/.gistpod)
    url <pod>                   look up the latest gist URL for the specified CocoaPod
    pull                        pull the latest data from the GitHub API into your local cache (~/.gistpod-cache)
    update <Podfile> [pods...]  updates the gist refs for the given Pods (or all Pods, if none are specified) in the specified Podfile to the latest revisions
    list                        list known podspec gists
    help [cmd]                  display help for [cmd]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

CLI tool (written in node.js) to facilitate using GitHub gists as temporary CocoaPods podspecs.

Works with Swift-enabled versions of CocoaPods (gem install cocoapods --pre). In fact, that's pretty much the only reason I made this.

Given how much of the Swift code out in the wild still has no official podspec (and, for that matter, given all of the one-page microclasses I've found myself writing in Swift), I've been using gists (https://gist.github.com) pretty frequently to deal with temporary (and rapidly-changing) podspecs during fast development cycles.

But the problem, as far as I can tell, is that any time you commit a change to a gist, the raw gist URL changes. (I'm not aware of any redirect URL to the actual raw source... is anyone else?). That means that every time you change a podspec, you'll be stuck copying its new gist URL around to all of your Podfiles manually.

Can NOT be trifling with that. I'd much rather just Cmd-Tab into iTerm and run something... like...

$ gistpod update

Podfile updated.

moar examples

 $ gistpod list

Pod                      Podspec gist URL
-------------------      ------------------------------------------------------------------
ReactiveCocoaSwift       https://gist.github.com/brynbellomy/.../ReactiveCocoaSwift.podspec
JSTilemap                https://gist.github.com/brynbellomy/.../JSTilemap.podspec
Signals                  https://gist.github.com/brynbellomy/.../Signals.podspec
Starscream               https://gist.github.com/brynbellomy/.../Starscream.podspec
Basis                    https://gist.github.com/brynbellomy/.../Basis.podspec

# the update command is:
# $ gistpod update [Podfile directory] [pods to update]
$ gistpod update . Starscream ReactiveCocoa-Swift

Podfile updated.
  • gistpod list:

    1. queries your GitHub account for all gists containing at least one podspec file — i.e., matching the pattern *.podspec...
    2. ...and displays the direct, raw URL to the latest revision of each podspec's gist.

    (Note: just to be totally clear, I added the dot-dot-dots. The command gives the full path.)


  • gistpod update:

    1. backs up <project root>/Podfile to ~/.gistpod-backup, ...
    2. reads your Podfile template from <project root>/Podfile.gistpod, and then ...
    3. writes an updated Podfile to <project root>/Podfile. Each pod placeholder (#{Starscream}, etc.) is replaced by its respective URL (from the gistpod list command).

    Now you can pod install your heart out, confident that your jank-ass, ghetto-rigged ("dev") in-house podspecs are all at least referencing the latest commits in your gist account.


install

Install with npm

$ npm install -g gistpod

Set your GitHub username (one-time):

$ gistpod username brynbellomy

Now you can list all of the podspecs that you have stored as gists:

$ gistpod list

@@TODO: display a diff if there were any changes

main usage/workflow

1. Make a copy of your Podfile called Podfile.gistpod.

Put it in <project root>, alongside the original:

$ cp Podfile Podfile.gistpod

2. Open Podfile.gistpod.

You will need to change the :podspec => '...' URLs for any of the podspecs that you want to keep automatically synced with your gists account. The entire podspec URL (including quotes) must be replaced with the placeholder #{PodName}.

In other words, change this:

platform :osx, '10.10'

pod 'Starscream', :podspec => 'https://raw.github.com/dfd19ac23..../Starscream.podspec'
pod 'ReactiveCocoa-Swift', :podspec => 'https://raw.github.com/fdc2a3d19..../ReactiveCocoa-Swift.podspec'

...to this:

platform :osx, '10.10'

pod 'Starscream', :podspec => #{Starscream}
pod 'ReactiveCocoa-Swift', :podspec => #{ReactiveCocoa-Swift}

3. Update your local cache of podspec URLs with gistpod pull.

$ gistpod pull

@@TODO: display a diff if there were any changes

4. Run gistpod update to update the URLs in your Podfile.

This does the inverse of step 3: it finds all of those #{PodPlaceholders} in your Podfile.gistpod and replaces each one with the latest commit URL for its respective podspec.

$ gistpod update [optional path to Podfile] [optional list of pods to update]

Any time you run gistpod update, your Podfile is backed up (to ~/.gistpod-backup) and then overwritten with a new Podfile built from its accompanying Podfile.gistpod. The #{PodPlaceholders} will be replaced by URLs pointing at the latest revision of each of your gist podspecs on GitHub.

other commands

The gistpod url command returns only the gist URL for a given podspec (and not a byte more or less):

$ gistpod url Starscream

This is useful if you're doing any kind of shell scripting, or if you want to (painlessly) copy the URL to the clipboard, or...

$ gistpod url Starscream | pbcopy

authors

bryn austin bellomy < [email protected] >