From a5c4899360c53ba6ca9f2b34317864fc10d9ec30 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Tue, 11 Nov 2014 15:15:02 +0200 Subject: [PATCH 1/8] add travis configs --- .travis.yml | 4 ++++ Gemfile | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..00fa315 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: ruby +rvm: + - 1.9.3 + diff --git a/Gemfile b/Gemfile index d4c6197..cd2a35c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ + source 'https://rubygems.org' gem 'github_api' gem 'httparty' +gem 'rake' From 67b438f46b0c48a6c84d1c17080518eb013b630c Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Tue, 2 Dec 2014 18:09:18 +0200 Subject: [PATCH 2/8] update gem --- .travis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 00fa315..254ac4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,8 @@ language: ruby +before_install: + - gem update --system + - gem --version rvm: - - 1.9.3 - + - 2.1.0 +gemfile: + - Gemfile From bc13632545a22b90ab82f5cc8eb342196ed8e202 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 3 Dec 2014 11:09:11 +0200 Subject: [PATCH 3/8] add rake to gemfile --- Gemfile | 3 ++- lib/github_changelog_generator.rb | 27 +++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Gemfile b/Gemfile index 6f485e5..3601117 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,4 @@ source 'https://rubygems.org' gem 'github_api' -gem 'colorize' \ No newline at end of file +gem 'colorize' +gem 'rake' diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 0e8bf8d..ffbb86b 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -111,7 +111,6 @@ module GitHubChangelogGenerator if @options[:last] log += self.generate_log_between_tags(self.all_tags[0], self.all_tags[1]) elsif @options[:tag1] and @options[:tag2] - tag1 = @options[:tag1] tag2 = @options[:tag2] tags_strings = [] @@ -159,11 +158,11 @@ module GitHubChangelogGenerator puts "Generating log.." end - for index in 1 ... self.all_tags.size + (1 ... self.all_tags.size).each { |index| log += self.generate_log_between_tags(self.all_tags[index], self.all_tags[index-1]) - end + } - log += self.generate_log_before_tag(self.all_tags.last) + log += generate_log_between_tags(nil, self.all_tags.last) log end @@ -216,14 +215,14 @@ module GitHubChangelogGenerator if older_tag.nil? filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, newer_tag_time) - issues = delete_by_time(@issues, :closed_at, newer_tag_time) + filtered_issues = delete_by_time(@issues, :closed_at, newer_tag_time) else older_tag_time = self.get_time_of_tag(older_tag) filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, newer_tag_time, older_tag_time) - issues = delete_by_time(@issues, :closed_at, newer_tag_time, older_tag_time) + filtered_issues = delete_by_time(@issues, :closed_at, newer_tag_time, older_tag_time) end - self.create_log(filtered_pull_requests, issues, newer_tag_name, newer_tag_time) + self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time) end @@ -241,7 +240,7 @@ module GitHubChangelogGenerator tag_in_range_new = t <= newer_tag_time tag_in_range = (tag_in_range_old) && (tag_in_range_new) - + tag_in_range else false @@ -249,15 +248,15 @@ module GitHubChangelogGenerator } end - def generate_log_before_tag(tag) - generate_log_between_tags(nil, tag) - end - +# @param [Array] pull_requests +# @param [Array] issues +# @param [String] tag_name +# @param [String] tag_time +# @return [String] def create_log(pull_requests, issues, tag_name, tag_time) # Generate tag name and link - trimmed_tag = tag_name.tr('v', '') - log = "## [#{trimmed_tag}] (https://github.com/#{@options[:user]}/#{@options[:project]}/tree/#{tag_name})\n" + log = "## [#{tag_name}] (https://github.com/#{@options[:user]}/#{@options[:project]}/tree/#{tag_name})\n" #Generate date string: time_string = tag_time.strftime @options[:format] From caf264360b3b29cd953ec01559f64e8f73f610c9 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 3 Dec 2014 11:18:13 +0200 Subject: [PATCH 4/8] remove before install --- .travis.yml | 3 --- Gemfile.lock | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 254ac4c..df0dd07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,4 @@ language: ruby -before_install: - - gem update --system - - gem --version rvm: - 2.1.0 gemfile: diff --git a/Gemfile.lock b/Gemfile.lock index 065252f..65b469f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,6 +30,7 @@ GEM multi_xml (~> 0.5) rack (~> 1.2) rack (1.5.2) + rake (10.4.2) thread_safe (0.3.4) PLATFORMS @@ -38,3 +39,4 @@ PLATFORMS DEPENDENCIES colorize github_api + rake From 5dcbef87d109da7fd8256082f960e5bbf92983af Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 3 Dec 2014 11:19:31 +0200 Subject: [PATCH 5/8] put back gem updates --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index df0dd07..254ac4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ language: ruby +before_install: + - gem update --system + - gem --version rvm: - 2.1.0 gemfile: From 326a067ac57403af4f424e77dc8146a2b7204aa0 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 3 Dec 2014 11:27:05 +0200 Subject: [PATCH 6/8] remove dep rake --- Gemfile | 2 +- github_changelog_generator.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 3601117..0b855c6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' gem 'github_api' gem 'colorize' -gem 'rake' +# gem 'rake' diff --git a/github_changelog_generator.gemspec b/github_changelog_generator.gemspec index 1e75438..a7e13de 100644 --- a/github_changelog_generator.gemspec +++ b/github_changelog_generator.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.7" - spec.add_development_dependency "rake", "~> 10.0" + # spec.add_development_dependency "rake", "~> 10.0" spec.add_runtime_dependency(%q, ["~> 0.12"]) spec.add_runtime_dependency(%q, ["~> 0.7"]) From 52123885a107c0ed28112d2ec1636e485289e3fc Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 3 Dec 2014 11:30:26 +0200 Subject: [PATCH 7/8] add rakefile --- Rakefile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Rakefile diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..b5ce9ca --- /dev/null +++ b/Rakefile @@ -0,0 +1,9 @@ +require "rake/testtask" + +task :default => [:test] + +Rake::TestTask.new do |t| + t.verbose = true + t.libs.push("demo", "test") + t.pattern = "test/**/*_test.rb" +end From bcecb4eb810b5562f37efb6c417b777b68885699 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 3 Dec 2014 11:31:51 +0200 Subject: [PATCH 8/8] Revert "remove dep rake" This reverts commit 326a067ac57403af4f424e77dc8146a2b7204aa0. --- Gemfile | 2 +- github_changelog_generator.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 0b855c6..3601117 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' gem 'github_api' gem 'colorize' -# gem 'rake' +gem 'rake' diff --git a/github_changelog_generator.gemspec b/github_changelog_generator.gemspec index a7e13de..1e75438 100644 --- a/github_changelog_generator.gemspec +++ b/github_changelog_generator.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.7" - # spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rake", "~> 10.0" spec.add_runtime_dependency(%q, ["~> 0.12"]) spec.add_runtime_dependency(%q, ["~> 0.7"])