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

Move CLI into middleman-cli

This commit is contained in:
Thomas Reynolds 2014-01-02 16:34:08 -08:00
parent 09c7bda6b1
commit bea2515a41
156 changed files with 164 additions and 523 deletions

3
.gitmodules vendored
View file

@ -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

View file

@ -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

View file

@ -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'

View file

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

7
middleman-cli/.simplecov Normal file
View 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
View 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
View 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')

View file

@ -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"]

View file

View 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'

View file

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

View file

@ -1,4 +1,4 @@
require 'middleman-core/templates'
require 'middleman-cli/templates'
# CLI Module
module Middleman::Cli

View file

@ -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'

View file

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

Some files were not shown because too many files have changed in this diff Show more