Sha256: f27a51522fa7a3e0ac2c2da84ea55855117e3a8359b3b4c9e2f5d83c2ff2258e

Contents?: true

Size: 1.48 KB

Versions: 3

Compression:

Stored size: 1.48 KB

Contents

module OrigenAppGenerators
  # The base generator class that should be used by all plugin generators
  class Plugin < Application
    def get_common_user_input
      get_name_and_namespace
      get_summary
      get_audience
      # get_revision_control
    end

    protected

    # See Application#filelist for more details
    def filelist
      @filelist ||= begin
        list = super
        list.delete(:web_doc_layout)
        list.delete(:web_references)
        list.delete(:web_defintions)
        list.delete(:web_installation)
        list.delete(:web_introduction)
        list[:gemspec] = { source: 'gemspec.rb', dest: "#{@name}.gemspec" }
        list[:templates_shared] = { dest: 'templates/shared', type: :directory }
        if @audience == :external
          list[:travis] = { source: '.travis.yml' }
        end
        list
      end
    end

    def get_summary
      puts
      puts 'DESCRIBE YOUR NEW PLUGIN IN A FEW WORDS'
      puts
      @summary = get_text(single: true)
    end

    # Prompts the user to say whether the new plugin is intended for an internal
    # or external audience (meaning it will published to rubygems.org)
    def get_audience(proposal = nil)
      puts
      puts 'IS THIS PLUGIN GOING TO BE RELEASED TO AN EXTERNAL AUDIENCE?'
      puts
      puts 'By answering yes...'
      puts
      confirm_external = get_text(confirm: :return_boolean, default: 'no')
      @audience = :external if confirm_external
    end

    def type
      :plugin
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
origen_app_generators-0.2.1 lib/origen_app_generators/plugin.rb
origen_app_generators-0.2.0 lib/origen_app_generators/plugin.rb
origen_app_generators-0.1.0 lib/origen_app_generators/plugin.rb