From d2cd79e71017737096e324f06ea4681e179abd1c Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Mon, 25 May 2015 15:39:24 +0300 Subject: [PATCH] fix arg is nil --- lib/github_changelog_generator/parser.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 6e87f7d..7523292 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -149,12 +149,13 @@ module GitHubChangelogGenerator # # @param [String] output of git remote command # @return [Array] user and project - def self.user_project_from_option(arg0, arg2, github_site = "github.com") + def self.user_project_from_option(arg0, arg1, github_site = nil) user = nil project = nil - - if arg0 && !arg2 + github_site ||= "github.com" + if arg0 && !arg1 # this match should parse strings such "https://github.com/skywinder/Github-Changelog-Generator" or "skywinder/Github-Changelog-Generator" to user and name + puts arg0 match = /(?:.+#{Regexp.escape(github_site)}\/)?(.+)\/(.+)/.match(arg0) begin