From 79f48ea2484b14dc85b6db701458f8d61390ca8b Mon Sep 17 00:00:00 2001 From: Benjamin Thouret Date: Sat, 26 Sep 2015 13:32:43 -0400 Subject: [PATCH] Fix binary for gitlab --- bin/checklister | 10 +++++----- lib/checklister/client.rb | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/checklister b/bin/checklister index a90b43b..921ad4e 100755 --- a/bin/checklister +++ b/bin/checklister @@ -117,13 +117,13 @@ desc "Transform a markdown file or url checklist into an actionable issue" command :new do |c| c.flag [:c,:checklist], desc: "Set the markdown checklist file path", required: true c.action do |global_options,options,args| - client = Checklister::Client.new(Checklister.config.to_hash).get_api_client - gitlab_project = Checklister::Gitlab::Project.new(client) + api_client = Checklister::Client.new(Checklister.config.to_hash) + project_client = api_client.project checklist_path = options[:checklist] puts "* Type some letters of your project's name..." project_like = STDIN.gets.chomp - projects = gitlab_project.filtered_by_name(project_like) + projects = project_client.filtered_by_name(project_like) default_project_id = projects.first[:id] projects.each do |project| puts "%-5s %-100s" % ["[#{project[:id]}]", project[:name_with_namespace]] @@ -131,11 +131,11 @@ command :new do |c| puts "* Pick your project Id, defaults to [#{default_project_id}]" choice = STDIN.gets.chomp project_id = choice == "" ? default_project_id : choice - project = gitlab_project.get(project_id) + project = project_client.get(project_id) puts "* Creating a checklist issue from #{checklist_path}" puts " to the project: #{project[:name]}" parsed_checklist = Checklister::Parser.new(checklist_path) - issue = Checklister::Gitlab::Issue.new(client).create(project_id, parsed_checklist.to_params) + issue = api_client.issue.create(project_id, parsed_checklist.to_params) puts "------------->" puts "| Check it out: #{Checklister.config.endpoint.gsub("/api/v3", "")}/#{project[:path_with_namespace]}/issues/#{issue.id}" puts "------------->" diff --git a/lib/checklister/client.rb b/lib/checklister/client.rb index e131edc..50914d3 100644 --- a/lib/checklister/client.rb +++ b/lib/checklister/client.rb @@ -48,7 +48,7 @@ def project end def issue - @project ||= @issue_klass.new(@api_client) + @issue ||= @issue_klass.new(@api_client) end private