Merge pull request #1614 from poporul/v3-stable
Little bit cleaned up. Dry in rake tasks. Fix $LOAD_PATH
This commit is contained in:
commit
5f69431a74
2
Gemfile
2
Gemfile
|
@ -35,6 +35,6 @@ gem 'simplecov', '~> 0.10', require: false
|
|||
gem 'coveralls', '~> 0.8', require: false
|
||||
|
||||
# Middleman itself
|
||||
gem 'middleman', path: 'middleman'
|
||||
gem 'middleman-core', path: 'middleman-core'
|
||||
gem 'middleman', path: 'middleman'
|
||||
gem 'middleman-sprockets', github: 'middleman/middleman-sprockets', branch: 'v3-stable-real'
|
||||
|
|
31
Rakefile
31
Rakefile
|
@ -1,17 +1,17 @@
|
|||
require 'rake'
|
||||
|
||||
require File.expand_path('../middleman-core/lib/middleman-core/version.rb', __FILE__)
|
||||
|
||||
ROOT = File.expand_path(File.dirname(__FILE__))
|
||||
GEM_NAME = 'middleman'
|
||||
|
||||
middleman_gems = %w(middleman-core middleman)
|
||||
GEM_PATHS = middleman_gems.freeze
|
||||
require 'middleman-core/version'
|
||||
|
||||
def sh_rake(command)
|
||||
sh "#{Gem.ruby} -S rake #{command}", verbose: true
|
||||
end
|
||||
|
||||
def within_each_gem(&block)
|
||||
%w(middleman-core middleman).each do |dir|
|
||||
Dir.chdir(dir) { block.call }
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Displays the current version'
|
||||
task :version do
|
||||
puts "Current version: #{Middleman::VERSION}"
|
||||
|
@ -28,32 +28,23 @@ end
|
|||
desc 'Release all middleman gems'
|
||||
task publish: :push do
|
||||
puts 'Pushing to rubygems...'
|
||||
GEM_PATHS.each do |dir|
|
||||
Dir.chdir(dir) { sh_rake('release') }
|
||||
end
|
||||
within_each_gem { sh_rake('release') }
|
||||
end
|
||||
|
||||
desc 'Generate documentation for all middleman gems'
|
||||
task :doc do
|
||||
GEM_PATHS.each do |g|
|
||||
Dir.chdir("#{File.join(ROOT, g)}") { sh "#{Gem.ruby} -S rake yard" }
|
||||
end
|
||||
within_each_gem { sh_rake('yard') }
|
||||
end
|
||||
|
||||
desc 'Run tests for all middleman gems'
|
||||
task :test do
|
||||
Rake::Task['rubocop'].invoke
|
||||
|
||||
GEM_PATHS.each do |g|
|
||||
Dir.chdir("#{File.join(ROOT, g)}") { sh "#{Gem.ruby} -S rake test" }
|
||||
end
|
||||
within_each_gem { sh_rake('test') }
|
||||
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
|
||||
within_each_gem { sh_rake('spec') }
|
||||
end
|
||||
|
||||
require 'rubocop/rake_task'
|
||||
|
|
|
@ -23,14 +23,6 @@ Cucumber::Rake::Task.new do |t|
|
|||
t.cucumber_opts = "--require features --color #{exempt_tags.join(' ')} --strict"# --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
|
||||
end
|
||||
|
||||
Cucumber::Rake::Task.new(:cucumber_wip) do |t|
|
||||
exempt_tags = ['--tags @wip']
|
||||
exempt_tags << '--tags ~@nojava' if RUBY_PLATFORM == 'java'
|
||||
exempt_tags << '--tags ~@encoding' unless Object.const_defined?(:Encoding)
|
||||
exempt_tags << '--tags ~@nowindows' if Gem.win_platform?
|
||||
t.cucumber_opts = "--color #{exempt_tags.join(' ')} --strict"# --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
|
||||
end
|
||||
|
||||
require 'rspec/core/rake_task'
|
||||
desc 'Run RSpec'
|
||||
RSpec::Core::RakeTask.new do |spec|
|
||||
|
@ -38,8 +30,12 @@ RSpec::Core::RakeTask.new do |spec|
|
|||
spec.rspec_opts = ['--color', '--format documentation']
|
||||
end
|
||||
|
||||
test_tasks = []
|
||||
test_tasks << :spec if Dir.exists? 'spec'
|
||||
test_tasks << :cucumber if Dir.exists? 'features'
|
||||
|
||||
desc 'Run tests, both RSpec and Cucumber'
|
||||
task test: [:spec, :cucumber]
|
||||
task test: test_tasks
|
||||
|
||||
YARD::Rake::YardocTask.new
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
--color
|
|
@ -1,6 +1 @@
|
|||
# coding:utf-8
|
||||
RAKE_ROOT = __FILE__
|
||||
|
||||
GEM_NAME = ENV['NAME'] || 'middleman-core'
|
||||
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
|
||||
require_relative '../gem_rake_helper'
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
# rubocop:disable FileName
|
||||
|
||||
# Setup our load paths
|
||||
libdir = File.expand_path(File.dirname(__FILE__))
|
||||
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
||||
|
||||
# Top-level Middleman namespace
|
||||
module Middleman
|
||||
# Backwards compatibility namespace
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path("../lib/middleman-core/version", __FILE__)
|
||||
lib = File.expand_path("../lib", __FILE__)
|
||||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||
|
||||
require "middleman-core/version"
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "middleman-core"
|
||||
|
|
|
@ -1,5 +1 @@
|
|||
# coding:utf-8
|
||||
RAKE_ROOT = __FILE__
|
||||
|
||||
GEM_NAME = 'middleman'
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
|
||||
require_relative '../gem_rake_helper'
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
$:.push File.expand_path("../lib", __FILE__)
|
||||
require File.expand_path("../../middleman-core/lib/middleman-core/version.rb", __FILE__)
|
||||
lib = File.expand_path('../lib', __FILE__)
|
||||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||
|
||||
require "middleman-core/version"
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "middleman"
|
||||
|
@ -14,7 +15,6 @@ Gem::Specification.new do |s|
|
|||
s.description = "A static site generator. Provides dozens of templating languages (Haml, Sass, Compass, Slim, CoffeeScript, and more). Makes minification, compression, cache busting, Yaml data (and more) an easy part of your development cycle."
|
||||
|
||||
s.files = `git ls-files -z`.split("\0")
|
||||
s.test_files = `git ls-files -z -- {fixtures,features}/*`.split("\0")
|
||||
s.require_paths = ["lib"]
|
||||
s.required_ruby_version = '>= 1.9.3'
|
||||
|
||||
|
|
Loading…
Reference in a new issue