refactoring
This commit is contained in:
parent
38576e23e3
commit
e82a75611c
|
@ -1,35 +1,35 @@
|
|||
# This configuration was generated by `rubocop --auto-gen-config`
|
||||
# on 2015-03-27 03:03:45 +0200 using RuboCop version 0.29.1.
|
||||
# on 2015-04-04 02:29:34 +0300 using RuboCop version 0.29.1.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
# versions of RuboCop, may require this file to be generated again.
|
||||
|
||||
# Offense count: 20
|
||||
# Offense count: 21
|
||||
Metrics/AbcSize:
|
||||
Max: 114
|
||||
Max: 71
|
||||
|
||||
# Offense count: 1
|
||||
# Offense count: 2
|
||||
Metrics/BlockNesting:
|
||||
Max: 4
|
||||
|
||||
# Offense count: 2
|
||||
# Configuration parameters: CountComments.
|
||||
Metrics/ClassLength:
|
||||
Max: 471
|
||||
Max: 457
|
||||
|
||||
# Offense count: 6
|
||||
Metrics/CyclomaticComplexity:
|
||||
Max: 18
|
||||
Max: 15
|
||||
|
||||
# Offense count: 27
|
||||
# Offense count: 28
|
||||
# Configuration parameters: CountComments.
|
||||
Metrics/MethodLength:
|
||||
Max: 147
|
||||
Max: 118
|
||||
|
||||
# Offense count: 6
|
||||
# Offense count: 5
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 20
|
||||
Max: 18
|
||||
|
||||
# Offense count: 3
|
||||
Style/AccessorMethodName:
|
||||
|
@ -41,7 +41,7 @@ Style/AccessorMethodName:
|
|||
Style/AndOr:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 29
|
||||
# Offense count: 27
|
||||
# Cop supports --auto-correct.
|
||||
Style/Blocks:
|
||||
Enabled: false
|
||||
|
@ -51,7 +51,7 @@ Style/Blocks:
|
|||
Style/CaseIndentation:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 5
|
||||
# Offense count: 4
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
|
||||
|
|
|
@ -113,6 +113,28 @@ module GitHubChangelogGenerator
|
|||
|
||||
parser.parse!
|
||||
|
||||
detect_user_and_project(options)
|
||||
|
||||
if !options[:user] || !options[:project]
|
||||
puts parser.banner
|
||||
exit
|
||||
end
|
||||
|
||||
if ARGV[1]
|
||||
options[:tag1] = ARGV[0]
|
||||
options[:tag2] = ARGV[1]
|
||||
end
|
||||
|
||||
if options[:verbose]
|
||||
puts "Performing task with options:"
|
||||
pp options
|
||||
puts ""
|
||||
end
|
||||
|
||||
options
|
||||
end
|
||||
|
||||
def self.detect_user_and_project(options)
|
||||
if ARGV[0] && !ARGV[1]
|
||||
github_site = options[:github_site] ? options[:github_site] : "github.com"
|
||||
# this match should parse strings such "https://github.com/skywinder/Github-Changelog-Generator" or "skywinder/Github-Changelog-Generator" to user and name
|
||||
|
@ -159,24 +181,6 @@ module GitHubChangelogGenerator
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
if !options[:user] || !options[:project]
|
||||
puts parser.banner
|
||||
exit
|
||||
end
|
||||
|
||||
if ARGV[1]
|
||||
options[:tag1] = ARGV[0]
|
||||
options[:tag2] = ARGV[1]
|
||||
end
|
||||
|
||||
if options[:verbose]
|
||||
puts "Performing task with options:"
|
||||
pp options
|
||||
puts ""
|
||||
end
|
||||
|
||||
options
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user