Module: Bosh::PluginGenerator::Helpers
- Extended by:
- Forwardable
- Includes:
- Versions::Helpers
- Included in:
- Cli::Command::PluginGenerator
- Defined in:
- lib/bosh/plugin_generator/helpers.rb
Instance Attribute Summary collapse
-
#bosh_version ⇒ Object
Returns the value of attribute bosh_version.
-
#commands_folder ⇒ Object
Returns the value of attribute commands_folder.
-
#helpers_folder ⇒ Object
Returns the value of attribute helpers_folder.
-
#lib_folder ⇒ Object
Returns the value of attribute lib_folder.
-
#plugin_folder ⇒ Object
Returns the value of attribute plugin_folder.
-
#plugin_name ⇒ Object
Returns the value of attribute plugin_name.
Instance Method Summary collapse
Instance Attribute Details
#bosh_version ⇒ Object
Returns the value of attribute bosh_version.
8 9 10 |
# File 'lib/bosh/plugin_generator/helpers.rb', line 8 def bosh_version @bosh_version end |
#commands_folder ⇒ Object
Returns the value of attribute commands_folder.
8 9 10 |
# File 'lib/bosh/plugin_generator/helpers.rb', line 8 def commands_folder @commands_folder end |
#helpers_folder ⇒ Object
Returns the value of attribute helpers_folder.
8 9 10 |
# File 'lib/bosh/plugin_generator/helpers.rb', line 8 def helpers_folder @helpers_folder end |
#lib_folder ⇒ Object
Returns the value of attribute lib_folder.
8 9 10 |
# File 'lib/bosh/plugin_generator/helpers.rb', line 8 def lib_folder @lib_folder end |
#plugin_folder ⇒ Object
Returns the value of attribute plugin_folder.
8 9 10 |
# File 'lib/bosh/plugin_generator/helpers.rb', line 8 def plugin_folder @plugin_folder end |
#plugin_name ⇒ Object
Returns the value of attribute plugin_name.
8 9 10 |
# File 'lib/bosh/plugin_generator/helpers.rb', line 8 def plugin_name @plugin_name end |
Instance Method Details
#extract_options(plugin_name) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/bosh/plugin_generator/helpers.rb', line 15 def (plugin_name) @plugin_name = plugin_name @plugin_folder = plugin_name @bosh_version = bosh_gem_latest_version @license_type = [:license] @lib_folder = File.join(plugin_name, 'lib', 'bosh') @spec_folder = File.join(plugin_name, 'spec') @helpers_folder = File.join(lib_folder, short_plugin_name) @commands_folder = File.join(lib_folder, 'cli', 'commands') default_context = { email: Git.global_config["user.email"], author: Git.global_config["user.name"], description: "Short description.", license: nil, full_plugin_name: full_plugin_name, short_plugin_name: short_plugin_name, class_name: short_plugin_name.split('_').collect(&:capitalize).join, bosh_version: bosh_version } context = default_context.merge() raise "You need to specify email and author" if context[:email].nil? || context[:author].nil? templates_folder = File.("../../../../templates", __FILE__) @generator = Bosh::TemplateGenerator::Generator.new(context, source_folder: templates_folder) end |
#generate_files ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/bosh/plugin_generator/helpers.rb', line 41 def generate_files generate_command_class generate_helpers generate_version generate_gemspec generate_readme generate_license if license? generate_developer_environment end |