Class: Retrospec::Plugins::V1::PluginGen
- Inherits:
-
Plugin
- Object
- Plugin
- Retrospec::Plugins::V1::PluginGen
- Defined in:
- lib/retrospec/plugins/v1/plugin/plugin_gen.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(supplied_module_path = '.', config = {}) ⇒ PluginGen
constructor
A new instance of PluginGen.
- #run ⇒ Object
Constructor Details
#initialize(supplied_module_path = '.', config = {}) ⇒ PluginGen
Returns a new instance of PluginGen.
12 13 14 15 |
# File 'lib/retrospec/plugins/v1/plugin/plugin_gen.rb', line 12 def initialize(supplied_module_path='.',config={}) super @context = ::PluginGen::SpecObject.new(module_path, config) end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
10 11 12 |
# File 'lib/retrospec/plugins/v1/plugin/plugin_gen.rb', line 10 def context @context end |
Class Method Details
.cli_options(global_opts) ⇒ Object
23 24 25 26 27 |
# File 'lib/retrospec/plugins/v1/plugin/plugin_gen.rb', line 23 def self.(global_opts) Trollop:: do opt :name, "The name of the new plugin", :require => false, :short => '-n', :type => :string, :default => File.basename(File.(global_opts[:module_path])) end end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 |
# File 'lib/retrospec/plugins/v1/plugin/plugin_gen.rb', line 17 def run safe_create_module_files(template_dir, module_path, context) create_main_file create_plugin_file end |