Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aeba6dc810 | ||
|
|
df6745d737 | ||
|
|
f394a70e5b | ||
|
|
c83355d4e1 | ||
|
|
a5bc2f8562 | ||
|
|
fa757c1878 | ||
|
|
901c5ffba3 | ||
|
|
89ddb6291a | ||
|
|
65594a63c0 | ||
|
|
3a41f22339 | ||
|
|
a139eff84b | ||
|
|
95d4e49171 |
20
.travis.yml
20
.travis.yml
@@ -1,22 +1,16 @@
|
||||
sudo: false
|
||||
language: ruby
|
||||
before_install:
|
||||
- gem update --system
|
||||
- gem install bundler
|
||||
before_install:
|
||||
- gem update --system
|
||||
- gem install bundler
|
||||
rvm:
|
||||
- 2.1.0
|
||||
script: bundle exec rake checks
|
||||
matrix:
|
||||
include:
|
||||
# Test install on clean system
|
||||
- install: true
|
||||
script:
|
||||
- gem build github_changelog_generator
|
||||
- gem install *.gem
|
||||
- 2.1.0
|
||||
script:
|
||||
- bundle exec rake checks
|
||||
notifications:
|
||||
email:
|
||||
recipients:
|
||||
- sky4winder+githubchangeloggenerator@gmail.com
|
||||
- sky4winder+githubchangeloggenerator@gmail.com
|
||||
on_success: never
|
||||
on_failure: change
|
||||
addons:
|
||||
|
||||
45
CHANGELOG.md
45
CHANGELOG.md
@@ -1,53 +1,12 @@
|
||||
# Change Log
|
||||
|
||||
## [1.11.5](https://github.com/skywinder/github-changelog-generator/tree/1.11.5) (2016-03-01)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.11.4...1.11.5)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Test clean install in Travis [\#344](https://github.com/skywinder/github-changelog-generator/pull/344) ([jkeiser](https://github.com/jkeiser))
|
||||
- Update Rakefile to avoid install-breaking bug [\#341](https://github.com/skywinder/github-changelog-generator/pull/341) ([olleolleolle](https://github.com/olleolleolle))
|
||||
|
||||
## [1.11.4](https://github.com/skywinder/github-changelog-generator/tree/1.11.4) (2016-02-26)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.11.3...1.11.4)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Man page copying: only copy .1 [\#338](https://github.com/skywinder/github-changelog-generator/pull/338) ([olleolleolle](https://github.com/olleolleolle))
|
||||
|
||||
## [1.11.3](https://github.com/skywinder/github-changelog-generator/tree/1.11.3) (2016-02-25)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.11.2...1.11.3)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
- Cannot install gem [\#335](https://github.com/skywinder/github-changelog-generator/issues/335)
|
||||
|
||||
## [1.11.2](https://github.com/skywinder/github-changelog-generator/tree/1.11.2) (2016-02-25)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.11.1...1.11.2)
|
||||
## [1.10.5](https://github.com/skywinder/github-changelog-generator/tree/1.10.5) (2016-02-24)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.10.4...1.10.5)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Getting an error on install [\#329](https://github.com/skywinder/github-changelog-generator/issues/329)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Fix installation by not running the specs - which have dependencies [\#337](https://github.com/skywinder/github-changelog-generator/pull/337) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.11.1](https://github.com/skywinder/github-changelog-generator/tree/1.11.1) (2016-02-25)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.11.0...1.11.1)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Add rubocop and rspec as runtime dependencies [\#336](https://github.com/skywinder/github-changelog-generator/pull/336) ([jkeiser](https://github.com/jkeiser))
|
||||
- \[Refactor\] ParserFile class use Pathname [\#334](https://github.com/skywinder/github-changelog-generator/pull/334) ([olleolleolle](https://github.com/olleolleolle))
|
||||
- \[Refactor\] Generator\#exclude\_issues\_by\_labels simpler, tested [\#332](https://github.com/skywinder/github-changelog-generator/pull/332) ([olleolleolle](https://github.com/olleolleolle))
|
||||
|
||||
## [1.11.0](https://github.com/skywinder/github-changelog-generator/tree/1.11.0) (2016-02-24)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.10.5...1.11.0)
|
||||
|
||||
## [1.10.5](https://github.com/skywinder/github-changelog-generator/tree/1.10.5) (2016-02-24)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.10.4...1.10.5)
|
||||
|
||||
## [1.10.4](https://github.com/skywinder/github-changelog-generator/tree/1.10.4) (2016-02-24)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.10.3...1.10.4)
|
||||
|
||||
|
||||
6
Gemfile
6
Gemfile
@@ -3,10 +3,8 @@ source "https://rubygems.org"
|
||||
gemspec
|
||||
|
||||
group :test do
|
||||
gem "rake"
|
||||
gem "bundler"
|
||||
gem "rubocop"
|
||||
gem "overcommit"
|
||||
gem "rspec", "~>3.2"
|
||||
gem "rubocop", "~>0.31"
|
||||
gem "coveralls", "~>0.8", require: false
|
||||
gem "simplecov", "~>0.10", require: false
|
||||
gem "codeclimate-test-reporter", "~>0.4"
|
||||
|
||||
16
Gemfile.lock
16
Gemfile.lock
@@ -1,14 +1,12 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
github_changelog_generator (1.11.5)
|
||||
bundler (>= 1.7)
|
||||
github_changelog_generator (1.10.5)
|
||||
bundler (~> 1.7)
|
||||
colorize (~> 0.7)
|
||||
github_api (~> 0.12)
|
||||
overcommit (>= 0.31)
|
||||
rake (>= 10.0)
|
||||
rspec (>= 3.2)
|
||||
rubocop (>= 0.31)
|
||||
overcommit (~> 0.31)
|
||||
rake (~> 10.0)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
@@ -98,13 +96,11 @@ PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
bundler
|
||||
codeclimate-test-reporter (~> 0.4)
|
||||
coveralls (~> 0.8)
|
||||
github_changelog_generator!
|
||||
overcommit
|
||||
rake
|
||||
rubocop
|
||||
rspec (~> 3.2)
|
||||
rubocop (~> 0.31)
|
||||
simplecov (~> 0.10)
|
||||
|
||||
BUNDLED WITH
|
||||
|
||||
28
Rakefile
28
Rakefile
@@ -9,31 +9,15 @@ require "overcommit"
|
||||
RuboCop::RakeTask.new
|
||||
RSpec::Core::RakeTask.new(:rspec)
|
||||
|
||||
task :copy_man_page_to_manpath do |_t|
|
||||
known_manpath_paths = %w(/etc/manpath.config /etc/manpaths)
|
||||
manpath = known_manpath_paths.find do |f|
|
||||
path = Pathname(f)
|
||||
path.file? && path.readable?
|
||||
end
|
||||
|
||||
next unless manpath
|
||||
|
||||
writable_man_path = Pathname(manpath).each_line.find do |line|
|
||||
path = Pathname(line.chomp)
|
||||
path.directory? && path.writable?
|
||||
end
|
||||
|
||||
next unless writable_man_path
|
||||
|
||||
man_prefix = Pathname("#{writable_man_path.chomp}/man1")
|
||||
man_pages = "man/git-*.1"
|
||||
task :create_man do |_t|
|
||||
os_prefix = "/usr/local"
|
||||
man_prefix = Pathname("#{os_prefix}/share/man/man1")
|
||||
man_pages = "man/git-*"
|
||||
|
||||
Pathname.glob(man_pages) do |path|
|
||||
if path.exist? && man_prefix.exist? && man_prefix.writable?
|
||||
FileUtils.cp(path, man_prefix + path.basename)
|
||||
end
|
||||
FileUtils.cp(path, man_prefix + path.basename)
|
||||
end
|
||||
end
|
||||
|
||||
task checks: [:rubocop, :rspec]
|
||||
task default: [:copy_man_page_to_manpath]
|
||||
task default: [:checks, :create_man]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# coding: utf-8
|
||||
require "date"
|
||||
|
||||
lib = File.expand_path("../lib", __FILE__)
|
||||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||
require "github_changelog_generator/version"
|
||||
@@ -12,23 +12,21 @@ Gem::Specification.new do |spec|
|
||||
spec.required_ruby_version = ">= 1.9.3"
|
||||
spec.authors = ["Petr Korolev"]
|
||||
spec.email = "sky4winder+github_changelog_generator@gmail.com"
|
||||
spec.date = Date.today.iso8601
|
||||
spec.date = `date +"%Y-%m-%d"`.strip!
|
||||
spec.summary = "Script, that automatically generate changelog from your tags, issues, labels and pull requests."
|
||||
spec.description = "Changelog generation has never been so easy. Fully automate changelog generation - this gem generate change log file based on tags, issues and merged pull requests from Github issue tracker."
|
||||
spec.homepage = "https://github.com/skywinder/Github-Changelog-Generator"
|
||||
spec.license = "MIT"
|
||||
spec.extensions = ["Rakefile"]
|
||||
# spec.extensions = ["Rakefile"]
|
||||
|
||||
spec.files = `git ls-files -z`.split("\x0")
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_runtime_dependency "rake", ">= 10.0"
|
||||
spec.add_runtime_dependency "bundler", ">= 1.7"
|
||||
spec.add_runtime_dependency "rake", "~> 10.0"
|
||||
spec.add_runtime_dependency "bundler", "~> 1.7"
|
||||
spec.add_runtime_dependency("github_api", ["~> 0.12"])
|
||||
spec.add_runtime_dependency("colorize", ["~> 0.7"])
|
||||
spec.add_runtime_dependency("overcommit", ">= 0.31")
|
||||
spec.add_runtime_dependency("rubocop", ">= 0.31")
|
||||
spec.add_runtime_dependency("rspec", ">= 3.2")
|
||||
spec.add_runtime_dependency("overcommit", "~>0.31")
|
||||
end
|
||||
|
||||
@@ -4,12 +4,13 @@ module GitHubChangelogGenerator
|
||||
# @param [Array] issues
|
||||
# @return [Array] filtered array
|
||||
def exclude_issues_by_labels(issues)
|
||||
return issues if !@options[:exclude_labels] || @options[:exclude_labels].empty?
|
||||
|
||||
issues.reject do |issue|
|
||||
labels = issue.labels.map(&:name)
|
||||
(labels & @options[:exclude_labels]).any?
|
||||
unless @options[:exclude_labels].nil?
|
||||
issues = issues.select do |issue|
|
||||
var = issue.labels.map(&:name) & @options[:exclude_labels]
|
||||
!var.any?
|
||||
end
|
||||
end
|
||||
issues
|
||||
end
|
||||
|
||||
# @return [Array] filtered issues accourding milestone
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
require "pathname"
|
||||
|
||||
module GitHubChangelogGenerator
|
||||
ParserError = Class.new(StandardError)
|
||||
|
||||
class ParserFile
|
||||
FILENAME = ".github_changelog_generator"
|
||||
|
||||
def initialize(options)
|
||||
@options = options
|
||||
end
|
||||
|
||||
# Destructively change @options using data in configured options file.
|
||||
def parse!
|
||||
file.each_line { |line| parse_line!(line) } if file.exist?
|
||||
return unless File.exist?(file)
|
||||
|
||||
File.readlines(file).each { |line| parse_line!(line) }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def file
|
||||
@file ||= Pathname(File.expand_path(@options[:params_file] || FILENAME))
|
||||
@file ||= File.expand_path(@options[:params_file] || ".github_changelog_generator")
|
||||
end
|
||||
|
||||
def parse_line!(line)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module GitHubChangelogGenerator
|
||||
VERSION = "1.11.6"
|
||||
VERSION = "1.11.0"
|
||||
end
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
module GitHubChangelogGenerator
|
||||
describe Generator do
|
||||
context "#exclude_issues_by_labels" do
|
||||
let(:label) { double("the-bad-label", name: "BAD") }
|
||||
let(:issue) { double("the-issue-to-be-excluded", labels: [label]) }
|
||||
let(:good_label) { double("a-good-label", name: "GOOD") }
|
||||
let(:good_issue) { double("an-issue-to-be-kept", labels: [good_label]) }
|
||||
let(:issues) { [issue, good_issue] }
|
||||
subject(:generator) { described_class.new(exclude_labels: %w(BAD BOO)) }
|
||||
|
||||
it "removes issues with labels in the exclude_label list" do
|
||||
result = generator.exclude_issues_by_labels(issues)
|
||||
|
||||
expect(result).to include(good_issue)
|
||||
expect(result).not_to include(issue)
|
||||
end
|
||||
|
||||
context "with no option given" do
|
||||
subject(:generator) { described_class.new }
|
||||
it "passes everything through when no option given" do
|
||||
result = generator.exclude_issues_by_labels(issues)
|
||||
|
||||
expect(result).to eq(issues)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user