Move version to separate file
This commit is contained in:
parent
fab1e28e3e
commit
07e0ec0cfb
|
@ -1,6 +1,6 @@
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = "github_changelog_generator"
|
s.name = "github_changelog_generator"
|
||||||
s.version = "1.1.2"
|
s.version = GitHubChangelogGenerator::VERSION
|
||||||
s.default_executable = "github_changelog_generator"
|
s.default_executable = "github_changelog_generator"
|
||||||
|
|
||||||
s.required_ruby_version = '>= 1.9.3'
|
s.required_ruby_version = '>= 1.9.3'
|
||||||
|
|
|
@ -6,7 +6,7 @@ require 'httparty'
|
||||||
require 'colorize'
|
require 'colorize'
|
||||||
require_relative 'github_changelog_generator/parser'
|
require_relative 'github_changelog_generator/parser'
|
||||||
|
|
||||||
|
module GitHubChangelogGenerator
|
||||||
class ChangelogGenerator
|
class ChangelogGenerator
|
||||||
|
|
||||||
attr_accessor :options, :all_tags, :github
|
attr_accessor :options, :all_tags, :github
|
||||||
|
@ -374,3 +374,5 @@ if __FILE__ == $0
|
||||||
changelog_generator = ChangelogGenerator.new
|
changelog_generator = ChangelogGenerator.new
|
||||||
changelog_generator.compund_changelog
|
changelog_generator.compund_changelog
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -1,6 +1,8 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require 'optparse'
|
require 'optparse'
|
||||||
|
require_relative 'version'
|
||||||
|
|
||||||
|
module GitHubChangelogGenerator
|
||||||
class Parser
|
class Parser
|
||||||
def self.parse_options
|
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:* '}
|
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
|
puts opts
|
||||||
exit
|
exit
|
||||||
end
|
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
|
options[:verbose] = v
|
||||||
end
|
end
|
||||||
opts.on('--[no-]issues', 'Include closed issues to changelog. Default is true') do |v|
|
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|
|
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
|
options[:labels] = list
|
||||||
end
|
end
|
||||||
|
opts.on('-v', '--version', 'Print version number') do |v|
|
||||||
|
puts "Version: #{GitHubChangelogGenerator::VERSION}"
|
||||||
|
exit
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
parser.parse!
|
parser.parse!
|
||||||
|
@ -79,3 +85,4 @@ class Parser
|
||||||
options
|
options
|
||||||
end
|
end
|
||||||
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