Sha256: 09530f3ab79927a7697fb6bf636d3ad23fb45e8025400c0fab426d04092e89de

Contents?: true

Size: 1.27 KB

Versions: 149

Compression:

Stored size: 1.27 KB

Contents

module Origen
  module CodeGenerators
    class GemSetup < Origen::CodeGenerators::Base
      desc <<-END
This generator creates a gemspec file in the top-level directory to allow it
to be packed up and distributed as a gem.
END
      def create_gemspec_file
        @summary = ask 'Describe your plugin in a few words:'
        template 'templates/code_generators/gemspec.rb', File.join(Origen.root, "#{Origen.app.name}.gemspec")
      end

      def create_master_require_file
        file = "#{Origen.root}/lib/#{Origen.app.name}.rb"
        if File.exist?(file)
          prepend_to_file file, <<-END
require "origen"
require_relative "../config/application.rb"
require_relative "../config/environment.rb"

END
        else
          create_file file do
            <<-END
require "origen"
require_relative "../config/application.rb"
require_relative "../config/environment.rb"
END
          end
        end
      end

      def verify_semver
        unless Origen.app.version.semantic?
          puts <<-END

Warning, you application is not currently using semantic (1.2.3) versioning, this must be used if
you want to publish your plugin as a gem.

To upgrade your application to semantic versioning run the following command:

  origen add semver

END
        end
      end
    end
  end
end

Version data entries

149 entries across 149 versions & 1 rubygems

Version Path
origen-0.34.0 lib/origen/code_generators/gem_setup.rb
origen-0.33.3 lib/origen/code_generators/gem_setup.rb
origen-0.33.2 lib/origen/code_generators/gem_setup.rb
origen-0.33.1 lib/origen/code_generators/gem_setup.rb
origen-0.33.0 lib/origen/code_generators/gem_setup.rb
origen-0.32.1 lib/origen/code_generators/gem_setup.rb
origen-0.32.0 lib/origen/code_generators/gem_setup.rb
origen-0.31.0 lib/origen/code_generators/gem_setup.rb
origen-0.30.0 lib/origen/code_generators/gem_setup.rb
origen-0.29.0 lib/origen/code_generators/gem_setup.rb
origen-0.28.2 lib/origen/code_generators/gem_setup.rb
origen-0.28.1 lib/origen/code_generators/gem_setup.rb
origen-0.28.0 lib/origen/code_generators/gem_setup.rb
origen-0.27.0 lib/origen/code_generators/gem_setup.rb
origen-0.26.0 lib/origen/code_generators/gem_setup.rb
origen-0.25.1 lib/origen/code_generators/gem_setup.rb
origen-0.25.0 lib/origen/code_generators/gem_setup.rb
origen-0.24.0 lib/origen/code_generators/gem_setup.rb
origen-0.23.0 lib/origen/code_generators/gem_setup.rb
origen-0.22.0 lib/origen/code_generators/gem_setup.rb