Browse files

Allow users to create new features

  • Loading branch information...
1 parent 1f250c4 commit 84f08fd2a7487e68fa91779a178860f9835845e4 @peakpg peakpg committed Jul 27, 2011
Showing with 53 additions and 12 deletions.
  1. +16 −2 README.md
  2. +6 −0 bin/gd
  3. +6 −2 git-er-done.gemspec
  4. +1 −8 lib/git-er-done.rb
  5. +24 −0 lib/git-er-done/app.rb
View
18 README.md
@@ -1,6 +1,6 @@
This project exists for a few reasons:
-1. I want to understand more how to configure git process flows (much like git-flow) does, but have more configurablity (via Ruby)
+1. I want to understand more how to configure git process flows (much like git-flow) does, but have more configurability (via Ruby)
2. Gives an interesting test case for my Thor talk at DCRUG and Arlington RUG.
3. Make doing the 'right' thing easy (i.e. feature branches should be simple. Smaller projects)
4. The world needs more gems with silly pop culture references.
@@ -15,15 +15,29 @@ Here's what I want to be able to support
* Support git-flow's Feature, hotfix, release branches to/from develop if necessary.
* Provide a nice discoverable CLI for doing this sort of thing.
+### Target workflow
+
+http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html
+
## Syntax
Possible ideas:
+```
gd feature new_widget
gd done new_widget
gd hotfix
gd done
+```
+
+## GitFlow Behavior
+
+* Starting a gitflow project (git flow init)- Asks some questions (mostly about naming) and creates a develop branch to work in.
+* Starting a feature - Creates a feature/name_of_feature branch
+* Completing a feature - Merges the feature back into develop and deletes the branch
+
## Other Resources
-http://grit.rubyforge.org/ - A Ruby wrapper around git: Might be useful for more indepth interaction with git.
+http://grit.rubyforge.org/ - A Ruby wrapper around git: Might be useful for more indepth interaction with git.
+http://stackoverflow.com/questions/5294069/best-way-to-create-an-executable-for-a-gem-using-rake - Minimum work to make a CLI bin file.
View
6 bin/gd
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
+$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
+require 'git-er-done'
+
+Git::Er::Done::App.start
View
8 git-er-done.gemspec
@@ -8,13 +8,17 @@ Gem::Specification.new do |s|
s.authors = ["peakpg"]
s.email = ["peakpg@gmail.com"]
s.homepage = ""
- s.summary = %q{TODO: Write a gem summary}
- s.description = %q{TODO: Write a gem description}
+ s.summary = %q{A gem to assist with git workflow.}
+ s.description = %q{A gem to assist with git workflow, similar to git-flow.}
s.rubyforge_project = "git-er-done"
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
+
+ [['thor', '>~ 0.14.6'], ['rails', '>~ 3.0.9'].each do |gem, version|
+ s.add_dependency(gem, version)
+ end
end
View
9 lib/git-er-done.rb
@@ -1,9 +1,2 @@
require "git-er-done/version"
-
-module Git
- module Er
- module Done
- # Your code goes here...
- end
- end
-end
+require 'git-er-done/app'
View
24 lib/git-er-done/app.rb
@@ -0,0 +1,24 @@
+require 'thor'
+require 'rails/generators/actions'
+
+module Git
+ module Er
+ module Done
+ class App < Thor
+
+ include Thor::Actions
+ include Rails::Generators::Actions
+
+ desc 'feature', 'Start a new feature as a git branch'
+ def feature(name)
+ puts 'Creating a new feature called #{name}.'
+ git :checkout => "-b #{name}"
+ end
+
+
+ end
+ end
+ end
+end
+
+

0 comments on commit 84f08fd

Please sign in to comment.