lib/overapp.rb in overapp-0.3.1 vs lib/overapp.rb in overapp-0.4.0
- old
+ new
@@ -1,38 +1,34 @@
require 'mharris_ext'
-%w(files template_file thor_file project from_command).each do |f|
- load File.dirname(__FILE__) + "/overapp/#{f}.rb"
+class Object
+ def klass
+ self.class
+ end
end
module Overapp
- class << self
- def with_repo_path(url)
- dir = "/tmp/#{rand(100000000000000000000)}"
- `mkdir #{dir}`
- Dir.chdir(dir) do
- `git clone #{url} .`
- end
- yield dir
- ensure
- `rm -rf #{dir}`
+ def self.load_files!
+ %w(files template_file project from_command).each do |f|
+ load File.dirname(__FILE__) + "/overapp/#{f}.rb"
end
- def with_local_path(overapp_path,&b)
- if overapp_path =~ /git/
- with_repo_path(overapp_path) do |dir|
- b[dir]
- end
- else
- yield overapp_path
- end
+
+ %w(base instance factory).each do |f|
+ load File.dirname(__FILE__) + "/overapp/load/#{f}.rb"
end
- def write_project(overapp_path,output_path)
- with_local_path(overapp_path) do |dir|
- Overapp::Project.new(:path => dir).write_to!(output_path)
- end
+
+ %w(command raw_dir local_dir repo empty project).each do |f|
+ load File.dirname(__FILE__) + "/overapp/load/types/#{f}.rb"
end
- def ec(cmd,ops={})
- MharrisExt.ec(cmd,ops)
+ %w(config write config_entry).each do |f|
+ load File.dirname(__FILE__) + "/overapp/project/#{f}.rb"
end
+
+ %w(tmp_dir git dir cmd write).each do |f|
+ load File.dirname(__FILE__) + "/overapp/util/#{f}.rb"
+ end
end
-end
\ No newline at end of file
+end
+
+Overapp.load_files!
+