Module: Commercelayer::CLI::Helpers
- Included in:
- Base, Bootstrappers::Contentful, Bootstrappers::DatoCMS, Exporters::Contentful
- Defined in:
- lib/commercelayer/cli/helpers.rb
Instance Method Summary collapse
- #commercelayer_client ⇒ Object
- #config_data ⇒ Object
- #config_data_template ⇒ Object
- #config_path ⇒ Object
Instance Method Details
#commercelayer_client ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/commercelayer/cli/helpers.rb', line 30 def commercelayer_client Commercelayer::Client.new( client_id: config_data[:commercelayer][:client_id], client_secret: config_data[:commercelayer][:client_secret], # scope: config_data[:commercelayer][:scope], site: config_data[:commercelayer][:site] ) end |
#config_data ⇒ Object
5 6 7 |
# File 'lib/commercelayer/cli/helpers.rb', line 5 def config_data YAML::load_file(config_path).deep_symbolize_keys end |
#config_data_template ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/commercelayer/cli/helpers.rb', line 9 def config_data_template { "commercelayer" => { "site" => "https://<subdomain>.commercelayer.io", "client_id" => "YOUR-COMMERCELAYER-CLIENT-ID", "client_secret" => "YOUR-COMMERCELAYER-CLIENT-SECRET" }, "contentful" => { "space" => "YOUR-CONTENTFUL-SPACE-ID", "access_token" => "YOUR-CONTENTFUL-ACCESS-TOKEN" }, "dato" => { "api_key" => "YOUR-DATOCMS-APIKEY" } }.to_yaml end |
#config_path ⇒ Object
26 27 28 |
# File 'lib/commercelayer/cli/helpers.rb', line 26 def config_path ENV['HOME'] + "/.commercelayer-cli.yml" end |