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) }