Permalink
Browse files

First commit

  • Loading branch information...
franckverrot committed Dec 14, 2010
0 parents commit 275ac56bb4d7102b1579c6806baa224698113ee9
Showing with 207 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +85 −0 .wtf.rb
  3. +2 −0 Gemfile
  4. +17 −0 Gemfile.lock
  5. +2 −0 Rakefile
  6. +14 −0 bin/wtf
  7. +7 −0 lib/wtf.rb
  8. +4 −0 lib/wtf/dsl.rb
  9. +7 −0 lib/wtf/helpers.rb
  10. +3 −0 lib/wtf/version.rb
  11. +39 −0 lib/wtf/wtf.rb
  12. +23 −0 wtf.gemspec
@@ -0,0 +1,4 @@
+pkg/*
+*.gem
+.bundle
+.rvmrc
85 .wtf.rb
@@ -0,0 +1,85 @@
+Wtf::Wtf.configure do
+ scm :git # Extend for Hg, Subversion, etc..
+
+ tracker :pivotaltracker, :project_id => 123456
+ # we should use: https://github.com/hybridgroup/ticketmaster
+
+ development_branch :development
+ production_branch :production
+
+ repository do
+ url 'git@github.com:Foo/bar.git'
+ auth '??'
+ commit_template '' # Write a default to get this started right.
+ hooks :pre => '', :post => '', :clone => '' # Something here for CI, immediately. Always set authors.
+ end
+
+ continous_integration :hudson # :bigtuna ?
+
+ topics do
+
+ feature :source => :development_branch do |feature_name|
+ tag feature_name
+ merge :development_branch
+ end
+
+ # rebase implies merge?
+ hotfix :source => :production_branch do |hotfix_name|
+ tag hotfix_name
+ rebase :production_branch
+ merge :development_branch, :rebase => false, :ff => false
+ merge :current_release_branch, :rebase => ??, :ff => false
+ end
+
+ # Work on release branch preparation must be merged back to development, as well as going forward to the production branch itself.
+ release :source => :development_branch do |release|
+ tag release
+ rebase :production_branch
+ rebase :development_branch
+ end
+
+ bug :source => :development_branch do |bug_name|
+ tag bug_name
+ merge :development_branch
+ end
+
+ chore :source => :development_branch do |chore_name|
+ tag chore_name
+ merge :development_branch
+ end
+ end
+
+
+ # Actions which apply to each topic?
+ actions do
+
+ start :ticket do |ticket|
+ end
+
+ # but demonstration only applies to features probably ..?
+ demonstrate :ticket do |topic|
+ end
+
+ finish :ticket do |topic|
+ # this should do 'test' and 'demonstrate'
+ end
+
+ test :ticket do
+ # local tests only?
+ # spork or test server?
+ #
+ end
+
+ deliver :ticket do
+ end
+
+ end
+
+ roles do
+ developer
+ release_master
+ designer
+ end
+
+end
+
@@ -0,0 +1,2 @@
+source "http://rubygems.org"
+gemspec
@@ -0,0 +1,17 @@
+PATH
+ remote: .
+ specs:
+ wtf (0.0.1)
+ activesupport
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activesupport (3.0.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activesupport
+ wtf!
@@ -0,0 +1,2 @@
+require 'bundler'
+Bundler::GemHelper.install_tasks
14 bin/wtf
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+
+$:.push 'lib'
+require 'wtf'
+require 'wtf/helpers'
+
+args = ARGV.dup
+ARGV.clear
+command = args.shift.strip rescue 'help'
+
+root_dir = Wtf::Helpers.root_directory(`pwd`)
+wtf = Wtf::Wtf.new(root_dir)
+wtf.load(ENV.fetch('WTF_CONFIGURATION','.wtf.rb'))
+wtf.send(command, args)
@@ -0,0 +1,7 @@
+require 'active_support'
+require 'active_support/all'
+module Wtf
+ extend ActiveSupport::Autoload
+ autoload :Wtf
+ autoload :Dsl
+end
@@ -0,0 +1,4 @@
+module Wtf
+ class Dsl
+ end
+end
@@ -0,0 +1,7 @@
+module Wtf
+ module Helpers
+ def self.root_directory path
+ File.expand_path("#{`pwd`.strip}","#{`git rev-parse --show-cdup`}")
+ end
+ end
+end
@@ -0,0 +1,3 @@
+module Wtf
+ VERSION = "0.0.1"
+end
@@ -0,0 +1,39 @@
+Dir["#{File.dirname(__FILE__)}/commands/*.rb"].each { |c| require c }
+
+module Wtf
+ class Wtf
+ attr_accessor :root_dir
+ attr_accessor :configuration_file
+
+ def initialize(dir)
+ self.root_dir = dir
+ end
+
+ def load(filename)
+ self.configuration_file = filename
+ process_dsl
+ end
+
+ def help *args
+ puts "wtf, work the flow, your favorite workflow tool"
+ puts "Root dir: #{self.root_dir}"
+ puts "args: #{args.inspect}"
+ end
+
+ def self.method_missing *args
+ puts "CLASS METHOD MISSING #{args.inspect}"
+ end
+
+ def self.configure &block
+ instance_eval &block
+ end
+
+ private
+ def process_dsl
+ path = File.join(self.root_dir, self.configuration_file)
+ puts "Using the configuration file #{path}"
+ eval(File.read(path), TOPLEVEL_BINDING)
+ end
+
+ end
+end
@@ -0,0 +1,23 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "wtf/version"
+
+Gem::Specification.new do |s|
+ s.name = "wtf"
+ s.version = Wtf::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Franck Verrot", "Richard K. Michael"]
+ s.email = ["franck@verrot.fr"]
+ s.homepage = "http://github.com/cesario/wtf"
+ s.summary = %q{DSL configurable DVCS worflow}
+ s.description = %q{wtf makes it very easy to define your own workflow and tools (SCM, ticket manager, ...)}
+
+ s.rubyforge_project = "wtf"
+
+ s.add_dependency 'activesupport'
+
+ 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"]
+end

0 comments on commit 275ac56

Please sign in to comment.