• Stars
    star
    190
  • Rank 197,240 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

Refresh

Rebuild and re-run your Go applications when files change.

This project was inspired by https://github.com/pilu/fresh. The lack of updates and response from the maintainer, non-idiomatic codebase, numerous bugs, and lack of detailed reporting made the project a dead end for me to use. Enter refresh.

This simple command line application will watch your files, trigger a build of your Go binary and restart the application for you.

Installation

$ go get github.com/markbates/refresh

Getting Started

First you'll want to create a refresh.yml configuration file:

$ refresh init

If you want the config file in a different directory:

$ refresh init -c path/to/config.yml

Set it up the way you want, but I believe the defaults really speak for themselves, and will probably work for 90% of the use cases out there.

Usage

Once you have your configuration all set up, all you need to do is run it:

$ refresh run

That's it! Now, as you change your code the binary will be re-built and re-started for you.

HTTP Handler

Refresh is nice enough to ship with an http.Handler that you can wrap around your requests. Why would you want to do that? Well, if there is an error doing a build, the built in http.Handler will print the error in your browser in giant text so you'll know that there was a problem, and where to fix it (hopefully).

...
m := http.NewServeMux()
err = http.ListenAndServe(":3000", web.ErrorChecker(m))
...

Configuration Settings

# The root of your application relative to your configuration file.
app_root: .
# List of folders you don't want to watch. The more folders you ignore, the 
# faster things will be.
ignored_folders:
  - vendor
  - log
  - tmp
# List of file extensions you want to watch for changes.
included_extensions:
  - .go
# The directory you want to build your binary in.
build_path: /tmp
# `fsnotify` can trigger many events at once when you change a file. To minimize
# unnecessary builds, a delay is used to ignore extra events.
build_delay: 200ms
# If you have a specific sub-directory of your project you want to build.
build_target_path : "./cmd/cli"
# What you would like to name the built binary.
binary_name: refresh-build
# Extra command line flags you want passed to the built binary when running it.
command_flags: ["--env", "development"]
# Extra environment variables you want defined when the built binary is run.
command_env: ["PORT=1234"]
# If you want colors to be used when printing out log messages.
enable_colors: true

More Repositories

1

goth

Package goth provides a simple, clean, and idiomatic way to write authentication packages for Go web applications.
Go
4,979
star
2

pkger

Embed static files in Go binaries (replacement for gobuffalo/packr)
Go
1,187
star
3

configatron

A super cool, simple, and feature rich configuration system for Ruby apps.
Ruby
602
star
4

grift

Go based task runner
Go
431
star
5

coffee-rails-source-maps

DO NOT USE THIS!! I DO NOT MAINTAIN IT!
Ruby
241
star
6

coffeebeans

The parts of CoffeeScript they forgot in Rails 3.1!
Ruby
229
star
7

cover_me

An RCov-esque coverage tool for Ruby 1.9
Ruby
204
star
8

jquery-bootstrap-pagination

CoffeeScript
91
star
9

Programming-In-CoffeeScript

Source code for the Programming in CoffeeScript book.
CoffeeScript
63
star
10

going

Some helpful packages for writing Go apps.
Go
55
star
11

dj_remixes

Enhancements and improvements for Delayed Job 2.x
Ruby
42
star
12

mack

A Ruby web application framework
Ruby
39
star
13

warp_drive

Screw Rails Engines! Why not install a Warp Drive! Completely bundle up an ENTIRE Rails application into a gem, then load it into another application! It's that easy!
Ruby
34
star
14

myvim

My VIM setup. Use at your own risk.
Vim Script
34
star
15

buffla

URL Shortner written in Buffalo
Go
30
star
16

inflect

DEPRECATED: use github.com/gobuffalo/flect instead
Go
24
star
17

fluent-2014

Source code for the Angular Fundamentals workshop at FluentConf 2014.
JavaScript
22
star
18

ghi

Offline GitHub Issues Client
Go
19
star
19

cachetastic

A very simple, yet very powerful caching framework for Ruby
Ruby
18
star
20

delayed_job_extras

This project has moved to markbates/dj_remixes. Please do not follow this project!
Ruby
17
star
21

buffalo-heroku

Archived use github.com/gobuffalo/buffalo-heroku
Go
17
star
22

mongoid-tags-arent-hard

A tagging gem for Mongoid 3 that doesn't actually suck.
Ruby
16
star
23

distribunaut

A framework agnostic port of the mack-distributed package.
Ruby
16
star
24

yamler

Tools for using YAML w/ Ruby easier.
Ruby
11
star
25

gormrecipe

An example of using Gorm with Buffalo
Go
10
star
26

mack-more

All the extra stuff you could want for the Mack Framework.
Ruby
10
star
27

mongoid_delorean

THIS PROJECT IS NOT MAINTAINED. USE AT YOUR OWN RISK. NO PRs ACCEPTED.
Ruby
9
star
28

genosaurus

A simple and easy to use generator system for Ruby
Ruby
9
star
29

gocker

Go
9
star
30

informit_articles

InformIT Articles
Ruby
7
star
31

macker-s-guide

A User's Guide to the Mack Framework
JavaScript
7
star
32

gemstub

A simple gem for creating the stub of other gems
Ruby
7
star
33

api_doc

Easily generate API docs from RSpec/Rails
Ruby
7
star
34

faraday_bang

Adds error raising ! methods to Faraday
Ruby
6
star
35

gem-freezer

A simple gem that helps you freeze gems, and their dependencies into your project.
Ruby
5
star
36

contextual

context.Context utilities
Go
5
star
37

wailsx

WIP: Tools for working with Wails.io
Go
5
star
38

nor-dev

Development Playground for Node on Rails (NOR)
CoffeeScript
4
star
39

willie

Easy testing of Go web type stuff
Go
4
star
40

cash

A Go package for working with cash.Money :)
Go
4
star
41

oncer

Go
4
star
42

markdownr

Go
4
star
43

gobular

Go Regular Expression Tester
Go
4
star
44

gemtronics

A much better of managing your gem dependencies
Ruby
3
star
45

breach

Ruby
3
star
46

buffalo-bootstrap

A plugin for github.com/gobuffalo/buffalo for generating Bootstrap stuff
Go
3
star
47

deplist

Get a list of all the Go dependencies for the current directory
Go
3
star
48

braai

Fully Extensible Templates
Ruby
3
star
49

mack-user_auth_portlet

A collection of Portlets for the Mack Framework
Ruby
3
star
50

deano

A starter template for Sinatra Applications
Ruby
3
star
51

buffalo-rails

Go
3
star
52

sigtx

a context implementation for signal capturing
Go
3
star
53

micro-mack

A 'micro' version of the Mack Framework
Ruby
3
star
54

miki

A lightweight, Mack-based Wiki powering www.mackwiki.com
Ruby
3
star
55

jim

Go
3
star
56

mocha-coffeescript-tmbundle

TextMate/Sublime Text 2 bundle for Mocha (CoffeeScript)
2
star
57

bluffalo

Go
2
star
58

errx

Makefile
2
star
59

coke

Go
2
star
60

mark_facets

Just a collection of common extensions and add-ons I use in most Ruby/Rails projects.
Ruby
2
star
61

assoc

Go
2
star
62

chalk

Quickly and easily create a pool of `go routines`.
Go
2
star
63

rails_templates

Templates for building Rails applications
Ruby
2
star
64

control

Go
2
star
65

ekar

Ekar, a Rake replacement, maybe?
Ruby
2
star
66

rack-cachely

Rack Middleware for working with the CachelyApp Page Cache Service
Ruby
2
star
67

syncx

Go
2
star
68

opal-rb-example

A "todo" example using the Opal.rb Project.
Ruby
2
star
69

snooze_force

SnoozeForce - A Client for Saleforce.com's REST API
Ruby
2
star
70

blabber_mouth

Easy model-like notification system for Ruby. (A framework agnostic port of the mack-notifier package.)
Ruby
2
star
71

bostongo

Go
2
star
72

mytmux

1
star
73

ringo

Go
1
star
74

labs

Go
1
star
75

gjs

HTML
1
star
76

haste

Go
1
star
77

ek

A simple echo server
Go
1
star
78

content_o_matic

A gem to download the contents of a page and include them into your application.
Ruby
1
star
79

FakeWeb.js

A port of FakeWeb (Ruby) to help test JavaScript AJAX apps
CoffeeScript
1
star
80

gurl

Go
1
star
81

tt

T.T. The Test Running Bear!
Go
1
star
82

gonit

Go
1
star
83

bert

Go
1
star
84

cleo

Go
1
star
85

buffalo-trash

Go
1
star
86

bloggy

HTML
1
star
87

markbates.github.com

HTML
1
star
88

gentronics

Go
1
star
89

clio

Go
1
star
90

clam

Go
1
star
91

cobble

A very simple and easy library to help facilitate the building and creating of objects.
Ruby
1
star
92

konacha-sinatra

Ruby
1
star
93

hmax

A Golang package to make working with HMAC requests easier.
Go
1
star
94

safe

Go
1
star