ronin-gen 0.2.0 → 1.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +4 -0
- data/.rspec +1 -0
- data/.yardopts +1 -0
- data/ChangeLog.md +41 -0
- data/Gemfile +27 -0
- data/{README.txt → README.md} +30 -21
- data/Rakefile +24 -20
- data/bin/ronin-gen +27 -8
- data/data/ronin/gen/library/.document +5 -0
- data/data/ronin/gen/library/.gitignore +10 -0
- data/data/ronin/gen/library/.rspec +1 -0
- data/data/ronin/gen/library/.yardopts.erb +1 -0
- data/data/ronin/gen/library/COPYING.txt +339 -0
- data/data/ronin/gen/library/ChangeLog.md.erb +4 -0
- data/data/ronin/gen/library/Gemfile.erb +23 -0
- data/data/ronin/gen/library/README.md.erb +46 -0
- data/data/ronin/gen/library/Rakefile +30 -0
- data/data/ronin/gen/library/bin/ronin-command.erb +25 -0
- data/data/ronin/gen/library/bin/ronin-name.erb +27 -0
- data/data/ronin/gen/library/gemspec.yml.erb +20 -0
- data/data/ronin/gen/library/lib/ronin/_license.erb +19 -0
- data/data/ronin/gen/library/lib/ronin/gen/generators/generator.rb.erb +22 -0
- data/data/ronin/gen/library/lib/ronin/name.rb.erb +3 -0
- data/data/ronin/gen/library/lib/ronin/name/version.rb.erb +8 -0
- data/data/ronin/gen/library/lib/ronin/ui/command_line/commands/command.rb.erb +22 -0
- data/data/ronin/gen/library/library.gemspec.erb +10 -0
- data/data/ronin/gen/library/spec/name/name_spec.rb.erb +8 -0
- data/data/ronin/gen/library/spec/spec_helper.rb.erb +4 -0
- data/data/ronin/gen/repository/.rspec +1 -0
- data/data/ronin/gen/repository/Rakefile.erb +32 -0
- data/data/ronin/gen/repository/ronin.yml.erb +18 -0
- data/{static/ronin/generators/platform → data/ronin/gen/repository}/spec/spec_helper.rb +0 -0
- data/gemspec.yml +24 -0
- data/lib/ronin/gen.rb +26 -0
- data/lib/ronin/{ui/command_line/commands/gen_overlay.rb → gen/config.rb} +6 -8
- data/lib/ronin/{generators → gen}/dir_generator.rb +25 -21
- data/lib/ronin/{generators.rb → gen/exceptions.rb} +2 -5
- data/lib/ronin/{generators/platform/static.rb → gen/exceptions/unknown_generator.rb} +3 -6
- data/lib/ronin/gen/file_generator.rb +73 -0
- data/lib/ronin/gen/gen.rb +85 -0
- data/lib/ronin/gen/generatable.rb +36 -0
- data/lib/ronin/gen/generator.rb +312 -0
- data/lib/ronin/{ui/command_line/commands/gen_extension.rb → gen/generators.rb} +8 -9
- data/lib/ronin/gen/generators/library.rb +196 -0
- data/lib/ronin/gen/generators/repository.rb +130 -0
- data/lib/ronin/gen/ruby_generator.rb +34 -0
- data/lib/ronin/gen/source_code_generator.rb +46 -0
- data/lib/ronin/{generators → gen}/version.rb +3 -3
- data/lib/ronin/ui/{command_line → cli}/commands/gen.rb +18 -19
- data/ronin-gen.gemspec +10 -0
- data/spec/gen/classes/basic_generator.rb +16 -0
- data/spec/gen/classes/dir_generator.rb +9 -0
- data/spec/{generators → gen}/classes/file_generator.rb +2 -2
- data/spec/{generators → gen}/classes/templated_generator.rb +3 -3
- data/spec/gen/classes/touch_generator.rb +9 -0
- data/spec/gen/gen_spec.rb +22 -0
- data/spec/gen/generator_spec.rb +68 -0
- data/spec/gen/generators/library_spec.rb +132 -0
- data/spec/gen/generators/repository_spec.rb +92 -0
- data/spec/gen/helpers/data.rb +9 -0
- data/spec/{generators/helpers/static → gen/helpers/data}/generators/templated.txt.erb +0 -0
- data/spec/spec_helper.rb +3 -5
- metadata +190 -114
- data.tar.gz.sig +0 -0
- data/History.txt +0 -41
- data/Manifest.txt +0 -39
- data/bin/ronin-gen-extension +0 -12
- data/bin/ronin-gen-overlay +0 -12
- data/lib/ronin/generators/generator.rb +0 -165
- data/lib/ronin/generators/platform/extension.rb +0 -52
- data/lib/ronin/generators/platform/overlay.rb +0 -223
- data/spec/generated_extension_examples.rb +0 -27
- data/spec/generated_overlay_examples.rb +0 -72
- data/spec/generators/classes/dir_generator.rb +0 -9
- data/spec/generators/classes/touch_generator.rb +0 -9
- data/spec/generators/generator_spec.rb +0 -50
- data/spec/generators/generators_spec.rb +0 -9
- data/spec/generators/helpers/generators.rb +0 -3
- data/spec/generators/platform/extension_spec.rb +0 -22
- data/spec/generators/platform/overlay_spec.rb +0 -36
- data/spec/ui/command_line/commands/gen_extension_spec.rb +0 -22
- data/spec/ui/command_line/commands/gen_overlay_spec.rb +0 -38
- data/static/ronin/generators/platform/Rakefile.erb +0 -5
- data/static/ronin/generators/platform/extension.rb +0 -9
- data/tasks/spec.rb +0 -10
- data/tasks/yard.rb +0 -13
- metadata.gz.sig +0 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
RONIN = 'http://github.com/ronin-ruby'
|
4
|
+
|
5
|
+
gemspec
|
6
|
+
|
7
|
+
gem 'ronin-support', '~> <%= Ronin::Support::VERSION %>', :git => "#{RONIN}/ronin-support.git"
|
8
|
+
gem 'ronin', '~> <%= Ronin::VERSION %>', :git => "#{RONIN}/ronin.git"
|
9
|
+
|
10
|
+
group(:development) do
|
11
|
+
gem 'rake', '~> 0.8.7'
|
12
|
+
|
13
|
+
case RUBY_PLATFORM
|
14
|
+
when 'java'
|
15
|
+
gem 'maruku', '~> 0.6.0'
|
16
|
+
else
|
17
|
+
gem 'rdiscount', '~> 1.6.3'
|
18
|
+
end
|
19
|
+
|
20
|
+
gem 'ore-core', '~> 0.1.0'
|
21
|
+
gem 'ore-tasks', '~> 0.3.0'
|
22
|
+
gem 'rspec', '~> 2.0.0'
|
23
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# <%= @title %>
|
2
|
+
|
3
|
+
* [Source](http://github.com/ronin-ruby/<%= @name %>)
|
4
|
+
* [Issues](http://github.com/ronin-ruby/<%= @name %>/issues)
|
5
|
+
* [Documentation](http://rubydoc.info/github/ronin-ruby/<%= @name %>)
|
6
|
+
* <%= @author %> (<%= @safe_email %>)
|
7
|
+
|
8
|
+
## Description
|
9
|
+
|
10
|
+
<%= @title %> is a Ronin library.
|
11
|
+
|
12
|
+
## Features
|
13
|
+
|
14
|
+
## Synopsis
|
15
|
+
|
16
|
+
$ ronin <%= @dir_name %>
|
17
|
+
|
18
|
+
## Examples
|
19
|
+
|
20
|
+
## Requirements
|
21
|
+
|
22
|
+
* [ronin](http://github.com/ronin-ruby/ronin) ~> <%= Ronin::VERSION %>
|
23
|
+
|
24
|
+
## Install
|
25
|
+
|
26
|
+
$ sudo gem install <%= @name %>
|
27
|
+
|
28
|
+
## License
|
29
|
+
|
30
|
+
<%= @title %> - A Ronin library.
|
31
|
+
|
32
|
+
Copyright (c) <%= Time.new.strftime("%Y") %> <%= @author %> (<%= @safe_email %>)
|
33
|
+
|
34
|
+
This program is free software; you can redistribute it and/or modify
|
35
|
+
it under the terms of the GNU General Public License as published by
|
36
|
+
the Free Software Foundation; either version 2 of the License, or
|
37
|
+
(at your option) any later version.
|
38
|
+
|
39
|
+
This program is distributed in the hope that it will be useful,
|
40
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
41
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
42
|
+
GNU General Public License for more details.
|
43
|
+
|
44
|
+
You should have received a copy of the GNU General Public License
|
45
|
+
along with this program; if not, write to the Free Software
|
46
|
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'bundler'
|
5
|
+
rescue LoadError => e
|
6
|
+
STDERR.puts e.message
|
7
|
+
STDERR.puts "Run `gem install bundler` to install Bundler."
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
|
11
|
+
begin
|
12
|
+
Bundler.setup(:development)
|
13
|
+
rescue Bundler::BundlerError => e
|
14
|
+
STDERR.puts e.message
|
15
|
+
STDERR.puts "Run `bundle install` to install missing gems"
|
16
|
+
exit e.status_code
|
17
|
+
end
|
18
|
+
|
19
|
+
require 'rake'
|
20
|
+
|
21
|
+
require 'ore/tasks'
|
22
|
+
Ore::Tasks.new
|
23
|
+
|
24
|
+
require 'rspec/core/rake_task'
|
25
|
+
RSpec::Core::RakeTask.new
|
26
|
+
task :default => :spec
|
27
|
+
|
28
|
+
require 'yard'
|
29
|
+
YARD::Rake::YardocTask.newrequire 'rubygems'
|
30
|
+
require 'bundler'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
|
5
|
+
root_dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))
|
6
|
+
if File.directory?(File.join(root_dir,'.git'))
|
7
|
+
Dir.chdir(root_dir) do |path|
|
8
|
+
require 'bundler'
|
9
|
+
|
10
|
+
begin
|
11
|
+
Bundler.setup(:default)
|
12
|
+
rescue Bundler::BundlerError => e
|
13
|
+
STDERR.puts e.message
|
14
|
+
STDERR.puts "Run `bundle install` to install missing gems"
|
15
|
+
exit e.status_code
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
lib_dir = File.join(root_dir,'lib')
|
21
|
+
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
|
22
|
+
|
23
|
+
require 'ronin/ui/cli/commands/<%= @command_file %>'
|
24
|
+
|
25
|
+
Ronin::UI::CLI::Commands::<%= @command_class %>.start
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
|
5
|
+
root_dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))
|
6
|
+
if File.directory?(File.join(root_dir,'.git'))
|
7
|
+
Dir.chdir(root_dir) do |path|
|
8
|
+
require 'bundler'
|
9
|
+
|
10
|
+
begin
|
11
|
+
Bundler.setup(:default)
|
12
|
+
rescue Bundler::BundlerError => e
|
13
|
+
STDERR.puts e.message
|
14
|
+
STDERR.puts "Run `bundle install` to install missing gems"
|
15
|
+
exit e.status_code
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
lib_dir = File.join(root_dir,'lib')
|
21
|
+
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
|
22
|
+
|
23
|
+
require 'ronin/ui/console'
|
24
|
+
require 'ronin/ui/cli/commands/console'
|
25
|
+
|
26
|
+
Ronin::UI::Console.auto_load << 'ronin/<%= @dir_name %>'
|
27
|
+
Ronin::UI::CLI::Commands::Console.start
|
@@ -0,0 +1,20 @@
|
|
1
|
+
name: <%= @name %>
|
2
|
+
summary: <%= @summary %>
|
3
|
+
description:
|
4
|
+
<%= @description %>
|
5
|
+
|
6
|
+
license: GPL-2
|
7
|
+
authors: <%= @author %>
|
8
|
+
email: <%= @email %>
|
9
|
+
homepage: <%= @homepage %>
|
10
|
+
has_yard: true
|
11
|
+
|
12
|
+
dependencies:
|
13
|
+
# ronin: ~> <%= Ronin::VERSION %>
|
14
|
+
<%- unless options[:generators].empty? -%>
|
15
|
+
# ronin-gen: ~> <%= Ronin::Gen::VERSION %>
|
16
|
+
<%- end -%>
|
17
|
+
|
18
|
+
development_dependencies:
|
19
|
+
bundler: ~> 1.0.0
|
20
|
+
yard: ~> 0.6.0
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#
|
2
|
+
# <%= @title %> - A Ronin library.
|
3
|
+
#
|
4
|
+
# Copyright (c) <%= Time.new.strftime("%Y") %> <%= @author %> (<%= @safe_email %>)
|
5
|
+
#
|
6
|
+
# This program is free software; you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation; either version 2 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with this program; if not, write to the Free Software
|
18
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
19
|
+
#
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<%= erb File.join('..','..','_license.erb') %>
|
2
|
+
|
3
|
+
require 'ronin/gen/generators/file_generator'
|
4
|
+
|
5
|
+
module Ronin
|
6
|
+
module Gen
|
7
|
+
module Generators
|
8
|
+
class <%= @generator_class %> < FileGenerator
|
9
|
+
|
10
|
+
class_option :opt, :type => :string
|
11
|
+
arguments :arg, :type => :string
|
12
|
+
|
13
|
+
def setup
|
14
|
+
end
|
15
|
+
|
16
|
+
def generate
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<%= erb File.join('..','..','..','_license.erb') %>
|
2
|
+
|
3
|
+
require 'ronin/ui/command_line/command'
|
4
|
+
|
5
|
+
module Ronin
|
6
|
+
module UI
|
7
|
+
module CommandLine
|
8
|
+
module Commands
|
9
|
+
class <%= @command_class %> < Command
|
10
|
+
|
11
|
+
desc 'A command'
|
12
|
+
class_option :name, :type => :string
|
13
|
+
argument :path, :type => :string
|
14
|
+
|
15
|
+
def default
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
--colour --format documentation
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
<%- case @test_suite
|
4
|
+
when :rspec -%>
|
5
|
+
begin
|
6
|
+
gem 'rspec', '~> 2.0.0'
|
7
|
+
require 'rspec/core/rake_task'
|
8
|
+
|
9
|
+
RSpec::Core::RakeTask.new
|
10
|
+
rescue LoadError => e
|
11
|
+
task :spec do
|
12
|
+
abort "Please run `gem install rspec` to install RSpec."
|
13
|
+
end
|
14
|
+
end
|
15
|
+
task :default => :spec
|
16
|
+
<%- when :test_unit -%>
|
17
|
+
<%- end -%>
|
18
|
+
|
19
|
+
<%- if @docs -%>
|
20
|
+
begin
|
21
|
+
gem 'yard', '~> 0.6.0'
|
22
|
+
require 'yard'
|
23
|
+
|
24
|
+
YARD::Rake::YardocTask.new
|
25
|
+
rescue LoadError => e
|
26
|
+
task :yard do
|
27
|
+
abort "Please run `gem install yard` to install YARD."
|
28
|
+
end
|
29
|
+
end
|
30
|
+
<%- end -%>
|
31
|
+
|
32
|
+
# vim: syntax=Ruby
|
@@ -0,0 +1,18 @@
|
|
1
|
+
title: <%= @title %>
|
2
|
+
license: <%= @license %>
|
3
|
+
<%- if @uri -%>
|
4
|
+
uri: <%= @uri %>
|
5
|
+
<%- end -%>
|
6
|
+
<%- if @source -%>
|
7
|
+
source: <%= @source %>
|
8
|
+
<%- end -%>
|
9
|
+
<%- if @website -%>
|
10
|
+
website: <%= @website %>
|
11
|
+
<%- end -%>
|
12
|
+
authors:
|
13
|
+
<%- @authors.each do |name,email| -%>
|
14
|
+
<%= name -%>: <%= email %>
|
15
|
+
<%- end -%>
|
16
|
+
|
17
|
+
description:
|
18
|
+
<%= @description -%>
|
File without changes
|
data/gemspec.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
name: ronin-gen
|
2
|
+
summary: A Ruby library for Ronin that provides various generators.
|
3
|
+
description:
|
4
|
+
Ronin Gen is a Ruby library for Ronin that provides various generators.
|
5
|
+
|
6
|
+
license: GPL-2
|
7
|
+
authors: Postmodern
|
8
|
+
email: postmodern.mod3@gmail.com
|
9
|
+
homepage: http://github.com/ronin-ruby/ronin-gen
|
10
|
+
has_yard: true
|
11
|
+
|
12
|
+
requirements: git >= 1.6.0.0, for the library generator
|
13
|
+
|
14
|
+
dependencies:
|
15
|
+
open_namespace: ~> 0.3.0
|
16
|
+
data_paths: ~> 0.2.1
|
17
|
+
thor: ~> 0.14.3
|
18
|
+
# Ronin dependencies:
|
19
|
+
ronin-support: ~> 0.1.0.pre
|
20
|
+
ronin: ~> 1.0.0.pre
|
21
|
+
|
22
|
+
development_dependencies:
|
23
|
+
bundler: ~> 1.0.0
|
24
|
+
yard: ~> 0.6.1
|
data/lib/ronin/gen.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
#
|
2
|
+
# Ronin Gen - A Ruby library for Ronin that provides various generators.
|
3
|
+
#
|
4
|
+
# Copyright (c) 2009-2010 Hal Brodigan (postmodern.mod3 at gmail.com)
|
5
|
+
#
|
6
|
+
# This program is free software; you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation; either version 2 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with this program; if not, write to the Free Software
|
18
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
19
|
+
#
|
20
|
+
|
21
|
+
require 'ronin/gen/generator'
|
22
|
+
require 'ronin/gen/file_generator'
|
23
|
+
require 'ronin/gen/dir_generator'
|
24
|
+
require 'ronin/gen/generatable'
|
25
|
+
require 'ronin/gen/gen'
|
26
|
+
require 'ronin/gen/version'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Ronin Gen - A Ruby library for Ronin that provides various generators.
|
3
3
|
#
|
4
|
-
# Copyright (c) 2009 Hal Brodigan (postmodern.mod3 at
|
4
|
+
# Copyright (c) 2009-2010 Hal Brodigan (postmodern.mod3 at example.com)
|
5
5
|
#
|
6
6
|
# This program is free software; you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU General Public License as published by
|
@@ -18,16 +18,14 @@
|
|
18
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
19
19
|
#
|
20
20
|
|
21
|
-
require '
|
21
|
+
require 'data_paths'
|
22
22
|
|
23
23
|
module Ronin
|
24
|
-
module
|
25
|
-
module
|
26
|
-
|
27
|
-
class GenOverlay < Generators::Platform::Overlay
|
24
|
+
module Gen
|
25
|
+
module Config
|
26
|
+
include DataPaths
|
28
27
|
|
29
|
-
|
30
|
-
end
|
28
|
+
register_data_dir File.join(File.dirname(__FILE__),'..','..','..','data')
|
31
29
|
end
|
32
30
|
end
|
33
31
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Ronin Gen - A Ruby library for Ronin that provides various generators.
|
3
3
|
#
|
4
|
-
# Copyright (c) 2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
|
+
# Copyright (c) 2009-2010 Hal Brodigan (postmodern.mod3 at gmail.com)
|
5
5
|
#
|
6
6
|
# This program is free software; you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU General Public License as published by
|
@@ -18,12 +18,15 @@
|
|
18
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
19
19
|
#
|
20
20
|
|
21
|
-
require 'ronin/
|
21
|
+
require 'ronin/gen/generator'
|
22
22
|
|
23
23
|
require 'fileutils'
|
24
24
|
|
25
25
|
module Ronin
|
26
|
-
module
|
26
|
+
module Gen
|
27
|
+
#
|
28
|
+
# A {Generator} class for creating directories.
|
29
|
+
#
|
27
30
|
class DirGenerator < Generator
|
28
31
|
|
29
32
|
argument :path, :type => :string, :require => true
|
@@ -44,27 +47,28 @@ module Ronin
|
|
44
47
|
# gen.generate('path/to/dir')
|
45
48
|
#
|
46
49
|
def self.generate(path,options={},arguments=[])
|
47
|
-
|
48
|
-
|
49
|
-
generator = self.new([path] + arguments, options)
|
50
|
-
generator.invoke()
|
50
|
+
super(options,[File.expand_path(path)] + arguments)
|
51
51
|
end
|
52
52
|
|
53
|
-
|
54
|
-
#
|
55
|
-
# Invokes the tasks of the generator.
|
56
|
-
#
|
57
|
-
# @param [Array] names
|
58
|
-
# The task names to invoke.
|
59
|
-
#
|
60
|
-
def invoke(*names,&block)
|
61
|
-
if self.path
|
62
|
-
self.destination_root = self.path
|
63
|
-
end
|
53
|
+
protected
|
64
54
|
|
65
|
-
|
66
|
-
|
67
|
-
|
55
|
+
#
|
56
|
+
# Initializes the generator.
|
57
|
+
#
|
58
|
+
# @param [Array] arguments
|
59
|
+
# Additional arguments for the generator.
|
60
|
+
#
|
61
|
+
# @param [Hash] options
|
62
|
+
# Options to pass to the generator.
|
63
|
+
#
|
64
|
+
# @param [Hash] config
|
65
|
+
# Additional configuration for the generator.
|
66
|
+
#
|
67
|
+
# @since 1.0.0
|
68
|
+
#
|
69
|
+
def initialize(arguments=[],options={},config={})
|
70
|
+
super(arguments,options,config) do |gen|
|
71
|
+
gen.destination_root = self.path
|
68
72
|
end
|
69
73
|
end
|
70
74
|
|