Class: Magnetize::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/magnetize/cli.rb

Instance Method Summary collapse

Instance Method Details

#to_magentoObject



13
14
15
16
17
18
19
20
# File 'lib/magnetize/cli.rb', line 13

def to_magento
  unless options[:type] && options[:input] && options[:output]
    Magnetize::Convert.new.to_magento write: true
  else
    Magnetize::Convert.new.to_magento write: true, types: { options[:type] => { :magento => options[:output], :toml => options[:input] }}
  end

end

#to_tomlObject



28
29
30
31
32
33
34
35
36
# File 'lib/magnetize/cli.rb', line 28

def to_toml
  Dir.chdir(options[:dir]) do
    unless options[:type] && options[:input] && options[:output]
      Magnetize::Convert.new.to_toml write: true
    else
      Magnetize::Convert.new.to_toml write: true, types: { options[:type] => { :magento => options[:input], :toml => options[:output] }}
    end
  end
end