lib/gator/util.rb in gator-0.0.10.pre vs lib/gator/util.rb in gator-0.0.11.pre

- old
+ new

@@ -1,19 +1,18 @@ require "thor" require "thor/util" require "thor/actions" require "pathname" -require File.dirname(__FILE__) + '/config' -require File.dirname(__FILE__) + '/project/project' + module Gator module Sandbox extend Gator::Configuration extend Gator::Project end class Util def self.gator_files - [ "gator", "gator.rb" ] + ["gator", "gator.rb"] end def self.gator_files_for(dir) gator_files.collect { |f| File.join(dir, f) } end @@ -62,27 +61,27 @@ def self.initialize_files if File.exists? gator_config load_rubyfile gator_config else - FileCreator.new.config_file + ConfigFileCreator.new.config_file end p_file = find_gator_project_file load_rubyfile p_file unless p_file.nil? end - class FileCreator < Thor + class ConfigFileCreator < Thor include Thor::Actions - desc "no cli usage", "create config file" - def config_file - file = Gator::Util.gator_config - user = ask "Username:" - create_file file, "config.user='#{user}'" - end - + no_tasks { + def config_file + file = Gator::Util.gator_config + user = ask "Username:" + create_file file, "config.user='#{user}'" + end + } end end end \ No newline at end of file