Sha256: c7b6ce83958b876791d2dbdf06aa3ac1dd24731bec0e7155e6cf41a8e2296ac3

Contents?: true

Size: 877 Bytes

Versions: 23

Compression:

Stored size: 877 Bytes

Contents

#!/usr/bin/env ruby

require_relative '../lib/coconductor'
require 'thor'
require 'octokit'

class CoconductorCLI < Thor
  package_name 'Coconductor'
  default_task :detect
  class_option :remote, type: :boolean,
                        desc: 'Assume PATH is a GitHub owner/repo path'

  private

  def path
    @path ||= if remote?
                "https://github.com/#{args.first}"
              else
                args.first || Dir.pwd
              end
  end

  def project
    @project ||= Coconductor.project(path)
  end

  def code_of_conduct
    project.code_of_conduct
  end

  def code_of_conduct_file
    project.code_of_conduct_file
  end

  def remote?
    options[:remote] || path =~ %r{^https://}
  end
end

commands_dir = File.expand_path '../lib/coconductor/commands/', __dir__
Dir["#{commands_dir}/*.rb"].each { |c| require(c) }

CoconductorCLI.start(ARGV)

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
coconductor-0.4.0 bin/coconductor
coconductor-0.3.1 bin/coconductor
coconductor-0.3.0 bin/coconductor