Sha256: e3f5aa99280ce400cb1e1f3793daffc8e4e018731e2594732cf79ddd52e11a7f

Contents?: true

Size: 886 Bytes

Versions: 7

Compression:

Stored size: 886 Bytes

Contents

require 'shopify_cli'

module ShopifyCli
  module Commands
    Registry = CLI::Kit::CommandRegistry.new(
      default: 'help',
      contextual_resolver: nil,
    )
    @core_commands = []

    def self.register(const, cmd, path = nil, is_core = false)
      autoload(const, path) if path
      Registry.add(->() { const_get(const) }, cmd)
      @core_commands.push(cmd) if is_core
    end

    def self.core_command?(cmd)
      @core_commands.include?(cmd)
    end

    register :Connect, 'connect', 'shopify-cli/commands/connect', true
    register :Create, 'create', 'shopify-cli/commands/create', true
    register :Help, 'help', 'shopify-cli/commands/help', true
    register :Logout, 'logout', 'shopify-cli/commands/logout', true
    register :System, 'system', 'shopify-cli/commands/system', true
    register :Version, 'version', 'shopify-cli/commands/version', true
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
shopify-cli-1.0.2 lib/shopify-cli/commands.rb
shopify-cli-1.0.1 lib/shopify-cli/commands.rb
shopify-cli-1.0.0 lib/shopify-cli/commands.rb
shopify-cli-0.9.3 lib/shopify-cli/commands.rb
shopify-cli-0.9.2 lib/shopify-cli/commands.rb
shopify-cli-0.9.1 lib/shopify-cli/commands.rb
shopify-cli-0.9.0 lib/shopify-cli/commands.rb