Skip to content

Commit

Permalink
Really gotta go to bed now...
Browse files Browse the repository at this point in the history
  • Loading branch information
franckverrot committed Dec 14, 2010
1 parent f7b4453 commit b7803ec
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .wtf.rb
@@ -1,7 +1,7 @@
Wtf::Wtf.configure do
scm :git # Extend for Hg, Subversion, etc..

tracker :pivotaltracker, :project_id => 123456
tracker :pivotal_tracker, :project_id => 123456
# we should use: https://github.com/hybridgroup/ticketmaster

development_branch :development
Expand Down
14 changes: 13 additions & 1 deletion lib/wtf.rb
@@ -1,7 +1,19 @@
require 'active_support'
require 'active_support/all'

module Wtf
extend ActiveSupport::Autoload
autoload :Wtf
autoload :Dsl

module Dsl
extend ActiveSupport::Autoload
module Scm
extend ActiveSupport::Autoload
autoload :Git
end
module Tracker
extend ActiveSupport::Autoload
autoload :PivotalTracker
end
end
end
11 changes: 10 additions & 1 deletion lib/wtf/dsl.rb
@@ -1,4 +1,13 @@
module Wtf
class Dsl
module Dsl
attr_accessor :_scm, :_tracker

def scm preferred_scm, args = {}
_scm = Scm::const_get(preferred_scm.to_s.classify).new(*args)
end

def tracker preferred_tracker, args = {}
_tracker = Tracker::const_get(preferred_tracker.to_s.classify).new(*args)
end
end
end
11 changes: 11 additions & 0 deletions lib/wtf/dsl/scm/git.rb
@@ -0,0 +1,11 @@
module Wtf
module Dsl
module Scm
class Git
def initialize args = {}
puts "Initializing git"
end
end
end
end
end
10 changes: 10 additions & 0 deletions lib/wtf/dsl/tracker/pivotal_tracker.rb
@@ -0,0 +1,10 @@
module Wtf
module Dsl
module Tracker
class PivotalTracker
def initialize args = {}
end
end
end
end
end
5 changes: 4 additions & 1 deletion lib/wtf/wtf.rb
Expand Up @@ -2,6 +2,7 @@

module Wtf
class Wtf
extend Dsl
attr_accessor :root_dir
attr_accessor :configuration_file

Expand Down Expand Up @@ -32,7 +33,9 @@ def self.configure &block
def process_dsl
path = File.join(self.root_dir, self.configuration_file)
puts "Using the configuration file #{path}"
eval(File.read(path), TOPLEVEL_BINDING)
class_eval do
eval(File.read(path), TOPLEVEL_BINDING)
end
end

end
Expand Down

0 comments on commit b7803ec

Please sign in to comment.