aboutsummaryrefslogtreecommitdiffstats
path: root/lib/generators
diff options
context:
space:
mode:
authorKir2011-10-31 21:43:34 +0400
committerKir2011-10-31 21:43:34 +0400
commit48c144ed34e2d5977bb8e5af8a9c7e8dfc253361 (patch)
treea672937fb96b955f3c2d4364195926b3b14d01cb /lib/generators
parent3ddd221f5f235e34afb9d4bbc7a4fc05228f73a4 (diff)
downloadinboxes-48c144ed34e2d5977bb8e5af8a9c7e8dfc253361.tar.bz2
Small changed
Diffstat (limited to 'lib/generators')
-rw-r--r--lib/generators/inboxes/views_generator.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/generators/inboxes/views_generator.rb b/lib/generators/inboxes/views_generator.rb
new file mode 100644
index 0000000..c69812e
--- /dev/null
+++ b/lib/generators/inboxes/views_generator.rb
@@ -0,0 +1,25 @@
+require 'rails/generators'
+
+module Inboxes
+ module Generators
+ class ViewsGenerator < Rails::Generators::Base
+ source_root File.expand_path('../../../../app/views', __FILE__)
+ class_option :template_engine, :type => :string, :aliases => '-e', :desc => 'Template engine for the views. Available options are "erb" and "haml".'
+
+ def copy_or_fetch
+ # puts "Generating views"
+ filename_pattern = File.join self.class.source_root, "*/*.html.#{template_engine}"
+ # puts (Dir.glob(filename_pattern).map {|f| File.basename f}).inspect
+ # Dir.glob(filename_pattern).map {|f| File.basename f}.each do |f|
+ # copy_file f, "app/views/#{f}"
+ # end
+ end
+
+ private
+
+ def template_engine
+ options[:template_engine].try(:to_s).try(:downcase) || 'erb'
+ end
+ end
+ end
+end \ No newline at end of file