Class: Commercelayer::CLI::Base

Inherits:
Thor
  • Object
show all
Includes:
Bootstrappers, Exporters, Helpers, Thor::Actions
Defined in:
lib/commercelayer/cli.rb

Instance Method Summary collapse

Methods included from Exporters

#export_data!

Methods included from Bootstrappers

#bootstrap_data!

Methods included from Helpers

#commercelayer_client, #config_data, #config_data_template, #config_path

Instance Method Details

#bootstrapObject



28
29
30
31
# File 'lib/commercelayer/cli.rb', line 28

def bootstrap
  destination = ask "What is your destination?", limited_to: ["contentful", "datocms", "csv"]
  bootstrap_data!(destination)
end

#export(destination) ⇒ Object



34
35
36
37
# File 'lib/commercelayer/cli.rb', line 34

def export(destination)
  destination ||= ask "What is your destination?", limited_to: ["contentful", "datocms", "csv"]
  export_data!(destination)
end

#initObject



21
22
23
24
25
# File 'lib/commercelayer/cli.rb', line 21

def init
  create_file(config_path) do
    config_data_template
  end
end