Merge pull request #1142 from middleman/middleman_cli
Move CLI into middleman-cli
3
.gitmodules
vendored
|
@ -1,3 +0,0 @@
|
|||
[submodule "middleman-core/lib/middleman-more/templates/smacss"]
|
||||
path = middleman-core/lib/middleman-more/templates/smacss
|
||||
url = git@github.com:nsteiner/middleman-smacss.git
|
10
.yardopts
|
@ -1,10 +1,10 @@
|
|||
middleman-*/lib/**/*.rb
|
||||
--exclude middleman-core/lib/vendored-middleman-deps/
|
||||
--exclude middleman-core/lib/middleman-core/step_definitions
|
||||
--exclude middleman-core/lib/middleman-core/templates/default/
|
||||
--exclude middleman-core/lib/middleman-core/templates/html5/
|
||||
--exclude middleman-core/lib/middleman-core/templates/mobile/
|
||||
--exclude middleman-core/lib/middleman-core/templates/shared/
|
||||
--exclude middleman-core/lib/middleman-core/templates/extension/
|
||||
--exclude middleman-cli/lib/middleman-cli/templates/default/
|
||||
--exclude middleman-cli/lib/middleman-cli/templates/html5/
|
||||
--exclude middleman-cli/lib/middleman-cli/templates/mobile/
|
||||
--exclude middleman-cli/lib/middleman-cli/templates/shared/
|
||||
--exclude middleman-cli/lib/middleman-cli/templates/extension/
|
||||
--no-private
|
||||
--hide-void-return
|
1
Gemfile
|
@ -38,5 +38,6 @@ gem 'rubocop', :require => false
|
|||
|
||||
# Middleman itself
|
||||
gem 'middleman-core', :path => 'middleman-core'
|
||||
gem 'middleman-cli', :path => 'middleman-cli'
|
||||
gem 'middleman-sprockets', :github => 'middleman/middleman-sprockets', :require => false
|
||||
gem 'middleman', :path => 'middleman'
|
||||
|
|
2
Rakefile
|
@ -7,7 +7,7 @@ require File.expand_path('../middleman-core/lib/middleman-core/version.rb', __FI
|
|||
ROOT = File.expand_path(File.dirname(__FILE__))
|
||||
GEM_NAME = 'middleman'
|
||||
|
||||
middleman_gems = %w(middleman-core middleman)
|
||||
middleman_gems = %w(middleman-core middleman-cli middleman)
|
||||
GEM_PATHS = middleman_gems.freeze
|
||||
|
||||
def sh_rake(command)
|
||||
|
|
0
middleman-core/lib/middleman-core/templates/html5/source/img/.gitignore → middleman-cli/.gemtest
Executable file → Normal file
7
middleman-cli/.simplecov
Normal file
|
@ -0,0 +1,7 @@
|
|||
SimpleCov.start do
|
||||
add_filter '/fixtures/'
|
||||
add_filter '/features/'
|
||||
add_filter '/spec/'
|
||||
add_filter '/step_definitions/'
|
||||
add_filter '/lib/vendored-middleman-deps/'
|
||||
end
|
8
middleman-cli/.yardopts
Normal file
|
@ -0,0 +1,8 @@
|
|||
lib/**/*.rb
|
||||
--exclude lib/middleman-cli/templates/default/
|
||||
--exclude lib/middleman-cli/templates/html5/
|
||||
--exclude lib/middleman-cli/templates/mobile/
|
||||
--exclude lib/middleman-cli/templates/shared/
|
||||
--exclude lib/middleman-cli/templates/extension/
|
||||
--no-private
|
||||
--hide-void-return
|
5
middleman-cli/Rakefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
# coding:utf-8
|
||||
RAKE_ROOT = __FILE__
|
||||
|
||||
GEM_NAME = 'middleman-cli'
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
|
|
@ -9,7 +9,7 @@ Middleman::Profiling.start
|
|||
require "middleman-core/load_paths"
|
||||
Middleman.setup_load_paths
|
||||
|
||||
require "middleman-core/cli"
|
||||
require "middleman-cli"
|
||||
|
||||
# Change directory to the root
|
||||
Dir.chdir(ENV["MM_ROOT"]) if ENV["MM_ROOT"]
|
0
middleman-core/lib/middleman-core/templates/mobile/source/js/script.js → middleman-cli/features/.gitkeep
Executable file → Normal file
0
middleman-cli/fixtures/.gitkeep
Normal file
|
@ -1,3 +1,7 @@
|
|||
# Setup our load paths
|
||||
libdir = File.expand_path(File.dirname(__FILE__))
|
||||
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
||||
|
||||
# Require thor since that's what the who CLI is built around
|
||||
require 'thor'
|
||||
require 'thor/group'
|
||||
|
@ -82,9 +86,9 @@ module Middleman
|
|||
end
|
||||
|
||||
# Include the core CLI items
|
||||
require 'middleman-core/cli/init'
|
||||
require 'middleman-core/cli/bundler'
|
||||
require 'middleman-core/cli/extension'
|
||||
require 'middleman-core/cli/server'
|
||||
require 'middleman-core/cli/build'
|
||||
require 'middleman-core/cli/console'
|
||||
require 'middleman-cli/init'
|
||||
require 'middleman-cli/bundler'
|
||||
require 'middleman-cli/extension'
|
||||
require 'middleman-cli/server'
|
||||
require 'middleman-cli/build'
|
||||
require 'middleman-cli/console'
|
|
@ -15,21 +15,25 @@ module Middleman::Cli
|
|||
# Template files are relative to this file
|
||||
# @return [String]
|
||||
def self.source_root
|
||||
File.join(File.dirname(__FILE__), '..', 'templates', 'extension')
|
||||
File.join(File.dirname(__FILE__), 'templates')
|
||||
end
|
||||
|
||||
desc 'extension [options]', 'Create Middleman extension scaffold NAME'
|
||||
method_option 'skip-git',
|
||||
:type => :boolean,
|
||||
:default => false,
|
||||
:desc => 'Skip Git ignores and keeps'
|
||||
|
||||
# The extension task
|
||||
# @param [String] name
|
||||
def extension
|
||||
generate_gitignore!
|
||||
template 'Rakefile', File.join(name, 'Rakefile')
|
||||
template 'gemspec', File.join(name, "#{name}.gemspec")
|
||||
template 'Gemfile', File.join(name, 'Gemfile')
|
||||
template 'lib/middleman_extension.rb', File.join(name, 'lib', 'middleman_extension.rb')
|
||||
template 'lib/lib.rb', File.join(name, 'lib', "#{name}.rb")
|
||||
template 'features/support/env.rb', File.join(name, 'features', 'support', 'env.rb')
|
||||
template 'extension/Rakefile', File.join(name, 'Rakefile')
|
||||
template 'extension/gemspec', File.join(name, "#{name}.gemspec")
|
||||
template 'extension/Gemfile', File.join(name, 'Gemfile')
|
||||
template 'extension/lib/middleman_extension.rb', File.join(name, 'lib', 'middleman_extension.rb')
|
||||
template 'extension/lib/lib.rb', File.join(name, 'lib', "#{name}.rb")
|
||||
template 'extension/features/support/env.rb', File.join(name, 'features', 'support', 'env.rb')
|
||||
empty_directory File.join(name, 'fixtures')
|
||||
end
|
||||
|
||||
|
@ -40,8 +44,8 @@ module Middleman::Cli
|
|||
# Write a .gitignore file for project
|
||||
# @return [void]
|
||||
def generate_gitignore!
|
||||
return unless options[:git]
|
||||
copy_file 'gitignore', File.join(name, '.gitignore')
|
||||
return if options[:'skip-git']
|
||||
copy_file 'shared/gitignore', File.join(name, '.gitignore')
|
||||
end
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
require 'middleman-core/templates'
|
||||
require 'middleman-cli/templates'
|
||||
|
||||
# CLI Module
|
||||
module Middleman::Cli
|
|
@ -84,19 +84,16 @@ module Middleman::Templates
|
|||
end
|
||||
|
||||
# Default template
|
||||
require 'middleman-core/templates/default'
|
||||
require 'middleman-cli/templates/default'
|
||||
|
||||
# HTML5 template
|
||||
require 'middleman-core/templates/html5'
|
||||
require 'middleman-cli/templates/html5'
|
||||
|
||||
# HTML5 Mobile template
|
||||
require 'middleman-core/templates/mobile'
|
||||
|
||||
# SMACSS templates
|
||||
require 'middleman-more/templates/smacss'
|
||||
require 'middleman-cli/templates/mobile'
|
||||
|
||||
# Local templates
|
||||
require 'middleman-core/templates/local'
|
||||
require 'middleman-cli/templates/local'
|
||||
|
||||
# Barebones template
|
||||
require 'middleman-core/templates/empty'
|
||||
require 'middleman-cli/templates/empty'
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
0
middleman-cli/lib/middleman-cli/templates/html5/source/img/.gitignore
vendored
Executable file
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |