Permalink
Browse files

ftrain working again

  • Loading branch information...
1 parent cdbea5a commit b1a55241ece80f6689a3390c6ddd497f795ee50b andrea@VEGETA committed Mar 17, 2010
Showing with 26 additions and 6 deletions.
  1. +1 −1 Rakefile
  2. +4 −2 bin/ftrain
  3. +0 −3 lib/scaffolding/ftrain
  4. +21 −0 lib/scaffolding/scaffolding.rb
View
2 Rakefile
@@ -19,7 +19,7 @@ spec = Gem::Specification.new do |s|
s.description = s.summary
s.author = 'Andrea Dallera'
s.email = 'andrea@andreadallera.com'
- s.files = %w(README Rakefile) + Dir.glob("{lib}/**/*")
+ s.files = %w(README.rdoc Rakefile) + Dir.glob("{bin,lib}/**/*")
s.require_path = "lib"
end
View
6 bin/ftrain
@@ -1,3 +1,5 @@
#!/usr/bin/ruby
-require 'rubygems'
-require 'ftrain.rb'
+
+require "rubygems"
+require File.join(File.dirname(__FILE__),
+ "..", "lib", "scaffolding", "scaffolding.rb")
View
3 lib/scaffolding/ftrain
@@ -1,3 +0,0 @@
-#!/usr/bin/ruby
-require 'rubygems'
-require 'ftrain.rb'
View
21 lib/scaffolding/scaffolding.rb
@@ -0,0 +1,21 @@
+
+require "rubygems"
+require "require_all"
+
+require_all File.join(File.dirname(__FILE__), "commands")
+
+require File.join(File.dirname(__FILE__), "generator.rb")
+
+begin
+ klass = eval("#{ARGV[0].capitalize}Command")
+rescue
+ print "No command '#{ARGV[0]}'\n"
+end
+
+begin
+ command = klass.new(*ARGV[1...ARGV.length])
+ command.check
+ command.execute
+rescue Exception => ex
+ print ex.message + "\n"
+end

0 comments on commit b1a5524

Please sign in to comment.