1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00
middleman--middleman/Rakefile

67 lines
1.5 KiB
Ruby
Raw Normal View History

require 'rake'
2011-12-29 22:52:00 -05:00
require File.expand_path('../middleman-core/lib/middleman-core/version.rb', __FILE__)
ROOT = File.expand_path(File.dirname(__FILE__))
GEM_NAME = 'middleman'
2014-05-26 21:44:11 -04:00
middleman_gems = %w(middleman-core middleman-cli middleman)
2011-12-29 22:52:00 -05:00
GEM_PATHS = middleman_gems.freeze
def sh_rake(command)
2014-04-29 13:50:21 -04:00
sh "#{Gem.ruby} -S rake #{command}", verbose: true
2011-12-29 22:52:00 -05:00
end
desc 'Displays the current version'
2011-12-29 22:52:00 -05:00
task :version do
2014-04-28 19:02:18 -04:00
puts "Current version: #{Middleman::VERSION}"
2011-12-29 22:52:00 -05:00
end
desc 'Pushes repository to GitHub'
2011-12-29 22:52:00 -05:00
task :push do
2014-04-28 19:02:18 -04:00
puts 'Pushing to github...'
2011-12-29 22:52:00 -05:00
sh "git tag v#{Middleman::VERSION}"
2015-02-13 17:42:17 -05:00
sh 'git push'
2011-12-29 22:52:00 -05:00
sh "git push origin v#{Middleman::VERSION}"
end
desc 'Release all middleman gems'
2014-04-29 13:50:21 -04:00
task publish: :push do
2014-04-28 19:02:18 -04:00
puts 'Pushing to rubygems...'
2011-12-29 22:52:00 -05:00
GEM_PATHS.each do |dir|
Dir.chdir(dir) { sh_rake('release') }
2011-12-29 22:52:00 -05:00
end
end
desc 'Generate documentation for all middleman gems'
2012-05-02 14:13:06 -04:00
task :doc do
GEM_PATHS.each do |g|
Dir.chdir("#{File.join(ROOT, g)}") { sh "#{Gem.ruby} -S rake yard" }
2012-05-02 14:13:06 -04:00
end
end
desc 'Run tests for all middleman gems'
task :test do
2014-09-09 03:14:45 -04:00
Rake::Task['rubocop'].invoke
2011-12-29 22:52:00 -05:00
GEM_PATHS.each do |g|
Dir.chdir("#{File.join(ROOT, g)}") { sh "#{Gem.ruby} -S rake test" }
end
end
desc 'Run specs for all middleman gems'
task :spec do
GEM_PATHS.each do |g|
Dir.chdir("#{File.join(ROOT, g)}") { sh "#{Gem.ruby} -S rake spec" }
end
end
2014-06-11 13:23:33 -04:00
require 'rubocop/rake_task'
desc 'Run RuboCop to check code consistency'
RuboCop::RakeTask.new(:rubocop) do |task|
task.fail_on_error = false
2013-05-23 18:59:26 -04:00
end
desc 'Run tests for all middleman gems'
2014-04-29 13:50:21 -04:00
task default: :test