From 12f3b76348a739390688f8fc032d460e5e93c5ac Mon Sep 17 00:00:00 2001 From: Dlani Mendes Date: Fri, 2 Oct 2015 18:14:19 -0300 Subject: [PATCH] Adjusts Run Post Install --- .travis.yml | 2 +- Rakefile | 16 +++++++++++++++- ext/mkrf_conf.rb | 10 ---------- github_changelog_generator.gemspec | 4 ++-- 4 files changed, 18 insertions(+), 14 deletions(-) delete mode 100644 ext/mkrf_conf.rb diff --git a/.travis.yml b/.travis.yml index 86f87b0..cf085fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ before_install: rvm: - 2.1.0 script: -- bundle exec rake +- bundle exec rake checks notifications: email: recipients: diff --git a/Rakefile b/Rakefile index 4254421..3c6c2ea 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,21 @@ +require "bundler/gem_tasks" require "rubocop/rake_task" require "rspec/core/rake_task" +require "pathname" +require "fileutils" RuboCop::RakeTask.new RSpec::Core::RakeTask.new(:rspec) -task default: [:rubocop, :rspec] +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| + FileUtils.cp(path, man_prefix + path.basename) + end +end + +task checks: [:rubocop, :rspec] +task default: [:checks, :create_man] diff --git a/ext/mkrf_conf.rb b/ext/mkrf_conf.rb deleted file mode 100644 index 60e36a3..0000000 --- a/ext/mkrf_conf.rb +++ /dev/null @@ -1,10 +0,0 @@ -PREFIX = "/usr/local" -MANPREFIX = "#{PREFIX}/share/man/man1" -MAN_PAGES = "man/git-*" - -require "fileutils" - -Dir.glob(MAN_PAGES).each do |f| - filename = File.basename(f) - FileUtils.cp(f, "#{MANPREFIX}/#{filename}") -end diff --git a/github_changelog_generator.gemspec b/github_changelog_generator.gemspec index f4b44cf..b110954 100644 --- a/github_changelog_generator.gemspec +++ b/github_changelog_generator.gemspec @@ -16,8 +16,8 @@ Gem::Specification.new do |spec| 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 = "ext/mkrf_conf.rb" + spec.license = "MIT" + spec.extensions = ["Rakefile"] spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }