Add test gems to extension and a gitignore. Closes #570
This commit is contained in:
parent
f7fc041034
commit
193f32b9fb
|
@ -11,3 +11,4 @@ Feature: Middleman New Extension CLI
|
||||||
| features/support/env.rb |
|
| features/support/env.rb |
|
||||||
| lib/middleman_extension.rb |
|
| lib/middleman_extension.rb |
|
||||||
| lib/my-extension-library.rb |
|
| lib/my-extension-library.rb |
|
||||||
|
| .gitignore |
|
||||||
|
|
|
@ -12,11 +12,18 @@ module Middleman::Cli
|
||||||
# Required path for the new project to be generated
|
# Required path for the new project to be generated
|
||||||
argument :name, :type => :string
|
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"
|
desc "extension [options]", "Create Middleman extension scaffold NAME"
|
||||||
|
|
||||||
# The extension task
|
# The extension task
|
||||||
# @param [String] name
|
# @param [String] name
|
||||||
def extension
|
def extension
|
||||||
|
generate_gitignore!
|
||||||
template "Rakefile", File.join(name, "Rakefile")
|
template "Rakefile", File.join(name, "Rakefile")
|
||||||
template "gemspec", File.join(name, "#{name}.gemspec")
|
template "gemspec", File.join(name, "#{name}.gemspec")
|
||||||
template "Gemfile", File.join(name, "Gemfile")
|
template "Gemfile", File.join(name, "Gemfile")
|
||||||
|
@ -26,11 +33,17 @@ module Middleman::Cli
|
||||||
empty_directory File.join(name, "fixtures")
|
empty_directory File.join(name, "fixtures")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Template files are relative to this file
|
# Output a .gitignore file
|
||||||
# @return [String]
|
class_option :git, :type => :boolean, :default => true
|
||||||
def self.source_root
|
|
||||||
File.join(File.dirname(__FILE__), "..", "templates", "extension")
|
no_tasks {
|
||||||
end
|
# 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
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,3 +2,16 @@ source :rubygems
|
||||||
|
|
||||||
# Specify your gem's dependencies in <%= name %>.gemspec
|
# 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