Lint: rename to avoid getter naming

- fixed Rake task, too
This commit is contained in:
Olle Jonsson 2015-10-22 00:09:25 +02:00
parent d227464c33
commit 3fb75c825f
3 changed files with 6 additions and 10 deletions

View File

@ -7,7 +7,7 @@ module GitHubChangelogGenerator
class Parser class Parser
# parse options with optparse # parse options with optparse
def self.parse_options def self.parse_options
options = get_default_options options = default_options
ParserFile.new(options).parse! ParserFile.new(options).parse!
@ -159,8 +159,8 @@ module GitHubChangelogGenerator
end end
# just get default options # just get default options
def self.get_default_options def self.default_options
options = { {
tag1: nil, tag1: nil,
tag2: nil, tag2: nil,
date_format: "%Y-%m-%d", date_format: "%Y-%m-%d",
@ -188,8 +188,6 @@ module GitHubChangelogGenerator
enhancement_prefix: "**Implemented enhancements:**", enhancement_prefix: "**Implemented enhancements:**",
git_remote: "origin" git_remote: "origin"
} }
options
end end
def self.user_and_project_from_git def self.user_and_project_from_git

View File

@ -43,11 +43,9 @@ module GitHubChangelogGenerator
task @name do task @name do
# mimick parse_options # mimick parse_options
options = Parser.get_default_options options = Parser.default_options
if options[:user].nil? || options[:project].nil? Parser.user_and_project_from_git(options)
Parser.detect_user_and_project(options)
end
OPTIONS.each do |o| OPTIONS.each do |o|
v = instance_variable_get("@#{o}") v = instance_variable_get("@#{o}")

View File

@ -24,7 +24,7 @@ describe GitHubChangelogGenerator::ParserFile do
end end
context "when override default values" do context "when override default values" do
let(:default_options) { GitHubChangelogGenerator::Parser.get_default_options } let(:default_options) { GitHubChangelogGenerator::Parser.default_options }
let(:options) { { params_file: "spec/files/github_changelog_params_override" }.merge(default_options) } let(:options) { { params_file: "spec/files/github_changelog_params_override" }.merge(default_options) }
let(:options_before_change) { options.dup } let(:options_before_change) { options.dup }
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) } let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }