Class: Gizzard::TransformCommand
- Inherits:
-
BaseTransformCommand
- Object
- Command
- BaseTransformCommand
- Gizzard::TransformCommand
- Defined in:
- lib/gizzard/commands.rb
Instance Attribute Summary
Attributes inherited from Command
#argv, #buffer, #command_options, #global_options, #job_injector, #manager
Instance Method Summary collapse
Methods inherited from BaseTransformCommand
Methods inherited from Command
classify, #confirm!, #get_base_name, #help!, #initialize, make_job_injector, make_manager, #output, #require_tables, #require_template_options, run
Constructor Details
This class inherits a constructor from Gizzard::Command
Instance Method Details
#get_transformations ⇒ Object
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 |
# File 'lib/gizzard/commands.rb', line 883 def get_transformations help!("must have an even number of arguments") unless @argv.length % 2 == 0 require_tables = . || {} manifest = manager.manifest(*.tables) copy_wrapper = [:copy_wrapper] skip_copies = [:skip_copies] || false transformations = {} @argv.each_slice(2) do |(from_template_s, to_template_s)| from, to = [from_template_s, to_template_s].map {|s| ShardTemplate.parse(s) } transformation = Transformation.new(from, to, copy_wrapper, skip_copies) forwardings = Set.new(manifest.templates[from] || []) trees = manifest.trees.reject {|(f, s)| !forwardings.include?(f) } transformations[transformation] = trees end transformations end |