bin/coconductor in coconductor-0.2.0 vs bin/coconductor in coconductor-0.3.0

- old
+ new

@@ -1,18 +1,25 @@ #!/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 - args.first || Dir.pwd + @path ||= if remote? + "https://github.com/#{args.first}" + else + args.first || Dir.pwd + end end def project @project ||= Coconductor.project(path) end @@ -21,9 +28,13 @@ 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) }