Sha256: 3ef98bd9758e22de67c4019f47a080fb59345e23a3da93fcfec82247beb72ba8

Contents?: true

Size: 1.34 KB

Versions: 2

Compression:

Stored size: 1.34 KB

Contents

#!/usr/bin/env ruby

require 'getapp'

# Thor is a toolkit for building powerful command-line interfaces.
require 'thor'

# Pry is a runtime developer console and IRB alternative with powerful introspection capabilities.
require "pry"

# == GetAppImportCLI Methods
#
# Provides a way to run using commandline
#
# Can be called using commandline as :
#
# getapp_import capterra <Yaml file path>
# getapp_import softwareadvice <JSON file path>
# getapp_import third_provider <Valid URI that provides CSV>
#
class GetAppImportCLI < Thor
  class_option :verbose, type: :boolean, aliases: "-v"

  desc "capterra", "Import products from capterra. Format supported yaml"
  def capterra(path)
    puts "Importing from capterra" if options[:verbose]
    puts "capterra: file path: #{path}" if options[:verbose]
    Getapp::Import::Capterra.new(path, options[:verbose]).import
  end

  desc "softwareadvice", "Import products from softwareadvice. Format supported json"
  def softwareadvice(path)
    puts "softwareadvice" if options[:verbose]
    puts "softwareadvice: file path: #{path}" if options[:verbose]
  end

  desc "third_provider", "Import products from third provider. Format supported CSV / CSV Link"
  def third_provider(url)
    puts "third_provider" if options[:verbose]
    puts "third_provider: Url: #{url}" if options[:verbose]
  end
end

GetAppImportCLI.start(ARGV)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
getapp-0.1.1 bin/getapp_import
getapp-0.1.0 bin/getapp_import