Giter Club home page Giter Club logo

coral's Introduction

Coral

Coral is a set of shell commands that help working with open-source projects, Ruby apps, GitHub and more.

Coral is a sub in the way its structure grew out of rbenv's.

Installation

git clone git://github.com/mislav/coral.git ~/.coral

# display instructions how to edit shell configuration:
~/.coral/bin/coral init

# later, when you've reloaded the new shell configuration:
coral doctor

See coral help for available commands.

Features

Organizing git clones of GitHub repos

If you read the code or contribute to a number of open-source projects, you might have become tired of picking a clone destination for each of those projects.

Coral can clone repos for you and keep them organized in its internal directory structure:

coral clone bootstrap             # will search GitHub and pick the first result
coral clone twitter/bootstrap     # if you want to be explicit
coral path bootstrap              # display the path of where Bootstrap is locally

coral cd bootstrap                # cd into Bootstrap's project directory
git tag | coral sort-versions     # display available versions

coral checkout bootstrap v2.2.0   # check out a new working copy for Bootstrap v2.2.0
coral cd [email protected]         # cd into the new working copy

coral list bootstrap              # list available working copies of Bootstrap

Working with RubyGems and Bundler

The bonus of all Coral gem commands are that they are Bundler-aware; i.e. when you give them a name of the gem, they first search for it in the current bundle and then in globally installed gems. This helps you with inspecting versions of gems that your project currently uses.

coral gem-dir activesupport       # print the root directory of a gem
coral gem-open activesupport      # open gem's source code in the editor
coral gem-browse sinatra          # open Sinatra's home page in the browser
coral gem-browse-project sinatra  # open Sinatra's project page on Github

coral bundle-ack -w redirect_to   # search across all gems in the bundle

Render documentation files to HTML

# render any markup the same way GitHub.com does HTML:
coral github-markup path/to/README.md >> readme.html

# `github-markup` output + styles & syntax highlighting; pipe to browser
coral render-markup path/to/README.md | bcat

Opening source code in editor

Handy shortcuts for opening a project's directory in your favorite text editor. The gem-open command also has a nice feature for preloading the README file for you, if it exists:

coral gem-open activesupport      # open gem's source code & README in the editor
coral open-dir path/to/project    # open a project in $EDITOR

You should have your shell configured like so:

  • Vim:

      EDITOR=vim
      GEM_EDITOR=mvim   # or "gvim" on Linux
    
  • Sublime Text 2:

      EDITOR='subl -w'
      GEM_EDITOR=subl
    
  • TextMate:

      EDITOR='mate -w'
      GEM_EDITOR=mate
    

Miscellaneous unix goodies

coral sort-versions               # sort version numbers on STDIN
coral fetch-url <url>             # fetch URL and cache the result for 24 hours
coral parse-json                  # parse JSON and output in flat, line-based format

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.