Move version to separate file
This commit is contained in:
parent
fab1e28e3e
commit
07e0ec0cfb
|
@ -1,6 +1,6 @@
|
|||
Gem::Specification.new do |s|
|
||||
s.name = "github_changelog_generator"
|
||||
s.version = "1.1.2"
|
||||
s.version = GitHubChangelogGenerator::VERSION
|
||||
s.default_executable = "github_changelog_generator"
|
||||
|
||||
s.required_ruby_version = '>= 1.9.3'
|
||||
|
|
|
@ -6,7 +6,7 @@ require 'httparty'
|
|||
require 'colorize'
|
||||
require_relative 'github_changelog_generator/parser'
|
||||
|
||||
|
||||
module GitHubChangelogGenerator
|
||||
class ChangelogGenerator
|
||||
|
||||
attr_accessor :options, :all_tags, :github
|
||||
|
@ -374,3 +374,5 @@ if __FILE__ == $0
|
|||
changelog_generator = ChangelogGenerator.new
|
||||
changelog_generator.compund_changelog
|
||||
end
|
||||
|
||||
end
|
|
@ -1,6 +1,8 @@
|
|||
#!/usr/bin/env ruby
|
||||
require 'optparse'
|
||||
require_relative 'version'
|
||||
|
||||
module GitHubChangelogGenerator
|
||||
class Parser
|
||||
def self.parse_options
|
||||
options = {:tag1 => nil, :tag2 => nil, :format => '%d/%m/%y', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* '}
|
||||
|
@ -20,7 +22,7 @@ class Parser
|
|||
puts opts
|
||||
exit
|
||||
end
|
||||
opts.on('-v', '--[no-]verbose', 'Run verbosely. Default is true') do |v|
|
||||
opts.on('--[no-]verbose', 'Run verbosely. Default is true') do |v|
|
||||
options[:verbose] = v
|
||||
end
|
||||
opts.on('--[no-]issues', 'Include closed issues to changelog. Default is true') do |v|
|
||||
|
@ -44,6 +46,10 @@ class Parser
|
|||
opts.on('--labels x,y,z', Array, 'List of labels. Issues with that labels will be included to changelog. Default is \'bug,enhancement\'') do |list|
|
||||
options[:labels] = list
|
||||
end
|
||||
opts.on('-v', '--version', 'Print version number') do |v|
|
||||
puts "Version: #{GitHubChangelogGenerator::VERSION}"
|
||||
exit
|
||||
end
|
||||
}
|
||||
|
||||
parser.parse!
|
||||
|
@ -79,3 +85,4 @@ class Parser
|
|||
options
|
||||
end
|
||||
end
|
||||
end
|
3
lib/github_changelog_generator/version.rb
Normal file
3
lib/github_changelog_generator/version.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
module GitHubChangelogGenerator
|
||||
VERSION = '1.1.2'
|
||||
end
|
Loading…
Reference in New Issue
Block a user