Skip to content

Linty McLintface #628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion github_changelog_generator.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

lib = File.expand_path("../lib", __FILE__)
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "github_changelog_generator/version"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ def tag_older_new_tag?(newer_tag_time, time)
tag_in_range_new
end

def tag_newer_old_tag?(older_tag_time, t)
def tag_newer_old_tag?(older_tag_time, time)
tag_in_range_old = if older_tag_time.nil?
true
else
t > older_tag_time
time > older_tag_time
end
tag_in_range_old
end
Expand Down
14 changes: 7 additions & 7 deletions lib/github_changelog_generator/generator/generator_tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module GitHubChangelogGenerator
class Generator
# fetch, filter tags, fetch dates and sort them in time order
def fetch_and_filter_tags
detect_since_tag
detect_due_tag
since_tag
due_tag

all_tags = @fetcher.get_all_tags
fetch_tags_dates(all_tags) # Creates a Hash @tag_times_hash
Expand Down Expand Up @@ -35,7 +35,7 @@ def build_tag_section_mapping(section_tags, filtered_tags)
tag = section_tags[i]

# Don't create section header for the "since" tag
next if @since_tag && tag["name"] == @since_tag
next if since_tag && tag["name"] == since_tag

# Don't create a section header for the first tag in between_tags
next if options[:between_tags] && tag == section_tags.last
Expand Down Expand Up @@ -98,11 +98,11 @@ def detect_link_tag_time(newer_tag)
end

# @return [Object] try to find newest tag using #Reader and :base option if specified otherwise returns nil
def detect_since_tag
def since_tag
@since_tag ||= options.fetch(:since_tag) { version_of_first_item }
end

def detect_due_tag
def due_tag
@due_tag ||= options.fetch(:due_tag, nil)
end

Expand All @@ -125,7 +125,7 @@ def get_filtered_tags(all_tags)
# @return [Array] filtered tags according :since_tag option
def filter_since_tag(all_tags)
filtered_tags = all_tags
tag = detect_since_tag
tag = since_tag
if tag
if all_tags.map { |t| t["name"] }.include? tag
idx = all_tags.index { |t| t["name"] == tag }
Expand All @@ -145,7 +145,7 @@ def filter_since_tag(all_tags)
# @return [Array] filtered tags according :due_tag option
def filter_due_tag(all_tags)
filtered_tags = all_tags
tag = detect_due_tag
tag = due_tag
if tag
if all_tags.any? && all_tags.map { |t| t["name"] }.include?(tag)
idx = all_tags.index { |t| t["name"] == tag }
Expand Down
6 changes: 3 additions & 3 deletions lib/github_changelog_generator/octo_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def github_options
end

def configure_octokit_ssl
ca_file = @options[:ssl_ca_file] || ENV["SSL_CA_FILE"] || File.expand_path("../ssl_certs/cacert.pem", __FILE__)
ca_file = @options[:ssl_ca_file] || ENV["SSL_CA_FILE"] || File.expand_path("ssl_certs/cacert.pem", __dir__)
Octokit.connection_options = { ssl: { ca_file: ca_file } }
end

Expand Down Expand Up @@ -316,8 +316,8 @@ def check_github_response
end

# Presents the exception, and the aborts with the message.
def fail_with_message(e, message)
Helper.log.error("#{e.class}: #{e.message}")
def fail_with_message(error, message)
Helper.log.error("#{error.class}: #{error.message}")
sys_abort(message)
end

Expand Down