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.7.40 lib/origen/code_generators/gem_setup.rb
origen-0.7.39 lib/origen/code_generators/gem_setup.rb
origen-0.7.38 lib/origen/code_generators/gem_setup.rb
origen-0.7.37 lib/origen/code_generators/gem_setup.rb
origen-0.7.36 lib/origen/code_generators/gem_setup.rb
origen-0.7.35 lib/origen/code_generators/gem_setup.rb
origen-0.7.34 lib/origen/code_generators/gem_setup.rb
origen-0.7.33 lib/origen/code_generators/gem_setup.rb
origen-0.7.32 lib/origen/code_generators/gem_setup.rb
origen-0.7.31 lib/origen/code_generators/gem_setup.rb
origen-0.7.30 lib/origen/code_generators/gem_setup.rb
origen-0.7.29 lib/origen/code_generators/gem_setup.rb
origen-0.7.28 lib/origen/code_generators/gem_setup.rb
origen-0.7.27 lib/origen/code_generators/gem_setup.rb
origen-0.7.26 lib/origen/code_generators/gem_setup.rb
origen-0.7.25 lib/origen/code_generators/gem_setup.rb
origen-0.7.24 lib/origen/code_generators/gem_setup.rb
origen-0.7.23 lib/origen/code_generators/gem_setup.rb
origen-0.7.22 lib/origen/code_generators/gem_setup.rb
origen-0.7.21 lib/origen/code_generators/gem_setup.rb