Project

morsel

0.0
No commit activity in last 3 years
No release in over 3 years
A way to manage your source dependencies, inspired by rubygems, bundler, and homebrew.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.3.0

Runtime

>= 1.2.5
 Project Readme

morsel: git submodules are overkill

I want to user other people's code. Most of the time, I don't want to use git submodules. For those times, I wrote morsel.

Point morsel at a git repository and tell it which files you want. It'll fetch them for you and place them into your source tree.

Problem

There is no dependency management system for Cocoa development. Everytime I want to use a new library, my options are:

  1. Clone the repository. Figure out which files I need. Copy them into my source tree.

  2. Add a git submodule.

Both options are annoying in their own way. Inspired by bundler and homebrew, I present morsel.

Install

morsel is available as a RubyGem

$ gem install morsel

Usage

Create a Morselfile in your project's root that looks something like this:

morsel 'jsonkit' do |m|
    m.url = 'https://github.com/johnezang/JSONKit.git'
    m.files = %w{
        JSONKit.h
        JSONKit.m
    }
end

You can optionally set a branch if you do not want the default:

morsel 'jsonkit' do |m|
    m.url = 'https://github.com/johnezang/JSONKit.git'
    m.branch = 'experimental'
    m.files = %w{
        JSONKit.h
        JSONKit.m
    }
end

Then run morsel install. It'll clone the repos into ~/.morsel/repos and then copy your desired files into a morsels directory in your project's root:

$ find .
.
./Morselfile
./morsels
./morsels/jsonkit
./morsels/jsonkit/JSONKit.h
./morsels/jsonkit/JSONKit.m

That's it!

What's Next

First, the whole thing is half-baked, so fleshing it out a bit will be nice.

Then, it's annoying to have to define the url and files for each morsel. An ideal Morselfile would look something like this:

morsel 'jsonkit', :sha => 'c9ffd8f823e68df96fa2f87185bee861984ef637'
morsel 'asihttprequest', :tag => 'v1.8'

That'll require some homebrew-style package management.