• Stars
    star
    175
  • Rank 218,059 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 13 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sublime Text 2 Guard Plugin - helps create a smoother development workflow.

Sublime Text 2 Guard Plugin

This project provides integration of Guard into the Sublime Text 2 editor. I wrote this as a convenience tool to help improve my daily workflow while deving on numerous projects using BDD and TDD.

This plugin provides an interface for controlling Guard and viewing Guards output within the Sublime Text 2 editor. Not having to switch between a terminal and an editor to see Red/Green states improves workflow drastically.

All of the commands are available via the command palette (super+shift+p).

When performing some operations in Sublime Text 2, like search, it hides the Guard output. Therefore, this plugin provides a default key binding (super+shift+c) to show or reshow the Guard output. It also has an auto show feature that shows or reshows the Guard output automatically when any new content comes in from the Guard process.

  • Commands available when Guard is NOT running

    • Start Guard
  • Commands available all of the time

    • Hide Guard Output (disable auto show)
    • Show Guard Output (enable auto show) (super+shift+c)
  • Commands available when Guard IS running

    • Stop Guard
    • Run all Tests
    • Run all Tests & Show Guard Output (does NOT enable auto show) (ctrl+shift+g)
    • Reload Guard
    • Toggle Notifications
    • Pause/Unpause
    • Output Help

Package Control Installation

This plugin is available via Sublime Package Control. To install using the Sublime Package Control perform the following steps:

  1. Open the Command Palette using super+shift+p and select Package Control: Install Package
  2. Select Guard from the popup menu and press return
  3. Wait for the status bar in the lower left conrner to notify you the install is complete.

Package Control Upgrade

If installed via Sublime Package Control. The plugin will be upgraded to the latest version automatically at Sublime Text 2 startup. Therefore, if you want to force an upgrade of the plugins simply Quit Sublime Text 2 and start it up again.

Manual Installation

To install this Sublime Text 2 plugin, simply run the following commands:

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/
git clone git://github.com/cyphactor/sublime_guard.git Guard

Manual Upgrade

To upgrade to the latest version, simply run the following commands:

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Guard
git pull

Usage

Command Palette

As mentioned above the primary way of using this plugin is via the command palette (super+shift+p). Once the command palette is up, fuzzy match the intendend command, and press the return key.

Starting Guard

If Guard is not currently running, start Guard using the "Start Guard" command. It will bring up a pane at the bottom of the screen and show the output of Guard as it runs.

Show/Hide Guard Output

The Guard output can be shown and hidden using the "Show Guard Output" and "Hide Guard Output" command respectively. The "Show Guard Output" command is also available via the default key binding (super+shift+c).

Run all Tests & Show Guard Output

Some users prefer a workflow in which the guard pane is hidden the majority of the time and it is just shown when they run all the tests. For those users we have the "Run all Tests & Show Guard Output" command. This command shows the guard output similar to the "Show Guard Output" command except this command does NOT enable auto show. This command is available as always via the command pallete, but also via the key binding (ctrl+shift+g).

Other Useful Commands

A few of my favorites commands are "Run all Tests", "Reload Guard", and "Pause/Unpause". The "Run all Tests" command will simply request that Guard run all of the tests. The "Reload Guard" command is useful if changes have been made to Rails config initializers or something else that requires reloading. The "Pause/Unpause" command is primarily useful when switching branches or rebasing. It will temporarily prevent Guard from monitoring the project files for changes.

RVM Support

This plugin supports RVM out of the box. Basically, it means that it first checks to see if RVM is installed and loads it. Once RVM is loaded it then looks to see if any of the top level folders in Sublime Text 2 contain a project specific .rvmrc. If one does it will load that .rvmrc and attempt to run Guard on that project.

In the case where it can't find RVM it simply tries to run Guard assuming it is installed as a system gem.

rbenv Support

This plugin supports rbenv out of the box. This means it checks to see if $HOME/.rbenv exists and appropriately modifies the PATH environment variable to include $HOME/.rbenv/bin in the path. It also runs rbenv init - for you.

In the case where it can't find rbenv it simply tries to run Guard assuming it is installed as a system gem.

Clear Output when Matched String Found

The user must create a json file called Guard.sublime-settings in the user config directory Packages/User/. This file has the following format:

{
  "clear_when_find_this_text": "Running: .*_spec.rb"
}

Some suggested matches are as follows:

  • Running: .*_spec.rb
  • Running: .*_spec.rb|Failures:
  • Running: .*_spec.rb|Failures:|Reloading Spork for RSpec

If you do NOT want to use this feature simply do not define the clear_when_find_this_text setting.

FAQs

Does the Guard process die/exit when Sublime Text 2 dies/exits?

Yes.

Why would I get "Failed to find Guardfile and Gemfile in any of the open folders." as an error?

This error message is a result of the project currently loaded in Sublime Text 2 missing either the Guardfile, the Gemfile, or both. Currently, this plugin requires a Guardfile and a Gemfile to be present in the projects root path to run Guard.

Where do I find out about Guardfiles?

The best place to find out about Guardfiles is the Guard project page.

Where do I found out about Gemfiles?

The best place to find out about Gemfiles is the Bundler project.

What do I do if I find a bug?

Please report all bugs/issues via the Issues tab.

What do I do if I have an idea for a feature/change?

All feature requests or change requests should be made via the Issues tab.

Contributions

As with all of my Open Source Projects I am open to contributions. There are numerous ways one can contribute.

  1. Contribute Code/Documentation - If you would like to contribute code or documentation changes please fork the repository and submit a pull request.
  2. Feature Requests/Bug Reports - If you would like to contribute by submitting either a feature request or a bug report you may do so via the Issues tab.

More Repositories

1

alt

Command line tool to find alternate files
Rust
135
star
2

git-ps-rs

Official git-ps Rust implementation - the future of git-ps
Rust
78
star
3

git-ps

Patch Stack workflow CLI extension for Git
Swift
50
star
4

togls

An ultra light weight yet ridiculously powerful Ruby feature toggle gem
Ruby
23
star
5

git-cl

Git command line tool for managing your CHANGELOG with defined schema entries in your commits
Swift
23
star
6

octopusci

A multi-branch continuous integration server
Ruby
19
star
7

vim-open-alternate

Vim plugin that makes it trivial to jump between alternate files (test files & implementation, etc.)
Vim Script
11
star
8

Constraid

Your friendly NSLayoutConstraint Aid
Swift
11
star
9

flutter_forge

This is the beginnings of the flutter_riverpod_composable_arch and a sample app to play around with it.
Dart
6
star
10

tmuxme

Offical repo has moved to
Ruby
6
star
11

snapdragon

A Jasmine JavaScript test runner that lets you run tests on the command-line similar to RSpec.
JavaScript
6
star
12

Flot

Flot (a pure Javascript plotting library for jQuery) with additional features (multi-series bar graphs, etc).
JavaScript
5
star
13

vim-ping-cursor

Vim plugin to help you quickly locate the cursor position
Vim Script
5
star
14

git-ps-book

The official Git Patch Stack Book
5
star
15

mailmate_stylesheets

My Personal MailMate Stylesheets
CSS
4
star
16

jquery-sliders-rails

Gem that provides the jQuery Sliders plugin to Rails 3 apps
Ruby
4
star
17

vim-slack-format

Vim plugin providing the slack file type and syntax highlighting support for it
Vim Script
4
star
18

boxci

Tool to simplify create virtual development environments and cloud based CI jobs
Ruby
4
star
19

libgnutmsgs

A unix C implementation of the Gnutella protocol designed to test ad injection on the network.
C
3
star
20

dotzsh

My zsh setup (.zshrc and helper scripts)
Shell
3
star
21

archaic

IRC Chat Archiving and Analysis Tool
Ruby
3
star
22

tmuxme_client

Offical repo has moved to
Ruby
2
star
23

dotnvim

My personal neovim dot files.
Lua
2
star
24

dotack

Dot files for my ack setup, primarily ~/.ackrc
2
star
25

tagalong

A Rails tagging plugin that makes sense. ( Note: has built in support for Sunspot for search )
Ruby
2
star
26

jquery_comp_hist

jQuery Comparative Histogram plugin. Often used for demographics.
JavaScript
2
star
27

gnuautotools-tmbundle

GNU Autotools TextMate Bundle
Shell
2
star
28

dotvim

My personal Vim dot files (.vimrc, .vim dir, vim plugins, etc.)
Ruby
2
star
29

git-tools

This repo is to house git tools we whip up
Shell
2
star
30

trac_embed_gitweb

Trac 0.11 plugin to embed gitweb inside the Browse Source tab.
Python
2
star
31

pra

The command line (ncurses) based pull request aggregator
Ruby
2
star
32

jquery_sliders

A simple very generic jQuery slideshow plugin
JavaScript
2
star
33

trac_ticket_creator

Trac XmlRpcPlugin Front-end for creating tickets more fluidly.
Python
2
star
34

libgnut

A cross-platform implementation of the Gnutella protocol.
C
2
star
35

dottmux

My personal tmux dot files.
Shell
1
star
36

activerecord_history

An extension to active record that allows tracking of changes to database entities.
Ruby
1
star
37

skiplist_applet

A small Java applet that I wrote to assist in teaching skip lists.
Java
1
star
38

usurper_applet

PDF Flash Card Quizing Applet for Gnome
C
1
star
39

opensync_zdtm_plugin

This provides the OpenSync framework an interface to lib_zdtm_sync to allow syncing.
C
1
star
40

zync

A command line tool to synchronize the Zaurus. (obsolete)
C++
1
star
41

podcasts

Current state of the podcasts listen to and videos I watch
1
star
42

zync_korg_todo_plugin

A KOrganizer plugin interfaced with zync. (obsolete)
C++
1
star
43

zync-gui

A graphical user interface to zync. (obsolete)
C++
1
star
44

th-deckjs-template

ThoughtHatchery deck.js template
JavaScript
1
star
45

lib_zdtm_docs

LaTeX source and other documentation we have written for the lib_zdtm_sync project.
Shell
1
star
46

lifecyclemanager

Trac plugin for Tracking & Managing the Lifecycle of Software Projects
Python
1
star
47

alt-archlinux-builder

Dockerfile and source for the alt-archlinux-builder Docker image
1
star
48

lib_zdtm_sync

A cross-platform library to speak the Zaurus synchronization protocol. It provides an interface to parse and create the packets sent to and received from the Zaurus.
C
1
star