Module: Ore::Actions
- Included in:
- Generator
- Defined in:
- lib/ore/actions.rb
Overview
Additional actions for the Generator.
Instance Method Summary collapse
-
#generate_dir(dest) ⇒ String
protected
Generates an empty directory.
-
#generate_file(dest, file, options = {}) ⇒ String
protected
Generates a file.
-
#run(command, config = {}) ⇒ Object
protected
Runs a command.
Instance Method Details
#generate_dir(dest) ⇒ String (protected)
Generates an empty directory.
38 39 40 41 42 43 44 45 46 |
# File 'lib/ore/actions.rb', line 38 def generate_dir(dest) return if @generated_dirs.has_key?(dest) path = interpolate(dest) empty_directory path @generated_dirs[dest] = path return path end |
#generate_file(dest, file, options = {}) ⇒ String (protected)
Generates a file.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/ore/actions.rb', line 68 def generate_file(dest,file,={}) return if @generated_files.has_key?(dest) path = interpolate(dest) if [:template] @current_template_dir = File.dirname(dest) template file, path @current_template_dir = nil else copy_file file, path end @generated_files[dest] = path return path end |
#run(command, config = {}) ⇒ Object (protected)
Runs a command.
23 24 25 |
# File 'lib/ore/actions.rb', line 23 def run(command,config={}) super(command,config.merge(capture: true)) end |