Module: Thor::Actions
Defined Under Namespace
Classes: Directory2
Instance Method Summary collapse
- #directory2(source, *args, &block) ⇒ Object
-
#template2(source, *args, &block) ⇒ Object
use tilt :scope => nil :locals => {} &block is for yield.
Instance Method Details
#directory2(source, *args, &block) ⇒ Object
3 4 5 6 7 |
# File 'lib/rag/ext.rb', line 3 def directory2(source, *args, &block) config = args.last.is_a?(Hash) ? args.pop : {} destination = args.first || source action Directory2.new(self, source, destination || source, config, &block) end |
#template2(source, *args, &block) ⇒ Object
use tilt :scope => nil :locals => {} &block is for yield.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rag/ext.rb', line 13 def template2(source, *args, &block) config = args.last.is_a?(Hash) ? args.pop : {} destination = args.first || source.sub(/\.tt$/, '') = {source_root: self.class.source_root} source = File.(find_in_source_paths(source.to_s)) create_file destination, nil, config do Rag::Template.render(source, , &block) end end |