Class: Tap::Generator::Generators::Root
- Defined in:
- lib/tap/generator/generators/root.rb
Overview
:startdoc::generator a basic tap directory structure
Generates a tap root directory structure. Use the switches to turn on or off the creation of various files:
project
|- MIT-LICENSE
|- README
|- lib
|- project.gemspec
|- tap.yml
|- tapfile
`- test
`- test_helper.rb
Instance Attribute Summary
Attributes inherited from Base
Attributes included from Helpers
Instance Method Summary collapse
-
#manifest(m, root, project_name = nil) ⇒ Object
::args ROOT, PROJECT_NAME=basename(ROOT).
Methods inherited from Base
#action, build, convert_to_spec, #directories, #directory, #file, #initialize, #iterate, #log_relative, #on, parse_as, #path, #process, #template, #template_files
Methods included from Helpers
Constructor Details
This class inherits a constructor from Tap::Generator::Base
Instance Method Details
#manifest(m, root, project_name = nil) ⇒ Object
::args ROOT, PROJECT_NAME=basename(ROOT)
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/tap/generator/generators/root.rb', line 45 def manifest(m, root, project_name=nil) r = destination_root.root(root) project_name = File.basename(r.path) if project_name == nil m.directory r.path m.directory r.path('lib') m.directory r.path('test') template_files do |source, target| case when File.directory?(source) m.directory r.path(target) next when source =~ /gemspec$/ locals = gemspec.config.to_hash.merge( :project_name => project_name, :license => license, :history => history ) m.template r.path("#{project_name}.gemspec"), source, locals next when source =~ /tapfile$/ next unless tapfile when source =~ /MIT-LICENSE$/ next unless license end m.template r.path(target), source, :project_name => project_name, :license => license end m.file(r.path('History')) if history end |