mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
Add test gems to extension and a gitignore. Closes #570
This commit is contained in:
parent
f7fc041034
commit
193f32b9fb
3 changed files with 34 additions and 7 deletions
|
@ -11,3 +11,4 @@ Feature: Middleman New Extension CLI
|
|||
| features/support/env.rb |
|
||||
| lib/middleman_extension.rb |
|
||||
| lib/my-extension-library.rb |
|
||||
| .gitignore |
|
||||
|
|
|
@ -11,12 +11,19 @@ module Middleman::Cli
|
|||
|
||||
# Required path for the new project to be generated
|
||||
argument :name, :type => :string
|
||||
|
||||
|
||||
# Template files are relative to this file
|
||||
# @return [String]
|
||||
def self.source_root
|
||||
File.join(File.dirname(__FILE__), "..", "templates", "extension")
|
||||
end
|
||||
|
||||
desc "extension [options]", "Create Middleman extension scaffold NAME"
|
||||
|
||||
# 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")
|
||||
|
@ -26,11 +33,17 @@ module Middleman::Cli
|
|||
empty_directory File.join(name, "fixtures")
|
||||
end
|
||||
|
||||
# Template files are relative to this file
|
||||
# @return [String]
|
||||
def self.source_root
|
||||
File.join(File.dirname(__FILE__), "..", "templates", "extension")
|
||||
end
|
||||
# Output a .gitignore file
|
||||
class_option :git, :type => :boolean, :default => true
|
||||
|
||||
no_tasks {
|
||||
# Write a .gitignore file for project
|
||||
# @return [void]
|
||||
def generate_gitignore!
|
||||
return unless options[:git]
|
||||
copy_file "gitignore", File.join(name, ".gitignore")
|
||||
end
|
||||
}
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,17 @@
|
|||
source :rubygems
|
||||
|
||||
# Specify your gem's dependencies in <%= name %>.gemspec
|
||||
gemspec
|
||||
gemspec
|
||||
|
||||
group :development do
|
||||
gem "rake", "~> 0.9.2"
|
||||
gem "rdoc", "~> 3.9"
|
||||
gem "yard", "~> 0.8.0"
|
||||
end
|
||||
|
||||
group :test do
|
||||
gem "cucumber", "~> 1.2.0"
|
||||
gem "fivemat"
|
||||
gem "aruba", "~> 0.4.11"
|
||||
gem "rspec", "~> 2.7"
|
||||
end
|
Loading…
Reference in a new issue