diff --git a/bin/ghclgen b/bin/ghclgen new file mode 100755 index 0000000..77ac711 --- /dev/null +++ b/bin/ghclgen @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby -U +require 'github_changelog_generator' +GitHubChangelogGenerator::CLI.start(ARGV) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index e571e78..ae5c527 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -5,10 +5,11 @@ require 'json' require 'colorize' require 'benchmark' -require_relative 'github_changelog_generator/parser' -require_relative 'github_changelog_generator/generator' -require_relative 'github_changelog_generator/version' -require_relative 'github_changelog_generator/reader' +require 'github_changelog_generator/parser' +require 'github_changelog_generator/generator' +require 'github_changelog_generator/version' +require 'github_changelog_generator/reader' +require 'github_changelog_generator/cli' module GitHubChangelogGenerator class ChangelogGenerator diff --git a/lib/github_changelog_generator/cli.rb b/lib/github_changelog_generator/cli.rb new file mode 100644 index 0000000..7b274aa --- /dev/null +++ b/lib/github_changelog_generator/cli.rb @@ -0,0 +1,35 @@ +# +# Author:: Enrico Stahn +# +# Copyright 2014, Zanui, +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'thor' + +module GitHubChangelogGenerator + class CLI < Thor + default_task :generate + + desc 'generate', 'Generates the CHANGELOG.md based on the given options' + option :user, :aliases => '-u', :type => :string, :desc => 'Username of the owner of target GitHub repo' + option :project, :aliases => '-p', :type => :string, :desc => 'Username of the owner of target GitHub repo' + option :token, :aliases => '-t', :type => :string, :desc => 'To make more than 50 requests per hour your GitHub token required. You can generate it here: https://github.com/settings/tokens/new' + option :issues_wo_labels, :type => :boolean, :default => true, :desc => 'Include closed issues without labels to changelog.' + + def generate + print_table([['Project:', 'zanui/chef-thumbor'], ['Username:', 'estahn']]) + end + end +end \ No newline at end of file