Sha256: 87495db80f8ed73c662b6637a5ff2a77b8315d0fc97d64a11e713ca1f00dedac

Contents?: true

Size: 1.12 KB

Versions: 9

Compression:

Stored size: 1.12 KB

Contents

require 'thor'
require 'natives/apps'

module Natives
  class Cli < Thor

    desc 'list [ENTRY1 ENTRY2 ..]',
      'list native packages required by the catalog entries'
    method_option :catalog, default: 'rubygems', aliases: '-c',
      desc: 'use this catalog'
    method_option :gemfile, default: 'Gemfile',
      desc: 'use gems in the gemfile as the catalog entries'
    def list(*entry_names)
      app = Apps::List.new

      catalog_name = options[:catalog]
      if catalog_name == 'rubygems' && entry_names.empty?
        packages = app.natives_for_gemfile(options[:gemfile])
      else
        packages = app.natives_for(catalog_name, entry_names)
      end

      puts packages
    rescue => ex
      $stderr.puts ex.message
    end

    desc 'detect',
      'detect and print platform and package provider information'
    def detect
      app = Apps::Detect.new
      puts app.detection_info
    end

    desc 'version',
      'print version information'
    def version
      version_file = File.expand_path(File.join(
        File.dirname(__FILE__), '..', '..', 'VERSION'))

      puts IO.read(version_file)
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
natives-0.6.2 lib/natives/cli.rb
natives-0.6.1 lib/natives/cli.rb
natives-0.6.0 lib/natives/cli.rb
natives-0.5.5 lib/natives/cli.rb
natives-0.5.4 lib/natives/cli.rb
natives-0.5.3 lib/natives/cli.rb
natives-0.5.2 lib/natives/cli.rb
natives-0.5.1 lib/natives/cli.rb
natives-0.5.0 lib/natives/cli.rb