• Stars
    star
    285
  • Rank 140,348 (Top 3 %)
  • Language
    Ruby
  • Created about 15 years ago
  • Updated 10 months ago

Reviews

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

Repository Details

Hoe is a rake/rubygems helper for project Rakefiles. It helps you manage, maintain, and release your project and includes a dynamic plug-in system allowing for easy extensibility. Hoe ships with plug-ins for all your usual project tasks including rdoc generation, testing, packaging, deployment, and announcement.

Hoe

home

www.zenspider.com/projects/hoe.html

code

github.com/seattlerb/hoe

bugs

github.com/seattlerb/hoe/issues

rdoc

docs.seattlerb.org/hoe/

doco

docs.seattlerb.org/hoe/Hoe.pdf

clog

github.com/seattlerb/hoe/blob/master/History.rdoc

other

github.com/jbarnette/hoe-plugin-examples

DESCRIPTION:

Hoe is a rake/rubygems helper for project Rakefiles. It helps you manage, maintain, and release your project and includes a dynamic plug-in system allowing for easy extensibility. Hoe ships with plug-ins for all your usual project tasks including rdoc generation, testing, packaging, deployment, and announcement.

See class rdoc for help. Hint: ‘ri Hoe` or any of the plugins listed below.

For extra goodness, see: docs.seattlerb.org/hoe/Hoe.pdf

FEATURES/PROBLEMS:

  • Includes a dynamic plug-in system allowing for easy extensibility.

  • Auto-intuits changes, description, summary, and version.

  • Uses a manifest for safe and secure deployment.

  • Provides ‘sow’ for quick project directory creation.

  • Sow uses a simple ERB templating system allowing you to capture your project patterns.

SYNOPSIS:

% sow [group] project

(you can edit a project template in ~/.hoe_template after running sow for the first time)

or:

require 'hoe'

Hoe.spec projectname do
  # ... project specific data ...
end

# ... project specific tasks ...

Deployment, the DRY way

Hoe focuses on keeping everything in its place in a useful form and intelligently extracting what it needs. As a result, there are no extra YAML files, config directories, ruby files, or any other artifacts in your release that you wouldn’t already have.

Structure Overview

project_dir/
  History.txt
  Manifest.txt
  README.txt
  Rakefile
  bin/...
  lib/...
  test/...

README.txt

Most projects have a readme file of some kind that describes the project. Hoe projects are no different, but we take them one step further. The readme file points the reader towards all the information they need to know to get started including a description, relevant urls, code synopsis, license, etc. Hoe knows how to read a basic rdoc formatted file to pull out the description (and summary by extension), urls, and extra paragraphs of info you may want to provide in news/blog posts.

History.txt

Every project should have a document describing changes over time. Hoe can read this file (also in rdoc) and include the latest changes in your announcements.

Manifest.txt

manifest [noun] a document giving comprehensive details of a ship and its cargo and other contents, passengers, and crew for the use of customs officers.

Every project should know what it is shipping. This is done via an explicit list of everything that goes out in a release. Hoe uses this during packaging so that nothing embarrassing is picked up.

Imagine, you’re a customs inspector at the Los Angeles Port, the world’s largest import/export port. A large ship filled to the brim pulls up to the pier ready for inspection. You walk up to the captain and his crew and ask “what is the contents of this fine ship today” and the captain answers “oh… whatever is inside”. The mind boggles. There is no way in the world that a professionally run ship would ever run this way and there is no way that you should either.

Professional software releases know exactly what is in them, amateur releases do not. “Write better globs” is the response I often hear. I consider myself and the people I work with to be rather smart people and if we get them wrong, chances are you will too. How many times have you peered under the covers and seen .DS_Store, emacs backup~ files, vim vm files and other files completely unrelated to the package? I have far more times than I’d like.

"Ultimately, the manifest represents professionalism of the
 deployment process – making sure you know what you think you are
 releasing. Auto-generating the manifest should be avoided – and
 this comes from a man who loves to generate things."

-- dr nic

VERSION

Releases have versions and I’ve found it best for the version to be part of the code. You can use this during runtime in a multitude of ways. Hoe finds your version and uses it automatically during packaging.

Releasing in 1 easy step

% rake release VERSION=x.y.z

That really is all there is to it. Behind the scenes it:

  • Branches the release in our perforce server. (via hoe-seattlerb plugin)

  • Performs sanity checks to ensure the release has integrity. (hoe-seattlerb)

  • Packages into gem and tarballs.

  • Uploads the packages to rubygems.org.

  • Posts news of the release my blog.

  • Sends an announcement email. (via the hoe-seattlerb plugin gem)

That ‘VERSION=x.y.z` is there as a last-chance sanity check that you know what you’re releasing. You’d be surprised how blurry eyed/brained you get at 3AM. This check helps a lot more than it should.

Plugins:

Hoe has a flexible plugin system that allows you to activate and deactivate what tasks are available on a given project. Hoe has been broken up into plugins partially to make maintenance easier but also to make it easier to turn off or replace code you don’t want.

  • To activate a plugin, add the following to your Rakefile above your Hoe spec:

    Hoe.plugin :plugin_name
    
  • To deactivate a plugin, remove its name from the plugins array:

    Hoe.plugins.delete :plugin_name
    

Again, this must be done before the Hoe spec, or it won’t be useful.

Plug-ins Provided:

  • Hoe::Clean

  • Hoe::Compiler

  • Hoe::Debug

  • Hoe::Deps

  • Hoe::Flay

  • Hoe::Flog

  • Hoe::GemPreludeSucks

  • Hoe::Gemcutter

  • Hoe::Inline

  • Hoe::Newb

  • Hoe::Package

  • Hoe::Publish

  • Hoe::Racc

  • Hoe::RCov

  • Hoe::Signing

  • Hoe::Test

Known 3rd-Party Plugins:

  • hoe-bundler - Generates a Gemfile based on a Hoe’s declared dependencies.

  • hoe-debugging - A Hoe plugin to help you debug your codes.

  • hoe-deveiate - A collection of Rake tasks and utility functions.

  • hoe-doofus - A Hoe plugin that helps me keep from messing up gem releases.

  • hoe-gemcutter - Adds gemcutter release automation to Hoe.

  • hoe-geminabox - Allows you to push your gems to geminabox

  • hoe-gemspec - Generate a prerelease gemspec based on a Hoe spec.

  • hoe-gemspec2 - ??? submit a PR to add description

  • hoe-git - A set of Hoe plugins for tighter Git integration.

  • hoe-heroku - Helps you get your stuff on Heroku.

  • hoe-hg - A Hoe plugin for Mercurial integration.

  • hoe-highline - A Hoe plugin for building interactive Rake tasks

  • hoe-ignore - ??? submit a PR to add description

  • hoe-manifest - ??? submit a PR to add description

  • hoe-manualgen - A manual-generation plugin for Hoe

  • hoe-mercurial - A Hoe plugin for Mercurial integration.

  • hoe-reek - Integrates the reek code smell engine into your hoe projects.

  • hoe-roodi - Integrates the roodi code smell tool into your hoe projects.

  • hoe-rubygems - Additional RubyGems tasks.

  • hoe-seattlerb - Minitest, email announcements, release branching.

  • hoe-telicopter - Provides tasks used by hotelicopter.

  • hoe-travis - Allows your gem to gain maximum benefit from <travis-ci.org>.

  • hoe-version - ??? submit a PR to add description

  • hoe-yard - A Hoe plugin for generating YARD documentation.

Writing Plugins:

A plugin can be as simple as:

module Hoe::Thingy
  attr_accessor :thingy

  def initialize_thingy # optional
    self.thingy = 42
  end

  def define_thingy_tasks
    task :thingy do
      puts thingy
    end
  end
end

Not terribly useful, but you get the idea. This example exercises both plugin methods (initialize_#{plugin} and define_#{plugin}_tasks and adds an accessor method to the Hoe instance.

How Plugins Work

Hoe plugins are made to be as simple as possible, but no simpler. They are modules defined in the ‘Hoe` namespace and have only one required method (`define_#{plugin}_tasks`) and one optional method (`initialize_#{plugin}`). Plugins can also define their own methods and they’ll be available as instance methods to your hoe-spec. Plugins have 4 simple phases:

Loading

When Hoe is loaded the last thing it does is to ask rubygems for all of its plugins. Plugins are found by finding all files matching “hoe/*.rb” via installed gems or ‘$LOAD_PATH`. All found files are then loaded.

Activation

All of the plugins that ship with hoe are activated by default. This is because they’re providing the same functionality that the previous Hoe was and without them, it’d be rather useless. Other plugins should be “opt-in” and are activated by:

Hoe::plugin :thingy

Put this above your hoe-spec. All it does is add ‘:thingy` to `Hoe.plugins`. You could also deactivate a plugin by removing it from `Hoe.plugins` although that shouldn’t be necessary for the most part.

Please note that it is not a good idea to have a plugin you’re writing activate itself. Let developers opt-in, not opt-out. Just because someone needs the ‘:thingy` plugin on one project doesn’t mean they need them on all their projects.

Initialization

When your hoe-spec is instantiated, it extends itself all known plugin modules. This adds the method bodies to the hoe-spec and allows for the plugin to work as part of the spec itself. Once that is over, activated plugins have their optional ‘initialize_#{plugin}` methods called followed by their optional `activate_#{plugin}_deps` methods called. This lets them set needed instance variables to default values and declare any gem dependencies needed.. Finally, the hoe-spec block is evaluated so that project specific values can override the defaults.

See “Hoe Plugin Loading Sequence” in hoe.rb for full details.

Task Definition

Finally, once the user’s hoe-spec has been evaluated, all activated plugins have their ‘define_#{plugin}_tasks` method called. This method must be defined and it is here that you’ll define all your tasks.

REQUIREMENTS:

  • rake

  • rubygems

INSTALL:

  • sudo gem install hoe

LICENSE:

(The MIT License)

Copyright © Ryan Davis, seattle.rb

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

flog

Flog reports the most tortured code in an easy to read pain report. The higher the score, the more pain the code is in.
Ruby
869
star
2

flay

Flay analyzes code for structural similarities. Differences in literal values, variable, class, method names, whitespace, programming style, braces vs do/end, etc are all ignored.
Ruby
709
star
3

debride

Analyze code for potentially uncalled / dead methods, now with auto-removal.
Ruby
673
star
4

ruby_parser

ruby_parser is a ruby parser written in pure ruby. It outputs s-expressions which can be manipulated and converted back to ruby via the ruby2ruby gem.
Ruby
471
star
5

vlad

Ruby
353
star
6

rubyinline

Ruby
286
star
7

heckle

Ruby
176
star
8

ruby2ruby

Ruby
162
star
9

graph

Graph is a type of hash that outputs in graphviz's dot format. It comes with a command-line interface that is easily pluggable.
Ruby
158
star
10

zentest

Ruby
145
star
11

wilson

Ruby
138
star
12

image_science

Ruby
128
star
13

omnifocus

Ruby
127
star
14

rake-remote_task

Ruby
90
star
15

sexp_processor

Ruby
80
star
16

ruby_to_c

Ruby
79
star
17

zenweb

Ruby
64
star
18

parsetree

Ruby
54
star
19

omnifocus-github

Ruby
42
star
20

autotest-rails

Ruby
40
star
21

rdoc_osx_dictionary

Ruby
39
star
22

oedipus_lex

This is not your father’s lexer.
Ruby
34
star
23

osx_keychain

Ruby
24
star
24

sysloglogger

This project is EOL'd because it was merged into ruby 2.0.
Ruby
23
star
25

upnp

Ruby
20
star
26

ar_mailer

Ruby
20
star
27

zenprofile

Ruby
19
star
28

autotest-screen

Ruby
17
star
29

png

Ruby
17
star
30

metaruby

Ruby
15
star
31

seattlerb.org

CSS
15
star
32

omnifocus-redmine

Ruby
14
star
33

event_hook

Ruby
13
star
34

ohmygems

Ruby
12
star
35

production_log_analyzer

Ruby
12
star
36

minitest-excludes

Ruby
11
star
37

upnp-mediaserver

Ruby
10
star
38

ssh

Ruby
10
star
39

graphics

C++
9
star
40

ruby2smalltalk

Ruby
9
star
41

minitest-proveit

Ruby
8
star
42

orca_card

Ruby
8
star
43

gauntlet

Ruby
7
star
44

imap_processor

Ruby
7
star
45

path_expander

Ruby
7
star
46

rails_analyzer_tools

Ruby
7
star
47

minitest-macruby

Ruby
7
star
48

rubygems-sandbox

Ruby
7
star
49

github_contribs

Ruby
7
star
50

upnp-contentdirectory

Ruby
6
star
51

sphincter

6
star
52

cocor

Ruby
6
star
53

smtp_tls

Ruby
6
star
54

minitest-stackprofit

Ruby
6
star
55

upnp-igd

Ruby
5
star
56

cached_model

Ruby
5
star
57

mem_inspect

5
star
58

makerakeworkwell

Ruby
5
star
59

minitest-trump

Ruby
5
star
60

un

Ruby
5
star
61

debride-erb

Ruby
4
star
62

action_profiler

Ruby
4
star
63

synchronizer

Perforce, meet GitHub.
Ruby
3
star
64

rubyaudit

Ruby
3
star
65

minitest-speed

Ruby
3
star
66

minitest-compare

Ruby
3
star
67

rfc_spec

Ruby
3
star
68

rubyholic

Ruby
3
star
69

rubygems-cleanroom

Ruby
3
star
70

zombies

Ruby
3
star
71

upnp-connectionmanager

Ruby
3
star
72

box_layout

Ruby
3
star
73

zenhacks

Ruby
3
star
74

worker_bee

Ruby
3
star
75

rubygems-sing

Ruby
3
star
76

minitest_tu_shim

Ruby
3
star
77

ringydingy

Ruby
3
star
78

rubyinlinefortran

Ruby
2
star
79

omnifocus-rubyforge

Ruby
2
star
80

zencallgraph

Ruby
2
star
81

rubygems-isit19

Ruby
2
star
82

siren_song

Ruby
2
star
83

minitest-unordered

Ruby
2
star
84

supercaller

Ruby
2
star
85

zengraph

Ruby
2
star
86

gmail_contacts

Ruby
2
star
87

imap_to_rss

Ruby
2
star
88

mogilefs-client

2
star
89

drawr

Ruby
2
star
90

minitest_bench

Ruby
2
star
91

change_class

Ruby
2
star
92

minitest-allow

Ruby
2
star
93

hoe-seattlerb

Ruby
2
star
94

rbayes

Ruby
1
star
95

flay-persistence

Ruby
1
star
96

firebrigade_api

Ruby
1
star
97

seattlerb_dashboard

Ruby
1
star
98

memcache-client

1
star
99

omnifocus-bugzilla

Ruby
1
star
100

rc-rest

Ruby
1
star